Pharo-dev
By thread
pharo-dev@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 1 participants
- 144619 messages
Re: [Pharo-project] Legitimate syntax for # ... foo
by Nicolas Cellier
2010/4/29 Eliot Miranda <eliot.miranda(a)gmail.com>:
>
>
> On Thu, Apr 29, 2010 at 1:25 PM, Nicolas Cellier
> <nicolas.cellier.aka.nice(a)gmail.com> wrote:
>>
>> 2010/4/29 Eliot Miranda <eliot.miranda(a)gmail.com>:
>> >
>> >
>> > On Thu, Apr 29, 2010 at 12:50 PM, Nicolas Cellier
>> > <nicolas.cellier.aka.nice(a)gmail.com> wrote:
>> >>
>> >> I don't think any other st dialect would accept that syntax but Squeak.
>> >
>> > VisualWorks accepts it just fine.
>> > # "hello" foo => #foo
>> > # "hello" (foo # "hello" foo) => #(#foo #foo)
>> > I think this is the way the language works. Â Relax. Â Celebrate its
>> > weirdness. Â Don't sweat the petty stuff, pet the sweaty stuff:
>> >
>> > http://www.popsci.com/gadgets/article/2010-04/exclusive-making-elements-one…
>>
>> Maybe I should relax about comment anywhere, but these:
>>
>> [Compiler evaluate: '#( # 2 # -2 )'] on: Error do: [:exc | exc return:
>> nil].
>> [Compiler evaluate: '# -2'] on: Error do: [:exc | exc return: nil].
>> [Compiler evaluate: '#-2'] on: Error do: [:exc | exc return: nil].
>> [Compiler evaluate: '#$a'] on: Error do: [:exc | exc return: nil].
>> [Compiler evaluate: '##(1##)1)'] on: Error do: [:exc | exc return: nil].
>>
>> would all return nil in VW, not so in Squeak.
>> Also, I mind the difference of first two in Squeak.
>> That's hardly predictable and much too weird to my own taste...
>
> That's fair enough, but that's a different issue to there being allowable
> whitespace between the literal hash and the literal. Â In any case, comparing
> against VW is probably a sensible thing to do.
> best
> Eliot
Here we go: fix at http://code.google.com/p/pharo/issues/detail?id=2371
Some tests from Lukas would be appreciated :)
Nicolas
>>
>> Nicolas
>>
>> >>
>> >> It's just how the parser/scanner works now, but It wouldn't break much
>> >> code IMO if we stop supporting these weirdnesses.
>> >>
>> >> Nicolas
>> >>
>> >> 2010/4/29 Lukas Renggli <renggli(a)gmail.com>:
>> >> > Actually I didn't have all the latest code loaded in the open image.
>> >> > There is more, hold your breath:
>> >> >
>> >> > testSymbolNumbers
>> >> > Â Â Â Â #(('#1' 1) ('#12' 12) ('#12.3' 12.3) ('# 1' 1) ('##1' 1)
>> >> > ('#"bar"1'
>> >> > 1)) do: [ :pair |
>> >> > Â Â Â Â Â Â Â Â tree := RBParser parseExpression: pair first.
>> >> > Â Â Â Â Â Â Â Â self assert: tree value = pair second.
>> >> > Â Â Â Â Â Â Â Â self assert: tree start > 1.
>> >> > Â Â Â Â Â Â Â Â self assert: tree stop = pair first size ]
>> >> >
>> >> > On 29 April 2010 21:12, Lukas Renggli <renggli(a)gmail.com> wrote:
>> >> >>> # "helllooo" foo
>> >> >>>
>> >> >>> prints
>> >> >>> #foo
>> >> >>>
>> >> >>> is this correct?
>> >> >>
>> >> >> Probably not, but the standard compiler accepts it. So I had to
>> >> >> patch
>> >> >> the parser of the refactoring engine to accept a whole series of
>> >> >> degraded constructs. Below a small collection of tests documenting
>> >> >> some of these strange things:
>> >> >>
>> >> >> testSymbolLiteral
>> >> >> Â Â Â Â | tree |
>> >> >> Â Â Â Â #(('# foo' #foo) ('#"bar"foo' #foo) ('##foo' #foo) ('###foo'
>> >> >> #foo)
>> >> >> ('#foo:' #foo:) ('#foo::' #'foo::') ('#foo::bar' #'foo::bar')
>> >> >> ('#foo::bar:' #'foo::bar:') ('#foo::bar::' #'foo::bar::')) do: [
>> >> >> :pair
>> >> >> |
>> >> >> Â Â Â Â Â Â Â Â tree := RBParser parseExpression: pair first.
>> >> >> Â Â Â Â Â Â Â Â self assert: tree value = pair second.
>> >> >> Â Â Â Â Â Â Â Â self assert: tree start = 1.
>> >> >> Â Â Â Â Â Â Â Â self assert: tree stop = pair first size ]
>> >> >>
>> >> >> testStatements
>> >> >> Â Â Â Â | tree |
>> >> >> Â Â Â Â #(('' 0 0) ('.' 0 1) ('| bar |' 0 0) ('| bar | .' 0 1) ('|
>> >> >> bar |
>> >> >> ..'
>> >> >> 0 2) ('foo. bar' 2 1) ('foo. bar.' 2 2) ('foo. bar. .' 2 3) ('. foo.
>> >> >> bar' 2 2)) do: [ :each |
>> >> >> Â Â Â Â Â Â Â Â tree := RBParser parseExpression: each first.
>> >> >> Â Â Â Â Â Â Â Â self assert: tree statements size = each second.
>> >> >> Â Â Â Â Â Â Â Â self assert: tree periods size = each last ]
>> >> >>
>> >> >> testNumberParsing
>> >> >> Â Â Â Â | numbers node |
>> >> >> Â Â Â Â numbers := #(('1' 1) ('-1' -1) ('123' 123) ('123' 123)
>> >> >> ('-123'
>> >> >> -123)
>> >> >> ('1.1' 1.1) ('-1.1' -1.1) ('1.23' 1.23) ('-1.23' -1.23) ('1e3' 1e3)
>> >> >> ('1d3' 1d3) ('1q3' 1q3) ('-1e3' -1e3) ('1e-3' 1e-3) ('-1e-3' -1e-3)
>> >> >> ('2r1e8' Â 2r1e8) ('-2r1e8' -2r1e8) ('2r1e-8' 2r1e-8) ('-2r1e-8'
>> >> >> -2r1e-8) ('0.50s2' 0.50s2) ('0.500s3' 0.500s3) ('0.050s3' 0.050s3)).
>> >> >> Â Â Â Â numbers do: [ :spec |
>> >> >> Â Â Â Â Â Â Â Â node := RBParser parseExpression: spec first.
>> >> >> Â Â Â Â Â Â Â Â self assert: node token source = spec first.
>> >> >> Â Â Â Â Â Â Â Â self assert: node value = spec second ]
>> >> >>
>> >> >> Lukas
>> >> >>
>> >> >> --
>> >> >> Lukas Renggli
>> >> >> www.lukas-renggli.ch
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Lukas Renggli
>> >> > www.lukas-renggli.ch
>> >> >
>> >> > _______________________________________________
>> >> > Pharo-project mailing list
>> >> > Pharo-project(a)lists.gforge.inria.fr
>> >> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >> >
>> >>
>> >> _______________________________________________
>> >> Pharo-project mailing list
>> >> Pharo-project(a)lists.gforge.inria.fr
>> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>> >
>> > _______________________________________________
>> > Pharo-project mailing list
>> > Pharo-project(a)lists.gforge.inria.fr
>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project(a)lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
April 30, 2010
Re: [Pharo-project] [NativeBoost] new win32 build available
by Schwab,Wilhelm K
Interesting. Scary<g> but interesting. At the risk of seeming obsessed with numerical analysis, is there a way to use this for callbacks?
Bill
April 30, 2010
Re: [Pharo-project] [NativeBoost] new win32 build available
by Henrik Sperre Johansen
On 29.04.2010 17:13, Igor Stasenko wrote:
> Core packages were broken, and were unable to load w/o errors.
> But now seems everything loads well.
> Use NBInstaller install.
>
> Thanks to Henrik for help!
Here's a small example, as well as profile:
SmallInteger >> nbFib
<primitive: 'primitiveNativeCall' module: 'NativeBoostPlugin'>
^ NBNativeCodeGen methodAssembly: [:gen |
| loopStart proxy asm EAX EBX ECX |
asm := gen asm.
proxy := NBInterpreterProxy new asm: asm.
loopStart := asm uniqueLabelName: 'loopStart'.
EAX := asm assembler reg0.
EBX := asm assembler reg3.
ECX := asm assembler reg1.
proxy receiver.
proxy integerValueOf: EAX.
asm mov: EAX to: ECX;
mov: 0 to: EAX;
mov: 1 to: EBX;
label: loopStart;
add: EAX with: EBX;
xchg: EAX with: EBX;
"next three could be replaced by loopnz and a dec ECX
before loop, but loopnz isn't there yet"
dec: ECX;
cmp: ECX with: 1;
jg: loopStart.
proxy positive32BitIntegerFor: EBX.
gen epilogue]
SmallInteger >>fib
|tmp res|
tmp := 1.
res := 0.
0 to: self -1 do: [:ix | |oldRes|
oldRes := res.
res := tmp + res.
tmp := oldRes.].
^res
Neither work for negative integers, and nbFib overflows for 48, haven't
added largeInt creation logic :)
[1 to: 100000 do: [:ix | 47 fib]] timeToRun 361
[1 to: 100000 do: [:ix | 47 nbFib]] timeToRun 21
[1 to: 100000 do: [:ix | ]] timeToRun 2
Cheers,
Henry
April 30, 2010
Re: [Pharo-project] ICMP/ping
by Igor Stasenko
On 29 April 2010 21:06, Damien Cassou <damien.cassou(a)gmail.com> wrote:
> Dear list,
>
> is it possible to ping a host from pharo ? It seems that OSProcess
> would do, but it is for a windows machine and I haven't found a
> pre-compiled library.
>
hmm.. i don't sure if squeak VM socket plugin supports raw sockets
which you need for
forming IMCP packets..
> Thank you
>
> --
> Damien Cassou
> http://damiencassou.seasidehosting.st
>
> "Lambdas are relegated to relative obscurity until Java makes them
> popular by not having them." James Iry
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
--
Best regards,
Igor Stasenko AKA sig.
April 30, 2010
Re: [Pharo-project] [Metacello] Problem with ConfigurationOfGofer in Pharo1.0 [WAS] Re: ConfigurationOfGofer class
by Dale Henrichs
Mariano,
Sorry for the delay in getting.....wait, I've already told you:)
You can safely unload and reload a configuration.
Dale
----- "Mariano Martinez Peck" <marianopeck(a)gmail.com> wrote:
| Thanks for the investigation Dale...now...suppose I want to fix it and
| I
| want to force to load gofer again. How can I do that ? because if I
| try to
| install it normally, it won't do it as it is already installed.
|
| Thanks
|
| Mariano
|
| On Tue, Apr 20, 2010 at 6:21 PM, Dale Henrichs
| <dale.henrichs(a)gemstone.com>wrote:
|
| > Mariano,
| >
| > The Pharo-1.0.changes file looks to be corrupted. If you edit the
| the
| > changes file and search for ConfigurationOfGofer here's what you
| see:
| >
| > !ConfigurationOfGofer methodsFor: 'accessing' stamp: 'nk 3/5/2005
| 15:28'!
| > sNil! !
| >
| > !ConfigurationOfGofer methodsFor: 'baselines'!
| > 1 into: [:sum :each | sum * (self foo: each)]! !
| >
| > !ConfigurationOfGofer methodsFor: 'versions'!
| > tring].
| > ^string! !
| >
| > !ConfigurationOfGofer methodsFor: 'versions'!
| > RefactoryTestDataApp methodsFor: 'inline'! !
| >
| > !ConfigurationOfGofer methodsFor: 'versions'!
| > inlineComponent
| > | a |
| > a := 5.
| > ^a class
| > superclass;
| > hasImmediateInstances;
| > yourself! !
| >
| > !ConfigurationOfGofer class methodsFor: 'accessing'!
| > h |
| > each printString.
| > ^anObject]! !
| >
| > !ConfigurationOfGofer class methodsFor: 'loading'!
| > ! !
| >
| > !ConfigurationOfGofer class methodsFor: 'metacello tool support'
| stamp: 'md
| > 3/14/2006 16:47'!
| > malltalk at: #MyTest
| > ifAbsent:
| > [| collection |
| > collection := #().
| > Smalltalk at: #MyTest put: collection]! !
| >
| > !ConfigurationOfGofer class methodsFor: 'metacello tool support'!
| > ng new! !
| >
| > !ConfigurationOfGofer class methodsFor: 'metacello tool support'!
| > or: 'inline'! !
| >
| > !ConfigurationOfGofer class methodsFor: 'private' stamp:
| 'DaleHenrichs
| > 1/25/2010 13:14'!
| > bootstrapPackage: aString from: aPath
| > | reposito
| > ! !
| >
| > !ConfigurationOfGofer class methodsFor: 'private'!
| > 4:51'! !
| >
| > So somehow the source was corrupted ... the compiled methods are
| correct
| > since:
| >
| > ConfigurationOfGofer project versions
| >
| > gives the correct answer. The source following ConfigurationOfGofer
| looks
| > fine so I can't imagine how the source would have been corrupted
| especially
| > since the methods were compiled correctly...
| >
| > Dale
| >
| > ----- "Mariano Martinez Peck" <marianopeck(a)gmail.com> wrote:
| >
| > | wow...you are right....but I have NO idea how that could have
| been
| > | done.
| > |
| > | Adrian: look at the instance methods of the class
| ConfigurationOfGofer
| > | and
| > | you will notice what Erwann says.
| > |
| > | Dale, do you have an idea how this can be done ? As I remember
| > | correctly, I
| > | just evaluated:
| > |
| > |
| > | Gofer new
| > | squeaksource: 'MetacelloRepository';
| > | package: 'ConfigurationOfPharo';
| > | load.
| > |
| > | ((Smalltalk at: #ConfigurationOfPharo) project version:
| '1.0-10517')
| > | perform: #silently: with: true; perform: #load.
| > |
| > |
| > | to generate the Pharo1.0 dev image. This code will bootstrap
| Metacello
| > | and
| > | thus, install Gofer. Do you think there could be a problem there
| ?
| > |
| > | Thanks Erwann for reporting! Open a bug ticket please.
| > |
| > | Cheers
| > |
| > | Mariano
| > |
| > | On Tue, Apr 20, 2010 at 4:52 PM, Adrian Lienhard
| > | <alienhard(a)netstyle.ch>wrote:
| > |
| > | > Hi Erwann
| > | >
| > | > What does scrambled mean?
| > | >
| > | > I cc-ed to Mariano, he may more quickly see whether there is
| > | something
| > | > wrong.
| > | >
| > | > Cheers,
| > | > Adrian
| > | >
| > | > ___________________
| > | > http://www.adrian-lienhard.ch/
| > | >
| > | > On Apr 20, 2010, at 16:34 , Erwann Wernli wrote:
| > | >
| > | > > "ConfigurationOfGofer class" seem scrambled in the download
| of
| > | Pharo 1.0
| > | > form the website -- don't know what happened or if it's only on
| my
| > | image.
| > | > >
| > | > > Erwann
| > | > >
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > | --
| > | Subscription settings:
| > | http://groups.google.com/group/metacello/subscribe?hl=en
| >
April 30, 2010
[Pharo-project] gettext package
by Hilaire Fernandes
I have move in a Gettext package in PharoInbox classes for gettext
support. Do not expect it to work. Some of the classes there, are just
moved from former categories in pharo System-Localization and
Multilingual other are coming from Etoys.
I have not yet test to load it in a fresh image.
Hilaire
April 29, 2010
Re: [Pharo-project] Legitimate syntax for # ... foo
by Eliot Miranda
On Thu, Apr 29, 2010 at 1:25 PM, Nicolas Cellier <
nicolas.cellier.aka.nice(a)gmail.com> wrote:
> 2010/4/29 Eliot Miranda <eliot.miranda(a)gmail.com>:
> >
> >
> > On Thu, Apr 29, 2010 at 12:50 PM, Nicolas Cellier
> > <nicolas.cellier.aka.nice(a)gmail.com> wrote:
> >>
> >> I don't think any other st dialect would accept that syntax but Squeak.
> >
> > VisualWorks accepts it just fine.
> > # "hello" foo => #foo
> > # "hello" (foo # "hello" foo) => #(#foo #foo)
> > I think this is the way the language works. Relax. Celebrate its
> > weirdness. Don't sweat the petty stuff, pet the sweaty stuff:
> >
> http://www.popsci.com/gadgets/article/2010-04/exclusive-making-elements-one…
>
> Maybe I should relax about comment anywhere, but these:
>
> [Compiler evaluate: '#( # 2 # -2 )'] on: Error do: [:exc | exc return:
> nil].
> [Compiler evaluate: '# -2'] on: Error do: [:exc | exc return: nil].
> [Compiler evaluate: '#-2'] on: Error do: [:exc | exc return: nil].
> [Compiler evaluate: '#$a'] on: Error do: [:exc | exc return: nil].
> [Compiler evaluate: '##(1##)1)'] on: Error do: [:exc | exc return: nil].
>
> would all return nil in VW, not so in Squeak.
> Also, I mind the difference of first two in Squeak.
> That's hardly predictable and much too weird to my own taste...
>
That's fair enough, but that's a different issue to there being allowable
whitespace between the literal hash and the literal. In any case, comparing
against VW is probably a sensible thing to do.
best
Eliot
> Nicolas
>
> >>
> >> It's just how the parser/scanner works now, but It wouldn't break much
> >> code IMO if we stop supporting these weirdnesses.
> >>
> >> Nicolas
> >>
> >> 2010/4/29 Lukas Renggli <renggli(a)gmail.com>:
> >> > Actually I didn't have all the latest code loaded in the open image.
> >> > There is more, hold your breath:
> >> >
> >> > testSymbolNumbers
> >> > #(('#1' 1) ('#12' 12) ('#12.3' 12.3) ('# 1' 1) ('##1' 1)
> >> > ('#"bar"1'
> >> > 1)) do: [ :pair |
> >> > tree := RBParser parseExpression: pair first.
> >> > self assert: tree value = pair second.
> >> > self assert: tree start > 1.
> >> > self assert: tree stop = pair first size ]
> >> >
> >> > On 29 April 2010 21:12, Lukas Renggli <renggli(a)gmail.com> wrote:
> >> >>> # "helllooo" foo
> >> >>>
> >> >>> prints
> >> >>> #foo
> >> >>>
> >> >>> is this correct?
> >> >>
> >> >> Probably not, but the standard compiler accepts it. So I had to patch
> >> >> the parser of the refactoring engine to accept a whole series of
> >> >> degraded constructs. Below a small collection of tests documenting
> >> >> some of these strange things:
> >> >>
> >> >> testSymbolLiteral
> >> >> | tree |
> >> >> #(('# foo' #foo) ('#"bar"foo' #foo) ('##foo' #foo) ('###foo'
> >> >> #foo)
> >> >> ('#foo:' #foo:) ('#foo::' #'foo::') ('#foo::bar' #'foo::bar')
> >> >> ('#foo::bar:' #'foo::bar:') ('#foo::bar::' #'foo::bar::')) do: [
> :pair
> >> >> |
> >> >> tree := RBParser parseExpression: pair first.
> >> >> self assert: tree value = pair second.
> >> >> self assert: tree start = 1.
> >> >> self assert: tree stop = pair first size ]
> >> >>
> >> >> testStatements
> >> >> | tree |
> >> >> #(('' 0 0) ('.' 0 1) ('| bar |' 0 0) ('| bar | .' 0 1) ('| bar
> |
> >> >> ..'
> >> >> 0 2) ('foo. bar' 2 1) ('foo. bar.' 2 2) ('foo. bar. .' 2 3) ('. foo.
> >> >> bar' 2 2)) do: [ :each |
> >> >> tree := RBParser parseExpression: each first.
> >> >> self assert: tree statements size = each second.
> >> >> self assert: tree periods size = each last ]
> >> >>
> >> >> testNumberParsing
> >> >> | numbers node |
> >> >> numbers := #(('1' 1) ('-1' -1) ('123' 123) ('123' 123) ('-123'
> >> >> -123)
> >> >> ('1.1' 1.1) ('-1.1' -1.1) ('1.23' 1.23) ('-1.23' -1.23) ('1e3' 1e3)
> >> >> ('1d3' 1d3) ('1q3' 1q3) ('-1e3' -1e3) ('1e-3' 1e-3) ('-1e-3' -1e-3)
> >> >> ('2r1e8' 2r1e8) ('-2r1e8' -2r1e8) ('2r1e-8' 2r1e-8) ('-2r1e-8'
> >> >> -2r1e-8) ('0.50s2' 0.50s2) ('0.500s3' 0.500s3) ('0.050s3' 0.050s3)).
> >> >> numbers do: [ :spec |
> >> >> node := RBParser parseExpression: spec first.
> >> >> self assert: node token source = spec first.
> >> >> self assert: node value = spec second ]
> >> >>
> >> >> Lukas
> >> >>
> >> >> --
> >> >> Lukas Renggli
> >> >> www.lukas-renggli.ch
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Lukas Renggli
> >> > www.lukas-renggli.ch
> >> >
> >> > _______________________________________________
> >> > Pharo-project mailing list
> >> > Pharo-project(a)lists.gforge.inria.fr
> >> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >> >
> >>
> >> _______________________________________________
> >> Pharo-project mailing list
> >> Pharo-project(a)lists.gforge.inria.fr
> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
> >
> > _______________________________________________
> > Pharo-project mailing list
> > Pharo-project(a)lists.gforge.inria.fr
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
April 29, 2010
Re: [Pharo-project] Legitimate syntax for # ... foo
by Stéphane Ducasse
Eliot cleaning some left over or glitches is always good.
I think that this is what nicolas wanted to say.
like ###f -> #f we could use that for another syntactic extension.
#12 -> 12 is not really nice.
or #foo::bar:
Stef
> VisualWorks accepts it just fine.
>
> # "hello" foo => #foo
>
> # "hello" (foo # "hello" foo) => #(#foo #foo)
>
>
> It's just how the parser/scanner works now, but It wouldn't break much
> code IMO if we stop supporting these weirdnesses.
>
> Nicolas
>
> 2010/4/29 Lukas Renggli <renggli(a)gmail.com>:
> > Actually I didn't have all the latest code loaded in the open image.
> > There is more, hold your breath:
> >
> > testSymbolNumbers
> > #(('#1' 1) ('#12' 12) ('#12.3' 12.3) ('# 1' 1) ('##1' 1) ('#"bar"1'
> > 1)) do: [ :pair |
> > tree := RBParser parseExpression: pair first.
> > self assert: tree value = pair second.
> > self assert: tree start > 1.
> > self assert: tree stop = pair first size ]
> >
> > On 29 April 2010 21:12, Lukas Renggli <renggli(a)gmail.com> wrote:
> >>> # "helllooo" foo
> >>>
> >>> prints
> >>> #foo
> >>>
> >>> is this correct?
> >>
> >> Probably not, but the standard compiler accepts it. So I had to patch
> >> the parser of the refactoring engine to accept a whole series of
> >> degraded constructs. Below a small collection of tests documenting
> >> some of these strange things:
> >>
> >> testSymbolLiteral
> >> | tree |
> >> #(('# foo' #foo) ('#"bar"foo' #foo) ('##foo' #foo) ('###foo' #foo)
> >> ('#foo:' #foo:) ('#foo::' #'foo::') ('#foo::bar' #'foo::bar')
> >> ('#foo::bar:' #'foo::bar:') ('#foo::bar::' #'foo::bar::')) do: [ :pair
> >> |
> >> tree := RBParser parseExpression: pair first.
> >> self assert: tree value = pair second.
> >> self assert: tree start = 1.
> >> self assert: tree stop = pair first size ]
> >>
> >> testStatements
> >> | tree |
> >> #(('' 0 0) ('.' 0 1) ('| bar |' 0 0) ('| bar | .' 0 1) ('| bar | ..'
> >> 0 2) ('foo. bar' 2 1) ('foo. bar.' 2 2) ('foo. bar. .' 2 3) ('. foo.
> >> bar' 2 2)) do: [ :each |
> >> tree := RBParser parseExpression: each first.
> >> self assert: tree statements size = each second.
> >> self assert: tree periods size = each last ]
> >>
> >> testNumberParsing
> >> | numbers node |
> >> numbers := #(('1' 1) ('-1' -1) ('123' 123) ('123' 123) ('-123' -123)
> >> ('1.1' 1.1) ('-1.1' -1.1) ('1.23' 1.23) ('-1.23' -1.23) ('1e3' 1e3)
> >> ('1d3' 1d3) ('1q3' 1q3) ('-1e3' -1e3) ('1e-3' 1e-3) ('-1e-3' -1e-3)
> >> ('2r1e8' 2r1e8) ('-2r1e8' -2r1e8) ('2r1e-8' 2r1e-8) ('-2r1e-8'
> >> -2r1e-8) ('0.50s2' 0.50s2) ('0.500s3' 0.500s3) ('0.050s3' 0.050s3)).
> >> numbers do: [ :spec |
> >> node := RBParser parseExpression: spec first.
> >> self assert: node token source = spec first.
> >> self assert: node value = spec second ]
> >>
> >> Lukas
> >>
> >> --
> >> Lukas Renggli
> >> www.lukas-renggli.ch
> >>
> >
> >
> >
> > --
> > Lukas Renggli
> > www.lukas-renggli.ch
> >
> > _______________________________________________
> > Pharo-project mailing list
> > Pharo-project(a)lists.gforge.inria.fr
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
April 29, 2010
Re: [Pharo-project] Legitimate syntax for # ... foo
by Nicolas Cellier
2010/4/29 Eliot Miranda <eliot.miranda(a)gmail.com>:
>
>
> On Thu, Apr 29, 2010 at 12:50 PM, Nicolas Cellier
> <nicolas.cellier.aka.nice(a)gmail.com> wrote:
>>
>> I don't think any other st dialect would accept that syntax but Squeak.
>
> VisualWorks accepts it just fine.
> # "hello" foo => #foo
> # "hello" (foo # "hello" foo) => #(#foo #foo)
> I think this is the way the language works. Â Relax. Â Celebrate its
> weirdness. Â Don't sweat the petty stuff, pet the sweaty stuff:
> http://www.popsci.com/gadgets/article/2010-04/exclusive-making-elements-one…
Maybe I should relax about comment anywhere, but these:
[Compiler evaluate: '#( # 2 # -2 )'] on: Error do: [:exc | exc return: nil].
[Compiler evaluate: '# -2'] on: Error do: [:exc | exc return: nil].
[Compiler evaluate: '#-2'] on: Error do: [:exc | exc return: nil].
[Compiler evaluate: '#$a'] on: Error do: [:exc | exc return: nil].
[Compiler evaluate: '##(1##)1)'] on: Error do: [:exc | exc return: nil].
would all return nil in VW, not so in Squeak.
Also, I mind the difference of first two in Squeak.
That's hardly predictable and much too weird to my own taste...
Nicolas
>>
>> It's just how the parser/scanner works now, but It wouldn't break much
>> code IMO if we stop supporting these weirdnesses.
>>
>> Nicolas
>>
>> 2010/4/29 Lukas Renggli <renggli(a)gmail.com>:
>> > Actually I didn't have all the latest code loaded in the open image.
>> > There is more, hold your breath:
>> >
>> > testSymbolNumbers
>> > Â Â Â Â #(('#1' 1) ('#12' 12) ('#12.3' 12.3) ('# 1' 1) ('##1' 1)
>> > ('#"bar"1'
>> > 1)) do: [ :pair |
>> > Â Â Â Â Â Â Â Â tree := RBParser parseExpression: pair first.
>> > Â Â Â Â Â Â Â Â self assert: tree value = pair second.
>> > Â Â Â Â Â Â Â Â self assert: tree start > 1.
>> > Â Â Â Â Â Â Â Â self assert: tree stop = pair first size ]
>> >
>> > On 29 April 2010 21:12, Lukas Renggli <renggli(a)gmail.com> wrote:
>> >>> # "helllooo" foo
>> >>>
>> >>> prints
>> >>> #foo
>> >>>
>> >>> is this correct?
>> >>
>> >> Probably not, but the standard compiler accepts it. So I had to patch
>> >> the parser of the refactoring engine to accept a whole series of
>> >> degraded constructs. Below a small collection of tests documenting
>> >> some of these strange things:
>> >>
>> >> testSymbolLiteral
>> >> Â Â Â Â | tree |
>> >> Â Â Â Â #(('# foo' #foo) ('#"bar"foo' #foo) ('##foo' #foo) ('###foo'
>> >> #foo)
>> >> ('#foo:' #foo:) ('#foo::' #'foo::') ('#foo::bar' #'foo::bar')
>> >> ('#foo::bar:' #'foo::bar:') ('#foo::bar::' #'foo::bar::')) do: [ :pair
>> >> |
>> >> Â Â Â Â Â Â Â Â tree := RBParser parseExpression: pair first.
>> >> Â Â Â Â Â Â Â Â self assert: tree value = pair second.
>> >> Â Â Â Â Â Â Â Â self assert: tree start = 1.
>> >> Â Â Â Â Â Â Â Â self assert: tree stop = pair first size ]
>> >>
>> >> testStatements
>> >> Â Â Â Â | tree |
>> >> Â Â Â Â #(('' 0 0) ('.' 0 1) ('| bar |' 0 0) ('| bar | .' 0 1) ('| bar |
>> >> ..'
>> >> 0 2) ('foo. bar' 2 1) ('foo. bar.' 2 2) ('foo. bar. .' 2 3) ('. foo.
>> >> bar' 2 2)) do: [ :each |
>> >> Â Â Â Â Â Â Â Â tree := RBParser parseExpression: each first.
>> >> Â Â Â Â Â Â Â Â self assert: tree statements size = each second.
>> >> Â Â Â Â Â Â Â Â self assert: tree periods size = each last ]
>> >>
>> >> testNumberParsing
>> >> Â Â Â Â | numbers node |
>> >> Â Â Â Â numbers := #(('1' 1) ('-1' -1) ('123' 123) ('123' 123) ('-123'
>> >> -123)
>> >> ('1.1' 1.1) ('-1.1' -1.1) ('1.23' 1.23) ('-1.23' -1.23) ('1e3' 1e3)
>> >> ('1d3' 1d3) ('1q3' 1q3) ('-1e3' -1e3) ('1e-3' 1e-3) ('-1e-3' -1e-3)
>> >> ('2r1e8' Â 2r1e8) ('-2r1e8' -2r1e8) ('2r1e-8' 2r1e-8) ('-2r1e-8'
>> >> -2r1e-8) ('0.50s2' 0.50s2) ('0.500s3' 0.500s3) ('0.050s3' 0.050s3)).
>> >> Â Â Â Â numbers do: [ :spec |
>> >> Â Â Â Â Â Â Â Â node := RBParser parseExpression: spec first.
>> >> Â Â Â Â Â Â Â Â self assert: node token source = spec first.
>> >> Â Â Â Â Â Â Â Â self assert: node value = spec second ]
>> >>
>> >> Lukas
>> >>
>> >> --
>> >> Lukas Renggli
>> >> www.lukas-renggli.ch
>> >>
>> >
>> >
>> >
>> > --
>> > Lukas Renggli
>> > www.lukas-renggli.ch
>> >
>> > _______________________________________________
>> > Pharo-project mailing list
>> > Pharo-project(a)lists.gforge.inria.fr
>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>>
>> _______________________________________________
>> Pharo-project mailing list
>> Pharo-project(a)lists.gforge.inria.fr
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
April 29, 2010
Re: [Pharo-project] Legitimate syntax for # ... foo
by Eliot Miranda
On Thu, Apr 29, 2010 at 12:50 PM, Nicolas Cellier <
nicolas.cellier.aka.nice(a)gmail.com> wrote:
> I don't think any other st dialect would accept that syntax but Squeak.
>
VisualWorks accepts it just fine.
# "hello" foo => #foo
# "hello" (foo # "hello" foo) => #(#foo #foo)
I think this is the way the language works. Relax. Celebrate its
weirdness. Don't sweat the petty stuff, pet the sweaty stuff:
http://www.popsci.com/gadgets/article/2010-04/exclusive-making-elements-one…
It's just how the parser/scanner works now, but It wouldn't break much
> code IMO if we stop supporting these weirdnesses.
>
> Nicolas
>
> 2010/4/29 Lukas Renggli <renggli(a)gmail.com>:
> > Actually I didn't have all the latest code loaded in the open image.
> > There is more, hold your breath:
> >
> > testSymbolNumbers
> > #(('#1' 1) ('#12' 12) ('#12.3' 12.3) ('# 1' 1) ('##1' 1)
> ('#"bar"1'
> > 1)) do: [ :pair |
> > tree := RBParser parseExpression: pair first.
> > self assert: tree value = pair second.
> > self assert: tree start > 1.
> > self assert: tree stop = pair first size ]
> >
> > On 29 April 2010 21:12, Lukas Renggli <renggli(a)gmail.com> wrote:
> >>> # "helllooo" foo
> >>>
> >>> prints
> >>> #foo
> >>>
> >>> is this correct?
> >>
> >> Probably not, but the standard compiler accepts it. So I had to patch
> >> the parser of the refactoring engine to accept a whole series of
> >> degraded constructs. Below a small collection of tests documenting
> >> some of these strange things:
> >>
> >> testSymbolLiteral
> >> | tree |
> >> #(('# foo' #foo) ('#"bar"foo' #foo) ('##foo' #foo) ('###foo'
> #foo)
> >> ('#foo:' #foo:) ('#foo::' #'foo::') ('#foo::bar' #'foo::bar')
> >> ('#foo::bar:' #'foo::bar:') ('#foo::bar::' #'foo::bar::')) do: [ :pair
> >> |
> >> tree := RBParser parseExpression: pair first.
> >> self assert: tree value = pair second.
> >> self assert: tree start = 1.
> >> self assert: tree stop = pair first size ]
> >>
> >> testStatements
> >> | tree |
> >> #(('' 0 0) ('.' 0 1) ('| bar |' 0 0) ('| bar | .' 0 1) ('| bar |
> ..'
> >> 0 2) ('foo. bar' 2 1) ('foo. bar.' 2 2) ('foo. bar. .' 2 3) ('. foo.
> >> bar' 2 2)) do: [ :each |
> >> tree := RBParser parseExpression: each first.
> >> self assert: tree statements size = each second.
> >> self assert: tree periods size = each last ]
> >>
> >> testNumberParsing
> >> | numbers node |
> >> numbers := #(('1' 1) ('-1' -1) ('123' 123) ('123' 123) ('-123'
> -123)
> >> ('1.1' 1.1) ('-1.1' -1.1) ('1.23' 1.23) ('-1.23' -1.23) ('1e3' 1e3)
> >> ('1d3' 1d3) ('1q3' 1q3) ('-1e3' -1e3) ('1e-3' 1e-3) ('-1e-3' -1e-3)
> >> ('2r1e8' 2r1e8) ('-2r1e8' -2r1e8) ('2r1e-8' 2r1e-8) ('-2r1e-8'
> >> -2r1e-8) ('0.50s2' 0.50s2) ('0.500s3' 0.500s3) ('0.050s3' 0.050s3)).
> >> numbers do: [ :spec |
> >> node := RBParser parseExpression: spec first.
> >> self assert: node token source = spec first.
> >> self assert: node value = spec second ]
> >>
> >> Lukas
> >>
> >> --
> >> Lukas Renggli
> >> www.lukas-renggli.ch
> >>
> >
> >
> >
> > --
> > Lukas Renggli
> > www.lukas-renggli.ch
> >
> > _______________________________________________
> > Pharo-project mailing list
> > Pharo-project(a)lists.gforge.inria.fr
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
>
> _______________________________________________
> Pharo-project mailing list
> Pharo-project(a)lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
April 29, 2010