Re: Re: BeanShell Dialects: proposal for future syntax extension mechanism... (Patrick Niemeyer)
Patrick Niemeyer <[email protected]> Wed, 2 Feb 2005 14:09:24 -0600
| Newsgroups | gmane.comp.java.beanshell.devel |
|---|---|
| Message-ID | <[email protected]> |
On Feb 2, 2005, at 10:59 AM, Victor Volle wrote:
> The syntactic sugar "{" and "|" is not important, but being able to
> implement functions that are not top level functions but methods of an
> object?
>
I think in general we need a way for scripts to attach new scripted
methods to Java objects and interfaces as well as scripted objects. I
think that capability could work with the other proposal.
It would not be hard to add a mechanism that allows you, for example,
to add methods to the String class... at least as far as the scripted
code goes. I'm not sure if it would require any new syntax or it it
would just be a registry/interceptor sort of thing. We might look at
some of the AOP syntax for ideas.
Pat
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl