5.1 rc troubble o feature ?

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

5.1 rc troubble o feature ?

Diaz Cortez
HI ALL

 #3f   don't work
    work around
 #'3F'

best regard

 MDC


Reply | Threaded
Open this post in threaded view
|

Re: 5.1 rc troubble o feature ?

Ian Bartholomew-18
Diaz,

>  #3f   don't work
>     work around
>  #'3F'

This is mentioned in the release notes - #item #1182

"Compiler parsing of symbols that don't require quoting is
too loose, e.g. #1 should not be treated as a valid literal symbol"

"You may find this causes compilation
errors when loading your packages; the error will be 'constant
expected'. Invalid symbols should be quoted, for example #123 should be
written #'123'."

It looks like # can now only be followed by a character - anything else
needs to be quoted.

--
Ian


Reply | Threaded
Open this post in threaded view
|

Re: 5.1 rc troubble o feature ?

Osvaldo Aufiero
I understand that, but the question is WHY ?
¿Was it on purpose or is it a bug?

Thanks

Osvaldo

"Ian Bartholomew" <[hidden email]> wrote in message
news:ATEka.971$[hidden email]...

> Diaz,
>
> >  #3f   don't work
> >     work around
> >  #'3F'
>
> This is mentioned in the release notes - #item #1182
>
> "Compiler parsing of symbols that don't require quoting is
> too loose, e.g. #1 should not be treated as a valid literal symbol"
>
> "You may find this causes compilation
> errors when loading your packages; the error will be 'constant
> expected'. Invalid symbols should be quoted, for example #123 should be
> written #'123'."
>
> It looks like # can now only be followed by a character - anything else
> needs to be quoted.
>
> --
> Ian
>


Reply | Threaded
Open this post in threaded view
|

Re: 5.1 rc troubble o feature ?

Ian Bartholomew-18
Osvaldo,

> I understand that, but the question is WHY ?
> ¿Was it on purpose or is it a bug?

The BlueBook defines a 'symbolic constant' as
    # followed by a symbol

A 'symbol' is defined as one of
        identifier
        binary selector
        keyword

An 'identifier' is defined as
    letter (optionally followed by one or more of)
        letter
        digit

The ANSI spec follows the same format - but uses different (more
precise) terms that differentiate between the two forms

A Hashed String is defined as
    # followed by a quoted string

and

A Quoted Selector is defined as
    # followed by one of
        unarySelector (called identifier in the text)
        binarySelector
        keywordSelector

A unarySelector (identifier) is
    letter (optionally followed by one or more of)
        letter
        digit

#1F is therefore not a valid symbolic constant in either the BlueBook or
the ANSI spec  and, I guess, Dolphin was altered to reflect that fact.

--
Ian


Reply | Threaded
Open this post in threaded view
|

Re: 5.1 rc troubble o feature ?

Dmitry Zamotkin-4
Hello Ian,

> An 'identifier' is defined as
>     letter (optionally followed by one or more of)
>         letter
>         digit

Does "letter" mean an ascii letter? I have used some symbols composed of
Russian letters. After installing RC1 I have to quote they.

D. Zamotkin


Reply | Threaded
Open this post in threaded view
|

Re: 5.1 rc troubble o feature ?

Andy Bower
Dmitry,

> > An 'identifier' is defined as
> >     letter (optionally followed by one or more of)
> >         letter
> >         digit
>
> Does "letter" mean an ascii letter? I have used some symbols composed of
> Russian letters. After installing RC1 I have to quote they.

That seems correct. The original 5.0 parser was incorrect in that it did not
insist on valid ANSI Smalltalk syntax. The 5.1 parser has been modified to
be correct and, in some cases, you will have to change your code.

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---


Reply | Threaded
Open this post in threaded view
|

Re: 5.1 rc troubble o feature ?

Ian Bartholomew-18
In reply to this post by Dmitry Zamotkin-4
Dmitry,

> Does "letter" mean an ascii letter? I have used some symbols composed
> of Russian letters. After installing RC1 I have to quote they.

According to the ANSI spec "letter" is one of

    lowercaseAlphabetic  "a..z"
    uppercaseAlphabetic "A..Z"
    nonCaseLetter "_"
    "implementation defined letters"

It also states that use of the latter is non portable.

Dolphin appears to now completely follow the ANSI <symbol> and
<selector> protocols.  The ANSI definition of "Quoted Selector" uses
"letter" so I would think it correct that symbols using characters not
included above (and not defining valid binary or keyword selectors) need
to be quoted  i.e. they must be "Hashed String"s rather than "Quoted
Selector"s.

--
Ian