Danno Ferrin | 1 May 2004 10:27
Picon
Favicon

Enhanced GroovyConsole

I thought that the GroovyConsole was... lacking.  But considering that 
there is a lot of fun stuff going on with stack height bugs and 
auto-bytecode-generated-closures and optional parentheses it's easy to 
see how optional GUI stuff could get overlooked.  So I did some tweaking 
to it myself.  (attached as full file, The diff is actually longer than 
the whole file).

  * New, Open, Save implemented.
    * New opens an entirely new blank console
    * Once opened or saved the filename is preserved and
       contents not cleared from the editing area
    * save prompts for a filename if absent
    * and save on close for "oops, that's not maximize!"
  * Added mnemonics
    * Is there an easy way to get Ints from a char or
      a string?  Using hex codes seemed easier
  * Added some more keyboard shortcuts
  * split bar is in the middelish now

Prettier, and a bit more usable.  And I'll grant whatever copyright blah 
blah blah may be needed to donate my changes to Groovy.

--Danno
(I should have gone to bed three hours ago)
package groovy.ui

import groovy.swing.SwingBuilder

(Continue reading)

Jamie McCrindle | 1 May 2004 15:11
Picon

groups, regex's and switches

hi all,

is there any way to get a group out of a regex in a case statement: e.g:

switch(line) {
  case ~"ignore(.*)": ...
}

cheers,
jamie.

________________________________________________________________________

This e-mail message (including any attachment) is intended only for the personal 
use of the recipient(s) named above. This message is confidential and may be 
legally privileged.  If you are not an intended recipient, you may not review, copy or 
distribute this message. If you have received this communication in error, please notify 
us immediately by e-mail and delete the original message.

Any views or opinions expressed in this message are those of the author only. 
Furthermore, this message (including any attachment) does not create any legally 
binding rights or obligations whatsoever, which may only be created by the exchange 
of hard copy documents signed by a duly authorised representative of Hutchison 
3G UK Limited.
________________________________________________________________________
Jon Tirsen | 2 May 2004 12:19

Re: groups, regex's and switches

$1, $2, $3, $4... anyone?

Jamie McCrindle wrote:

>hi all,
>
>is there any way to get a group out of a regex in a case statement: e.g:
>
>switch(line) {
>  case ~"ignore(.*)": ...
>}
>
>cheers,
>jamie.
>
>
>________________________________________________________________________
>
>This e-mail message (including any attachment) is intended only for the personal 
>use of the recipient(s) named above. This message is confidential and may be 
>legally privileged.  If you are not an intended recipient, you may not review, copy or 
>distribute this message. If you have received this communication in error, please notify 
>us immediately by e-mail and delete the original message.
>
>Any views or opinions expressed in this message are those of the author only. 
>Furthermore, this message (including any attachment) does not create any legally 
>binding rights or obligations whatsoever, which may only be created by the exchange 
>of hard copy documents signed by a duly authorised representative of Hutchison 
>3G UK Limited.
>________________________________________________________________________
(Continue reading)

Matt Quail | 3 May 2004 09:15

emacs mode for Groovy

Anyone have an emacs mode for Groovy? I really don't want to have to 
dust off my elisp hat :(

Desperately wanted:
- indenting (the python emacs mode groks line continuations well)
- support for "here" documents
- syn-highlighting support for embeded ${expressions} in strings

=Matt
--

-- 
"good, fast, cheap: pick two"
Ivan Z. Ganza | 3 May 2004 17:26
Picon
Favicon

Re: emacs mode for Groovy

I don't think there is an offical mode yet.  In the interm it seems
that jde-mode works pretty well, of course, it doesn't know about
groovy specific stuff....

-Ivan/

On Mon, May 03, 2004 at 05:15:32PM +1000, Matt Quail wrote:
> Anyone have an emacs mode for Groovy? I really don't want to have to 
> dust off my elisp hat :(
> 
> Desperately wanted:
> - indenting (the python emacs mode groks line continuations well)
> - support for "here" documents
> - syn-highlighting support for embeded ${expressions} in strings
> 
> =Matt
> -- 
> "good, fast, cheap: pick two"
> _______________________________________________
> groovy-user mailing list
> groovy-user@...
> http://lists.codehaus.org/mailman/listinfo/groovy-user
Paul Mitchell-Gears | 4 May 2004 15:00

doing Tree Based Syntax transforms

>
>
>Hi Paul!
>
>the reason you are getting the error is that you panel takes two 
>parameters and you are passing it no parameters.
>
>
>
>John Wilson
>The Wilson Partnership
>http://www.wilson.co.uk
>

hi

yes, you are right.

but when i change my class so that each method takes the right number of 
arguments, it's still not right. Eg:

class MyBuilder {
        out = new MarkupBuilder()

        public void frame(args, children) {
                out.frame2(args, {})
                children.setDelegate(this)
                children()
        }
        public void panel(children) {
(Continue reading)

John Wilson | 4 May 2004 17:26
Picon

Re: doing Tree Based Syntax transforms


On 4 May 2004, at 14:00, Paul Mitchell-Gears wrote:

>> [snip]

> How can i pass the closure into out.panel2() such that it gets called 
> inside (to give the nesting), but making sure that its delegate is 
> kept as MyBuilder, not set to itself?
>
> Am I trying to force a square peg into a round hole?
>

I think you may be....

My inclination would be to subclass MarkupBuilder and override 
invokeMethod.

Or to subclass StreamingMarkupBuilder and supply a custom tagClosure.

John Wilson
The Wilson Partnership
http://www.wilson.co.uk
Roger Pomeroy | 5 May 2004 08:03
Picon

Re: Parens and Parameters

I have been just sorta listening in on this for some time now.  It seems I may be in the minority, but PLEASE dont
make parens mandatory!

In my case, I actually want to imbed Groovy as a scripting language for a tool that non-programmers will be
using.  None of my users are java programmers; maybe 1 or 2 have seen python; most have not even seen an object
oriented language at all.  What they have seen is 20+ years of an "ad hoc" sort of scripting language that
uses spaces as separators.  When I suggest they may want to work in a more object oriented world, they nearly
had a heart attack.  On the other hand, with Groovy having optional parens, I can actually make most of what
they typical users want to do to look similiar enough to their previous language that I just might get away
with this.  If I start having to make it look more and more java like, I think it won't fly -- and then I'm stuck
having to write my own parser/language/interface, etc. etc. yukkkk....

Aside from my desire to avoid extra work, I also think that one of the arguments for Groovy is that it is
different enough from java to attract people who might not otherwise use java.  I think that is reason
enough to keep the existing optional parenthesis...

Ok, I'll go back to quietly watching and get off my soapbox now...

Roger

--

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm
Kevin Jones | 5 May 2004 16:00

Web site error

Not sure if this has been reported previously but if I browse to 

http://cvs.groovy.codehaus.org/viewcvs.cgi/groovy/groovy-core/src/test/groov
y/script/

I get 

viewcvs.cgi/groovy/groovy-core/src/test/groovy/script: unknown location

HTTP Response Status

404 Not Found

plus a Python trackback

Kevin Jones
http://kevinj.develop.com 
Kevin Jones | 5 May 2004 16:09

args.length

If I have this

public static main(args){  

  if (args.length != 3)
    println "In here"
  else 
    println args.length

If I call this I always see 

[org.codehaus.groovy.runtime.MethodClosure@...,
org.codehaus.groovy.runtime.MethodClosure@..., org.codehaus.groov
y.runtime.MethodClosure@...]

So, args.length is a closure. 

How do I get the number of arguments (I was looking for examples on the site
but can't get to anything because of site problems so sorry if this is a
FAQ),

Kevin Jones
http://kevinj.develop.com 

Gmane