At 5:10 AM -0700 5/23/2000, Scott Raney <[EMAIL PROTECTED]> wrote:
>On Mon, 22 May 2000, Jacqueline Landman Gay wrote:
>> > Then what is value("1+1")? Should it be the string "1+1"? Or the
>> > expected result of 2?
>>
>> I'd say if it were in quotes, it should be treated as a string literal
>> and the value should be "1+1". If it isn't in quotes, the value should
>> be 2.
>
>This is exactly the way MetaCard works.  What it doesn't do currently
>is pass back the entire string if the evaluation of it as an
>expression fails.  This will be easy to change to improve
>compatibility, but is really an abuse of the value() function, which
>even in the HyperCard documentation is specified to work on
>*expressions*, not arbitrary strings of characters.

A string considered as an arbitrary string of characters *is* an
expression, though, albeit the simplest type of expression, one that
consists of a single factor. String is a data type, after all, and that
makes
  "This is a string"
as much an expression as
  true
or
  17
Even if you don't try to go inside the quotes to evaluate its content.

I think you can make a case, conceptually, for the value function doing one
more round of parsing on a string literal. But you can make just as good a
case for treating a quoted string as a factor instead - and doing so lets
you do additional things with the value function. Between that and the
compatibility argument, I think Jacque has made the case for changing the
behavior here.

--
jeanne a. e. devoto ~ [EMAIL PROTECTED]
http://www.jaedworks.com



Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to