On Sat, Jun 6, 2015 at 5:47 PM, Francisco Garau <francisco.garau@gmail.com> wrote:
I am playing with the Coral image downloaded from the CI site.
ok now again pay attention. The syntax is not important and stable. What is more important is
I understand what you are saying and it's not my intention to push the syntax experiments into Coral. I am just using the existing infrastructure to play a bit with the latest Pharo and see if the ideas I've got could work in practice. As Ben says, it's a itch I need to scratch.
Coral should let - us interactively access and define environment varibales - write and ***debug*** OS scripts - publish these scripts
Here is typical session I want.
you have a coral scripts - no method - just a bunch of expression - you get a bug - you relaunch the script -db - and you get debugger you fix the script - then your script is regenerate
Thanks for the explanation. It'd be nice to add this into the Coral website.
Now if you need to define a method then you define a class ie PillarInstructor and a couple of method but they should be ***normal*** method and normal class (just with a better syntax that the ugly code chunk delimiter) and this is why I proposed
PillarInstructor>>compileAllFileIn: aFS [ gkjgkjgkjg kjgkjgkgkgj ]
The syntax changes I am thinking about would bring together block and method definitions. I would have thought it is important for your modularity efforts to have a full syntax. Otherwise, how would you be compiling code into a minimal image that hasn't got any UI module?
Your ideas below regarding method definition is interesting, but this class definition seems problematic.
[Point: Object | | x y |
I don't know your Smalltalk background since you are new to the list, so I hope I'm not telling you how to suck eggs, but just checking you know that the class definition is not compiler syntax but a plain message send. Try where you normally define a class to select the definition and "debug it". Also using the normal class definition message-send means you don't have to come up with special compiler syntax for using class variables, slots, traits, etc.
[sign | ^ (x sign @ y sign)].
[dotProduct: aPoint | ^ (x * aPoint x) + (y * aPoint y)]. ]
I can see how that might work technically with the compiler able to recognise the lack of preceding colon to distinguish a method name, but I am thinking: * its a very fine distinction for humans reading code * dropping a colon is very easy * it may lead to ambiguous fail-late errors (better to fail-early) Also *needing* to nest method definitions within the class definition seems constraining. It would be nice for methods to be able to be defined in any order. Consider a common use case where several script files are joined together which each define extensions to the same class. The above points are dealt with by the Class>>method" syntax Stef describes. A really important aspect of this is that its already a widely used convention in documentation. Now pushing that inside the block may be interesting. [ Point>>sign | ^(x sign @ y sign) ]. [ Point>>dotProduct :aPoint | ^ (x * aPoint x) + (y * aPoint y). ] [ Point>>min: aMin max: aMax | ^ (self min: aMin) max: aMax ] However a block that is not assigned to a variable is just thrown away, so possibly a hypothetical message like #define might need to be sent to the block. [ Point>>sign | ^(x sign @ y sign) ] define. cheers -ben