Scripting syntax: all expressions or declarations?

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

Re: Scripting syntax: all expressions or declarations?

Zulq Alam-2
Hi Damien,

 > Put another way, do we want the script syntax to be a format, i.e. a
 > serialized form of a program, similar to what is in a browser, or do
 > we want it to be a program (thus user-extensible).

Both... For example, what about passing the method declarations as a
string in the same way we pass instance variable declarations as a
string. For example, perhaps something like the following.

Object
   subclass: #Subclass
   instanceVariableNames: 'varA'
   classVariableNames: 'classVarA'
   instanceMethods: '
     "2 new lines ends a method"

     methodA
       ^'this quote shouldn't be a problem as it '

     methodB: anObject
       ^anObject x: varA

     methodC: anObject with: anotherObject
       anObject x: anotherObject
       anotherObject y: self.

' classMethods: '
     methodA
     ^classVarA

     methodB

'.

This is both executable and declarative and to me, it is also closest to
what we already have and I think quick to implement though it may take
some work to deal with possible parsing issues(?).

- Zulq


12