RE: language extensions? future direction?
"Yemi D. Bedu" <yemi-DnQzskBZRmpWk0Htik3J/[email protected]> Mon, 29 Nov 2004 19:19:58 -0500
| Newsgroups | gmane.comp.java.beanshell.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello, I was wondering in such a case as the "macros" would that allow for memory of how an operator worked in parent or peer code. Something like if to classes are instanced, would they have there own version of the syntax tree and know the "for" or "while" loop will actually work as expected. That would seem to heavily bloat memory use for many small scripts running and even possibly slow its performance a tad on loading and changing execution against a syntax tree. -----Original Message----- From: beanshell-developers-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:beanshell-developers-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Patrick Niemeyer Sent: Friday, November 26, 2004 8:24 PM To: Victor Volle Cc: beanshell-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Subject: Re: [Beanshell-dev] language extensions? future direction? 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/ _______________________________________________ Beanshell-developers mailing list Beanshell-developers-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/beanshell-developers ------------------------------------------------------- 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/