On Jan 7, 2005, at 3:31 PM, Dar Scott wrote:
> On Jan 7, 2005, at 2:37 PM, Doug Simons wrote:
>> I focused on the
>> fundamental principle that "any value can be viewed as a string",
>> 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
> I think there is a way, but it might not be worth the cost.
> It might mean decimal arithmetic and doing away with numberFormat (or
> using it differently). If all precision is in the virtual number
> strings then some sort of formatting function is needed, maybe one that
> takes or uses numberFormat. Where one now has 'a & (x/3)', one would
> need 'a & numeralFormat(x/3)' or be content with lots of digits.
> We can probably come up with some axioms of what "any value can be
> viewed as a string" should mean. One consequence should be that the
> user cannot tell whether the result of arithmetic is a string or not.
It's interesting to consider how this might work, but I think the
current system is pretty well entrenched at this point for most xTalk
languages. My goal along these lines at this stage is to make the
integration of different data types as seamless and "natural feeling"
as I can, while providing as much useful functionality as I can. For
example, SenseTalk now stores dates internally as both a number and
possibly a format, so you can do things like this:
put the long date into dueDate
put dueDate -- shows "Friday, January 7, 2005"
add 45 days to dueDate
put dueDate -- shows "Monday, February 21, 2005" (still in the long
There is more that could be done with this some day, but this suggests
the kind of thing that is possible by storing more than just a string
>> 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"
> Some folks designs might end up with weird, but acceptable, statements
> like this:
> put the joe of ages
Sure, that's perfectly legal -- one just wonders exactly what the
script is about. :-)
> With nesting, that is less of a problem. There is little need to do
> that kind of thing.
> put the age of joe of clients
> Can you do one of these?
> put "x" into char 3 of item 2 of the friends of joe
> set char 3 of item 2 of the friends of joe to "x"
Yes, those are all valid.
set clients.joe.age to 27
put the age of joe of clients
and this one:
put (friends:"Merry,Pippin,Sam") into Frodo
put "x" into char 3 of item 2 of the friends of Frodo
set char 3 of item 2 of the friends of Frodo to "y"
put Frodo's friends