Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 905981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T16:18:38+00:00 2026-05-15T16:18:38+00:00

I have reduced down to a small example some code that I have, which

  • 0

I have reduced down to a small example some code that I have, which tests for whether a variable called class-name has a value assigned to it:

ask-params: function [
    config-file [file!]
    default-class-name
    default-fields
] [
    probe value? 'class-name
    input
    either (value? 'class-name) [
        probe class-name
    ] [
        ;-- omit code in this branch for now
    ]
]

ret-block: ask-params %simple-class.params.txt "Person" "First Name, Last Name"

The expression value? 'class-name returns false here. On the other hand, if I fill in the missing branch with an assignment:

ask-params: function [
    config-file [file!]
    default-class-name
    default-fields
] [
    probe value? 'class-name
    input
    either (value? 'class-name) [
        probe class-name
    ] [
        class-name: default-class-name
    ]
]

ret-block: ask-params %simple-class.params.txt "Person" "First Name, Last Name"

This will return true for value? 'class-name. But in this second case, class-name: default-class-name isn’t even executed yet.

I would think that class-name shouldn’t exist in memory, so value? 'class-name should be returning false. Why is value? returning true instead?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T16:18:39+00:00Added an answer on May 15, 2026 at 4:18 pm

    You are using function. This scans the body of the function and pre-creates the local variables for you, initialized to NONE. That’s why value? 'class-name becomes true (because NONE is a legal value for a variable, distinct from the situation of being “unset”).

    If you used func instead, then both would return false.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 520k
  • Answers 520k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try specifying the dataType: ... type: 'POST', dataType: 'json', ... May 16, 2026 at 8:40 pm
  • Editorial Team
    Editorial Team added an answer Just resize the tableView as per your requirement ..........either from… May 16, 2026 at 8:40 pm
  • Editorial Team
    Editorial Team added an answer No. I don't think your can force string to be… May 16, 2026 at 8:40 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

i just discovered http://code.google.com/p/re2 , a promising library that uses a long-neglected way (
I have a custom view which is composed of a number of UIImageViews. These
I have a PHP script that launches another script in the background. Recently my
Algorithm to generate all possible letter combinations of given string down to 2 letters
I have found several articles on the Web regarding drawing a dashed line in
I am working on a game engine which is loosely descended from Quake 2,
I am writing a small simulation of a boat (a sailboat under power rather
This is an odd thing I've just run into. I have a web application
Ok. I have an array with multiple objects populated by my core data stack
This is my first post, have been a lurker for a long time, so

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.