I haven't really tried Coral yet, so please forgive my ignorance, but have
you thought of using a modified block syntax to define methods?
I'm thinking of something like this:

[factorial |
"Answer the factorial of the receiver."

self = 0 ifTrue: [^ 1].
 self > 0 ifTrue: [^ self * (self - 1) factorial].
self error: 'Not valid for negative integers'
]

[min: aMin max: aMax |

^ (self min: aMin) max: aMax
]

[+ aNumber |

"Refer to the comment in Number + "
aNumber isInteger ifTrue:
 [self negative == aNumber negative
ifTrue: [^ (self digitAdd: aNumber) normalize]
 ifFalse: [^ self digitSubtract: aNumber]].
^ aNumber adaptToInteger: self andSend: #+
]


Evaluating one of these expressions could return a compiled method without a
class. And since we use the ">>" to retrieve a method, we could use the "<<"
operator to add it to a class's method dict.

I think it would make a very simple and consistent syntax. And maybe we
could even modify the entire system to support it. I wouldn't mind seeing a
couple of extra brackets and a vertical bar in the browser if the method's
syntax is made more consistent.

Anyway, it's just an idea...

Best regards,
Richo

On Sat, Mar 5, 2011 at 3:58 PM, Stéphane Ducasse
<stephane.duca...@inria.fr>wrote:

>
> > What is coral all about? There seems to be no documentation except a
> little tutorial. But the tutorial does not make much sense to me. It
> explains the installation of coral and the result is that you can run a
> script from the commandline. Well, that is possible anyway. So where is
> coral located. Between positioning it as a shell replacement in the mailing
> list and the "just runs a shell script" is a huge space where it could be
> actually located. Any hints are appreciated.
>
> We want a scripting syntax to be able to builds script with pharo so we
> have coral.
> In coral you write
>
> Point >> mydistance
>        [
>        ^ x * x
>        ]
>
> Point class>>myNewPointWithx: anInt withY: another
>        [
>
>        ]
>
> With OSProcess we access os behavior and yes I should fix the
> configurationOf...
>
> We have a more compact class creation syntax
>
> [
> Object <| MyPoint
>        iv: 'myx'
> "not sure that this is like that I'm watching a movie so not pharo "
> ]
>
> Stef
>
>
> >
> > Norbert
> >
> >
> > On 05.03.2011, at 08:58, Stéphane Ducasse wrote:
> >
> >>
> >> On Mar 4, 2011, at 2:17 PM, Alexandre Bergel wrote:
> >>
> >>> Hi!
> >>>
> >>> After I've tried Hazel, I was wondering what is the status of Coral. I
> would love to move away from Bash.
> >>
> >> me tooo.
> >>
> >>> I am just wondering.
> >>
> >> Use coral it is working.
> >> We should get more and more user.
> >> I'm waiting for after next week to introduce a better way to handle
> file.st,  file.cor.....
> >> When hazel will be working we will use it but this is orhtogonal to
> Coral.
> >>
> >> We have documenting FS and we should improve it too.
> >>
> >> Luc told me that he remove the icon to get the start up faster
> >> Stef
> >>
> >>>
> >>> Cheers,
> >>> Alexandre
> >>> --
> >>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> >>> Alexandre Bergel  http://www.bergel.eu
> >>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
>
>
>

Reply via email to