Right, but my point is that this behaviour is inconsistent. Generally if an
xtalk interpreter will, given a token which is a variable take the value of
a variable; and given a token which is not a variable treat it as an
unquoted literal; then we have the alternative to supply a quoted literal.
Here that produces a syntax error; I don't think it should.
 
  Ben Rubinstein               |  Email: [EMAIL PROTECTED]
  Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
  http://www.cogapp.com        |  Fax  : +44 (0)1273-728866


> From: "Ken Ray" <[EMAIL PROTECTED]>
> Organization: Sons of Thunder Software
> Reply-To: [EMAIL PROTECTED]
> Date: Wed, 20 Mar 2002 09:39:01 -0600
> To: <[EMAIL PROTECTED]>
> Subject: Re: Syntax for (custom) property names
> 
> Ben,
> 
> My guess is that what's happening is that the property is first evaluated to
> see if it is a variable. If it is, the value of the variable is substituted
> for the name, hence:
> 
> put 23 into myStrangeProperty
> put the myStrangeProperty of btn 1 into v
> 
> is asking Rev to "put the 23 of btn 1 into v"; something it can't do. You
> can see this in the following example. Suppose I have an "age" custom
> property for a field (field 1 in this case), and its value is currently "100
> years old". The following works fine:
> 
> put "age" into tPropName
> put the tPropName of fld 1
> 
> Rev subsistuted tPropName for the value in the variable ("age"), so it
> translates to "put the age of fld 1", which in turn puts "100 years old"
> into the message box.
> 
> If the property name is determined *not* to be a variable, it is assumed to
> be the actual property name.
> 
> Hope this helps,
> 
> Ken Ray
> Sons of Thunder Software
> Email: [EMAIL PROTECTED]
> Web site: http://www.sonsothunder.com/
> 
> 
> ----- Original Message -----
> From: "Ben Rubinstein" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 20, 2002 7:18 AM
> Subject: Syntax for (custom) property names
> 
> 
>> (I'm not sure if this is an x-talks issue, or a Rev/MC
> parser/implementation
>> issue.)
>> 
>> Am I missing something, or is the syntax for at least custom property
> names
>> a bit confused?
>> 
>> In the statement
>> put the myStrangeProperty of btn 1 into v
>> 
>> is "myStrangeProperty" a literal or a container?  (My guess is that it's a
>> keyword - but an odd one, because it's never declared (and can't be)).
>> 
>> The statement above fails if "myStrangeProperty" is being used as a
>> container:
>> put 23 into myStrangeProperty
>> put the myStrangeProperty of btn 1 into v
>> 
>> That would suggest it's a literal; in line with other contexts in which
>> Rev/MC will allow a one-word literal to be used without quotes, provided
> it
>> hasn't already been implicitly or explicitly declared as a container.  But
>> it isn't a literal, because
>> 
>> put the "myStrangeProperty" of btn 1 into v
>> 
>> doesn't compile.
>> 
>> 
>> I think what's happening is that the parser won't accept a quoted literal
> in
>> the syntax "the x of <object>", because it thinks 'x' should be a keyword.
>> But the compiler doesn't take 'x' as a keyword; it treats it as a unquoted
>> literal, unless it happens to have already been declared as a container,
> in
>> which case it compiles code to use the value of 'x' as a property name.
>> Thus this works fine:
>> 
>> put "myStrangeProperty" into myStrangeProperty
>> put the myStrangeProperty of btn 1 into v
>> 
>> I feel this is inconsitent.  My suggestion would be that the parser should
>> accept the quoted form:
>> put the "myStrangeProperty" of btn 1 into v
>> 
>> Does this make sense?  Am I failing to appreciate some rationale or value
> in
>> the current situation?
>> 
>> Ben Rubinstein               |  Email: [EMAIL PROTECTED]
>> Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
>> http://www.cogapp.com        |  Fax  : +44 (0)1273-728866
>> 

_______________________________________________
improve-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/improve-revolution

Reply via email to