Re: language extensions? future direction?

Patrick Niemeyer <[email protected]> Fri, 26 Nov 2004 19:23:43 -0600
Newsgroups gmane.comp.java.beanshell.devel
Message-ID <[email protected]>
On Nov 26, 2004, at 5:37 AM, Victor Volle wrote:

>  1. "blocks" like in Ruby or Smalltalk: A code block that is used as
>     a parameter of a function, which the function then might call.
>     Ruby'ish example:

Hi, we have discussed adding blocks in some way to the language and 
I've posted some speculative emails about syntax to the list...  Blocks 
in some form would be useful and I'm sure we'll add them after the 
current version is stable... whenever that is ;)

>  2. "mixins" Yes, multiple inheritance is dangerous, and mixins
>     introduce a kind of multiple inheritance, but they come in handy
>     when needed. Imagine that you have multiple classes, that must
>     implement an Observer interface, but you can not use a common

I'm not sure if it's sufficient, but in 2.x we've added a mixing 
capability called importObject() that parallels the Java 1.5 static 
import functionality but for instance methods and vars... I think this 
is what you want.

>  4. "macros" à la Lisp. I never really liked Lisp, but one feature
>     was really great: The macro mechanism as part of the language.
>     (In Smalltalk you could do similiar stuff, when I remember

I'm not sure in it's current incarnation BeanShell's grammar parsing is 
sufficient to allow such things...  There is currently all kinds of 
opportunity though to add hooks to the built in language features... 
I'm thinking of things like a hook to execute arbitrary code in place 
of the current ASTs (syntax elements) or to trigger things on variables 
changing, etc...  more procedural stuff related to the current 
language.  To really make the grammar dynamic is an interesting topic 
and something I've looked at a lot in the past... but probably not a 
good addition to BeanShell any time soon...  might be another project.  
But I'm open to hearing ideas.

Again, the people on the list would get very upset at the idea of 
adding much new stuff before getting the current version solid and bug 
free ;)


Pat


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/