Language ideas
Robert Brenstein
rjb at robelko.com
Sun May 22 18:51:34 EDT 2005
> > Hershel, the construct "there is a" is already in the language. It's
>> used to check for existence of something (object in a stack, file,
>> directory). Xavier just suggested new options: to check whether a
>> volume (it should be volume or partition not drive) is mounted
>> (volume in question could be local, remote, or virtual) or whether a
>> control is inside a specific group. The current syntax allows
>> checking only whether a control exists.
>>
>Yes, thanks for making me aware of it, my problem, I used looping instead
>(hopefully no more).
>That again proves my point that the language is a bit big and should not get
>bigger. Instead I'd suggest to do some changes instead of adding operators,
>to be able to combine operators, "there is a" is actual 1 operator, instead
>"there" a keyword "is" and "not" are already implemented should be able to
>work together. That will enable to write 'if "abc" contains not "d"' instead
>of writing 'if "abc" contains "d" is false', if "whatever" exist not',
>using the same concept across the board. What I would work on this moment is
>to be able to use the language asis (maybe a bit reduced) to be able mix and
>mach the existing keywords operators and so on.
>If I'll be busy learning languages all the time I might become a programmer,
>well I'm in the money making business, if it doesn't go in programming I'll
>sell homes if it wouldn't go with homes I'll sell big buildings. The bottom
>line is to make a living and support my family.
>Thanks, no offence to anybody just expressing my self.
>Hershel Fisch
>
Unless I misunderstand what you are saying, yes, you can combine 'not'
if there is a file z then
if there is not a file z then
if x is in y then
if x is not in y then
if x is among words of y then
if x is not among words of y then
etc
'contains' seems to be the only exception to that syntax but you can say
if z contains x then
if not (z contains x) then
Also, 'contains' is the same as 'is in' just acting in opposite
direction, so you can also say
if x is not in z then
What Xavier suggested for 'there' was not adding a new operator but
extending the existing operator to new objects. That is quite
different, although I came to realize in the meantime that 'there is
a volume x' can be achieved already with 'x is among the lines of
volumes()' and checking about control inside a group can be achieved
by inspecting the owner of that control, so the new syntax would be
just a shortcut in both instances. Nevertheless it would often make
the code clearer, so I still think these could be worthwhile
additions.
Robert
More information about the use-livecode
mailing list