Pragma syntax

Lukas Renggli renggli at gmail.com
Sat Aug 19 15:28:03 UTC 2006


Hi Andrew,

> But, why is that the definition? Why not binary selectors? Is it...
>     because VW doesn't allow binary selectors?

No. I don't know if binary selectors are allowed in VW.

>     because the grammar would become ambiguous?

Yes. For example this would be ambigous to parse: <>1> (the pragma
with the selector #> and the arguments #(1)) or <=#foo> (the pragma
with the selector #= and the arguments #(foo)).

>     the free stuff (searching for senders) wouldn't work with binaries?

No.

>     nobody suggested it?

No.

>     considered unnecessary?

No, but frankly I can't think of an example where this would make
sense. The pragmas I have in mind and those that I have seen in other
people's code are not mathematical operators. Maybe you can provide an
example where this would be useful?

Note 1: I see the pragma selector as a message that can be sent to an
object to configure it somehow, binary selectors usually have a
slightly different meaning.

Note 2: It would be easy to allow pragmas like this <* 6>, <,
'world'>, basically one line of code that needs to be updated.

> Excellent. I'll test it out once it's there.

I published it to http://source.squeakfoundation.org/inbox, please
have a look. The tests do all run, I only changed one method that does
the parsing of the selector. The correction algorithm is the same as
the one used to correct selectors of normal message sends in your
code.

-----------------------------------------------

Name: Compiler-lr.54
Author: lr
Time: 19 August 2006, 5:09:02 pm
UUID: 9ea70c0b-1ebc-4d35-b9f2-bfa1e5e57f8d
Ancestors: Compiler-md.53

- offer to correct pragma message selectors if they are unknown to the system

-----------------------------------------------

Cheers,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch



More information about the Squeak-dev mailing list