[Pharo 5] Symbol #'distance_2pts' not accepted at package installation

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

[Pharo 5] Symbol #'distance_2pts' not accepted at package installation

HilaireFernandes
This symbol is not accepted when installing DrGeo package in Pharo 5,
but in the playground it is ok to type in symbol #'distance_2pts'

https://pharo.fogbugz.com/f/cases/18071/Symbol-distance_2pts-not-accepted-at-package-installation

Hilaire


--
Dr. Geo
http://drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo 5] Symbol #'distance_2pts' not accepted at package installation

Nicolai Hess-3-2


2016-04-24 11:34 GMT+02:00 Hilaire <[hidden email]>:
This symbol is not accepted when installing DrGeo package in Pharo 5,
but in the playground it is ok to type in symbol #'distance_2pts'

https://pharo.fogbugz.com/f/cases/18071/Symbol-distance_2pts-not-accepted-at-package-installation

Hilaire


Hi Hilaire,

can you point me to the repository where this DrGeo package is.

 

--
Dr. Geo
http://drgeo.eu



Reply | Threaded
Open this post in threaded view
|

Re: [Pharo 5] Symbol #'distance_2pts' not accepted at package installation

HilaireFernandes
Hi Nicolai,

http://smalltalkhub.com/#!/~HilaireFernandes/DrGeo

You can't use the installation procedure described in the wiki, because
Pharo5 also got stuck when loading a dependent package (gettext package
to name it).
You should manually load the DrGeoII-Core package, then DrGeoII-Polymoprh

The problem occurs when loading DrGeoII-Core.

Hilaire



Le 24/04/2016 11:41, Nicolai Hess a écrit :
>
> Hi Hilaire,
>
> can you point me to the repository where this DrGeo package is.
>
>  

--
Dr. Geo
http://drgeo.eu


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo 5] Symbol #'distance_2pts' not accepted at package installation

Max Leske
Hilaire,

did you see the comments in the issue you opened?

Cheers,
Max

> On 24 Apr 2016, at 12:10, Hilaire <[hidden email]> wrote:
>
> Hi Nicolai,
>
> http://smalltalkhub.com/#!/~HilaireFernandes/DrGeo
>
> You can't use the installation procedure described in the wiki, because
> Pharo5 also got stuck when loading a dependent package (gettext package
> to name it).
> You should manually load the DrGeoII-Core package, then DrGeoII-Polymoprh
>
> The problem occurs when loading DrGeoII-Core.
>
> Hilaire
>
>
>
> Le 24/04/2016 11:41, Nicolai Hess a écrit :
>>
>> Hi Hilaire,
>>
>> can you point me to the repository where this DrGeo package is.
>>
>>
>
> --
> Dr. Geo
> http://drgeo.eu
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo 5] Symbol #'distance_2pts' not accepted at package installation

stepharo
In reply to this post by HilaireFernandes


Le 24/4/16 à 12:10, Hilaire a écrit :
> Hi Nicolai,
>
> http://smalltalkhub.com/#!/~HilaireFernandes/DrGeo
>
> You can't use the installation procedure described in the wiki, because
> Pharo5 also got stuck when loading a dependent package (gettext package
> to name it).
 From where do you load gettext because I can have a look.
Your work is important to me :)

Stef

> You should manually load the DrGeoII-Core package, then DrGeoII-Polymoprh
>
> The problem occurs when loading DrGeoII-Core.
>
> Hilaire
>
>
>
> Le 24/04/2016 11:41, Nicolai Hess a écrit :
>> Hi Hilaire,
>>
>> can you point me to the repository where this DrGeo package is.
>>
>>  


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo 5] Symbol #'distance_2pts' not accepted at package installation

Stephan Eggermont-3
On 24-04-16 21:35, stepharo wrote:

>
>
> Le 24/4/16 à 12:10, Hilaire a écrit :
>> Hi Nicolai,
>>
>> http://smalltalkhub.com/#!/~HilaireFernandes/DrGeo
>>
>> You can't use the installation procedure described in the wiki, because
>> Pharo5 also got stuck when loading a dependent package (gettext package
>> to name it).
> From where do you load gettext because I can have a look.
> Your work is important to me :)

It is a simple, but annoying problem. A symbol with whitespace between the
# and the literal is no longer accepted by RBScanner>scanLiteral

scanLiteral
     "Do not allow whitespace between # and the literal."

     "Do not allow number literals after the #"

     self step.
     characterType = #alphabetic
         ifTrue: [ ^ self scanSymbol ].
     characterType = #binary
         ifTrue:
             [ ^ (self scanBinary: RBLiteralToken)
                 stop: self previousStepPosition ].
     currentCharacter = $'
         ifTrue: [ ^ self scanStringSymbol ].
     (currentCharacter = $( or: [ currentCharacter = $[ ])
         ifTrue: [ ^ self scanLiteralArrayToken ].
     "Accept multiple #."
     currentCharacter = $#
         ifTrue: [ ^ self scanLiteral ].
     ^ self scanError: 'Expecting a literal type'

vs

scanLiteral
     self step.
     self stripSeparators.
     characterType = #alphabetic
         ifTrue: [ ^ self scanSymbol ].
     characterType = #binary
         ifTrue: [ ^ (self scanBinary: RBLiteralToken) stop: self
previousStepPosition ].
     currentCharacter = $'
         ifTrue: [ ^ self scanStringSymbol ].
     (currentCharacter = $( or: [ currentCharacter = $[ ])
         ifTrue: [ ^ self scanLiteralArrayToken].
     "Accept some strange literals like '#1', '# species' and '##species:'"
     characterType = #digit
         ifTrue: [ ^ self scanNumber ].
     currentCharacter = $#
         ifTrue: [ ^ self scanLiteral ].
     ^self scanError: 'Expecting a literal type' translated.

The problem is that recovering from that while loading code asks for
rather well-developed debugging skills... It is faster to just load the code
in an old Pharo image, fix it there and commit a new version

Stephan


Reply | Threaded
Open this post in threaded view
|

Re: [Pharo 5] Symbol #'distance_2pts' not accepted at package installation

Ben Coman
On Mon, Apr 25, 2016 at 4:03 AM, Stephan Eggermont <[hidden email]> wrote:

> On 24-04-16 21:35, stepharo wrote:
>>
>>
>>
>> Le 24/4/16 à 12:10, Hilaire a écrit :
>>>
>>> Hi Nicolai,
>>>
>>> http://smalltalkhub.com/#!/~HilaireFernandes/DrGeo
>>>
>>> You can't use the installation procedure described in the wiki, because
>>> Pharo5 also got stuck when loading a dependent package (gettext package
>>> to name it).
>>
>> From where do you load gettext because I can have a look.
>> Your work is important to me :)
>
>
> It is a simple, but annoying problem. A symbol with whitespace between the
> # and the literal is no longer accepted by RBScanner>scanLiteral

That seems a bad regression, to break loading code that
loads fine with Pharo 4, and could be a common scenario.

>
> scanLiteral
>     "Do not allow whitespace between # and the literal."
>
>     "Do not allow number literals after the #"
>
>     self step.
>     characterType = #alphabetic
>         ifTrue: [ ^ self scanSymbol ].
>     characterType = #binary
>         ifTrue:
>             [ ^ (self scanBinary: RBLiteralToken)
>                 stop: self previousStepPosition ].
>     currentCharacter = $'
>         ifTrue: [ ^ self scanStringSymbol ].
>     (currentCharacter = $( or: [ currentCharacter = $[ ])
>         ifTrue: [ ^ self scanLiteralArrayToken ].
>     "Accept multiple #."
>     currentCharacter = $#
>         ifTrue: [ ^ self scanLiteral ].
>     ^ self scanError: 'Expecting a literal type'
>
> vs
>
> scanLiteral
>     self step.
>     self stripSeparators.
>     characterType = #alphabetic
>         ifTrue: [ ^ self scanSymbol ].
>     characterType = #binary
>         ifTrue: [ ^ (self scanBinary: RBLiteralToken) stop: self
> previousStepPosition ].
>     currentCharacter = $'
>         ifTrue: [ ^ self scanStringSymbol ].
>     (currentCharacter = $( or: [ currentCharacter = $[ ])
>         ifTrue: [ ^ self scanLiteralArrayToken].
>     "Accept some strange literals like '#1', '# species' and '##species:'"
>     characterType = #digit
>         ifTrue: [ ^ self scanNumber ].
>     currentCharacter = $#
>         ifTrue: [ ^ self scanLiteral ].
>     ^self scanError: 'Expecting a literal type' translated.
>
> The problem is that recovering from that while loading code asks for
> rather well-developed debugging skills... It is faster to just load the code
> in an old Pharo image, fix it there and commit a new version

Wouldn't you then have the problem of manually tracking down
that space in your codebase ?

Is it feasible to have a setting for compatibility so old code can at
least be loaded in Pharo 5? Then a re-compilation with setting
disabled would directly identify the error to be fixed.   Maybe even
Monticello could always temporarily enable the setting while loading -
with that behaviour removed for Pharo 6.

cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: [Pharo 5] Symbol #'distance_2pts' not accepted at package installation

SergeStinckwich
On Mon, Apr 25, 2016 at 10:19 AM, Ben Coman <[hidden email]> wrote:

> On Mon, Apr 25, 2016 at 4:03 AM, Stephan Eggermont <[hidden email]> wrote:
>> On 24-04-16 21:35, stepharo wrote:
>>>
>>>
>>>
>>> Le 24/4/16 à 12:10, Hilaire a écrit :
>>>>
>>>> Hi Nicolai,
>>>>
>>>> http://smalltalkhub.com/#!/~HilaireFernandes/DrGeo
>>>>
>>>> You can't use the installation procedure described in the wiki, because
>>>> Pharo5 also got stuck when loading a dependent package (gettext package
>>>> to name it).
>>>
>>> From where do you load gettext because I can have a look.
>>> Your work is important to me :)
>>
>>
>> It is a simple, but annoying problem. A symbol with whitespace between the
>> # and the literal is no longer accepted by RBScanner>scanLiteral
>
> That seems a bad regression, to break loading code that
> loads fine with Pharo 4, and could be a common scenario.
>
>>
>> scanLiteral
>>     "Do not allow whitespace between # and the literal."
>>
>>     "Do not allow number literals after the #"
>>
>>     self step.
>>     characterType = #alphabetic
>>         ifTrue: [ ^ self scanSymbol ].
>>     characterType = #binary
>>         ifTrue:
>>             [ ^ (self scanBinary: RBLiteralToken)
>>                 stop: self previousStepPosition ].
>>     currentCharacter = $'
>>         ifTrue: [ ^ self scanStringSymbol ].
>>     (currentCharacter = $( or: [ currentCharacter = $[ ])
>>         ifTrue: [ ^ self scanLiteralArrayToken ].
>>     "Accept multiple #."
>>     currentCharacter = $#
>>         ifTrue: [ ^ self scanLiteral ].
>>     ^ self scanError: 'Expecting a literal type'
>>
>> vs
>>
>> scanLiteral
>>     self step.
>>     self stripSeparators.
>>     characterType = #alphabetic
>>         ifTrue: [ ^ self scanSymbol ].
>>     characterType = #binary
>>         ifTrue: [ ^ (self scanBinary: RBLiteralToken) stop: self
>> previousStepPosition ].
>>     currentCharacter = $'
>>         ifTrue: [ ^ self scanStringSymbol ].
>>     (currentCharacter = $( or: [ currentCharacter = $[ ])
>>         ifTrue: [ ^ self scanLiteralArrayToken].
>>     "Accept some strange literals like '#1', '# species' and '##species:'"
>>     characterType = #digit
>>         ifTrue: [ ^ self scanNumber ].
>>     currentCharacter = $#
>>         ifTrue: [ ^ self scanLiteral ].
>>     ^self scanError: 'Expecting a literal type' translated.
>>
>> The problem is that recovering from that while loading code asks for
>> rather well-developed debugging skills... It is faster to just load the code
>> in an old Pharo image, fix it there and commit a new version
>
> Wouldn't you then have the problem of manually tracking down
> that space in your codebase ?
>
> Is it feasible to have a setting for compatibility so old code can at
> least be loaded in Pharo 5? Then a re-compilation with setting
> disabled would directly identify the error to be fixed.   Maybe even
> Monticello could always temporarily enable the setting while loading -
> with that behaviour removed for Pharo 6.

Normally there is already a setting to use the old parser.
I have done something similar recently in order to load old code,
I just switch the setting before loading my old code and then fix the code.

Regards,
--
Serge Stinckwich
UCBN & UMI UMMISCO 209 (IRD/UPMC)
Every DSL ends up being Smalltalk
http://www.doesnotunderstand.org/