opensubscriber
   Find in this group all groups
 
Unknown more information…

x : xtalks@yahoogroups.com 8 January 2005 • 5:37AM -0500

Re: [xTalks] Are arrays core?
by Doug Simons

REPLY TO AUTHOR
 
REPLY TO GROUP






On Jan 7, 2005, at 1:47 PM, Dar Scott wrote:

> The ability to nest property lists and to add scripts is pretty cool.
>
> Can a function return a property list and it be a parameter in another
> function like this?
>
>         chain( a, chain( b, c) )

Yes.

> Can chuck expressions in senseTalk include lists and property lists?

List items can be accessed using the standard chunk syntax. Property
lists are inherently different, since properties are accessed by name,
not by their ordinal number.

> There might be some nice alternatives to a[b] notation.  That must be
> from Fortran.

:-) Probably so, or maybe even before Fortran (whatever that would have
been!). Object (property list) properties in SenseTalk can be accessed
using several syntaxes. Here's an example from the documentation:
put (firstName:”Joseph”, age:50) into joe
put property age of joe -- 50
put the age of joe -- 50
put joeʼs firstName -- Joseph
put joe.firstName -- Joseph

Since properties are containers, you can also change their value using
the same syntaxes:
add 1 to joe's age
set the lastName of joe to "Peabody"

> It seems to me that property lists and Rev arrays can benefit from
> features of the other.
>
> I agree that structures or aggregations are important.  I also like the
> notion of the simple single primitive type, and I have tried to resolve
> those (making structures virtually strings) to make all the same single
> universal type, but those suggestions may be too awkward.  The result
> of arithmetic in HC and Rev is a small wart on the single primitive
> type idea; they are not quite virtually strings.

Ah, yes. It is unfortunate that there are situations where a scripter
has to become aware of the fact that a number and a string are not the
same thing, and pay attention to exactly when a number gets converted
to a string representation. I guess I sort of accepted that as just
"the way it is" a long time ago. And now I've extended that same
thinking to dates, lists, and property lists. I focused on the
fundamental principle that "any value can be viewed as a string", which
it can be. But there are still times when it makes a difference what
internal format a value is being stored in. I guess nothing is perfect!

Cheers,

Doug



To unsubscribe, send e-mail to xTalks-unsubscribe@yaho...
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/xTalks/

<*> To unsubscribe from this group, send an email to:
    xTalks-unsubscribe@yaho...

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/


Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.