jon klein | 2 Feb 2004 16:48

Re: Comparing lists


On Feb 2, 2004, at 10:33 AM, Rick Giuly wrote:

> What do you think about having a special syntax to get the size of a 
> list:
>
> size of myList
> or
> size(myList)
> or
> |myList|    #i like this one
>
> I think that would make clearer code than cast to integer.

I think |myList| would be a good idea.  I'm planning to allow | x | to 
be
used for the absolute value of an integer or float, so perhaps | x | 
could
be a general operator to give the "magnitude" of an expression:

| myList |   -> length of list
| myInt |    -> absolute value of int
| myFloat |  -> absolute value of float
| myVector | -> length of vector
| myString | -> number of characters in the string [?]

- jon klein

_______________________________________________
breve mailing list
breve <at> spiderland.org
http://www.spiderland.org/mailman/listinfo/breve


Gmane