[squeak-dev] Assignment vs binary selector

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Assignment vs binary selector

Igor Stasenko
I wonder,
if expression

a :== 5

having right to live?
Since there is no restrictions on binary selectors length, a #:=
followed by any binary char(s) can be treated as binary selector
instead of assignment, followed by syntax error.

What you think?

--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Assignment vs binary selector

Igor Stasenko
One more thing which i discovered in current parser:

#$A inspect

returns a character, not symbol. Is this correct to the syntaxt rules?

If not, what symbol it should be
#A
or
# '$A'
instead?


--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

[squeak-dev] Re: Assignment vs binary selector

Paolo Bonzini-2
Igor Stasenko wrote:
> One more thing which i discovered in current parser:
>
> #$A inspect
>
> returns a character, not symbol. Is this correct to the syntaxt rules?

It should be a syntax error, period.  Like

> a :== 5

should.

One idea I was toying with was to allow . in binary selectors, except
for the special #. of course; this goes along with the idea of
considering . to be a statement terminator only if not followed by
whitespace (avoiding the unintuitive behavior of {1.0.2.0}).  For example,

1..5 do: [ :i | Transcript show: i ]

Paolo

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Re: Assignment vs binary selector

Eliot Miranda-2


On Fri, Nov 21, 2008 at 3:39 AM, Paolo Bonzini <[hidden email]> wrote:
Igor Stasenko wrote:
> One more thing which i discovered in current parser:
>
> #$A inspect
>
> returns a character, not symbol. Is this correct to the syntaxt rules?

It should be a syntax error, period.  Like

> a :== 5

should.

One idea I was toying with was to allow . in binary selectors, except
for the special #. of course; this goes along with the idea of
considering . to be a statement terminator only if not followed by
whitespace (avoiding the unintuitive behavior of {1.0.2.0}).  For example,

1..5 do: [ :i | Transcript show: i ]

+1000

Yes!! Yes!! Yes!!

etc...
 


Paolo