Alan Thompson | 1 Jul 01:59 2008
Picon

[groovy-user] Article comparing Java vs other languages (including Groovy)

Hi,

Here is an interesting article I ran across that discusses Java compared
to other major languages (C/C++/C#) and dynamic languages
(Perl/Ruby/Python/PHP/Groovy) as well some others. I thought some of you
may be interested in reading it.  Thoughts?

	http://littletutorials.com/2008/05/28/13-reasons-java-die-old-age/

Alan

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Jason Blumenkrantz | 1 Jul 03:35 2008

[groovy-user] XmlSlurper and DOM

Hi all,
I've got an org.w3c.dom.Document that I'd like to run through XmlSlurper 
for convenient querying. I'd rather not use XPath, as I have existing 
downstream code that depends on handling a GPathResult and I'd like to 
keep things consistent. What's the best/Groovy way to accomplish this 
short of serializing the DOM to a string only to parse it back again? 
Can I easily convert from a DOM node to a Groovy Node? Can I somehow 
generate SAX events off of the DOM directly? Any suggestions would be 
much appreciated.
Thanks,
Jason Blumenkrantz

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Ray Tayek | 1 Jul 04:12 2008
Picon

[groovy-user] Beginning Groovy and Grails: From Novice to Professional

just got my new book, nice!

does anyone have links for the source code ot the errata?

thanks

---
vice-chair http://ocjug.org/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Robert O'Connor | 1 Jul 04:15 2008

Re: [groovy-user] Beginning Groovy and Grails: From Novice to Professional

Check http://www.apress.com

cheers
--rob
Ray Tayek wrote:
> just got my new book, nice!
>
> does anyone have links for the source code ot the errata?
>
> thanks
>
> ---
> vice-chair http://ocjug.org/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

(Continue reading)

Ray Tayek | 1 Jul 06:28 2008
Picon

Re: [groovy-user] Beginning Groovy and Grails: From Novice to Professional

At 07:15 PM 6/30/2008, you wrote:
>Check http://www.apress.com

i did. could not seem to find anything there.

thanks

>Ray Tayek wrote:
> > just got my new book, nice!
> >
> > does anyone have links for the source code ot the errata? ...

---
vice-chair http://ocjug.org/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Randall R Schulz | 1 Jul 07:05 2008
Picon

Re: [groovy-user] Beginning Groovy and Grails: From Novice to Professional

On Monday 30 June 2008 21:28, Ray Tayek wrote:
> At 07:15 PM 6/30/2008, you wrote:
> >Check http://www.apress.com
>
> i did. could not seem to find anything there.

Presumably you found <http://www.apress.com/book/view/9781430210450>. 
There is a place to submit new errata, though apparently none so far 
(it is newly published, after all), so you _could_ be the first one to 
do so...

> thanks

Randall Schulz

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Ray Tayek | 1 Jul 07:13 2008
Picon

Re: [groovy-user] Beginning Groovy and Grails: From Novice to Professional

At 10:05 PM 6/30/2008, you wrote:
>On Monday 30 June 2008 21:28, Ray Tayek wrote:
> > At 07:15 PM 6/30/2008, you wrote:
> > >Check http://www.apress.com
> >
> > i did. could not seem to find anything there.
>
>Presumably you found <http://www.apress.com/book/view/9781430210450>.
>There is a place to submit new errata, though apparently none so far  .

yes, i did find that.

thanks

---
vice-chair http://ocjug.org/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Francesco Pasqualini | 1 Jul 12:41 2008
Picon

Re: [groovy-user] cast

Hi Guillaume,
 you say:
 
<< groovy is able to "coerce" types to boolean values as needed (for instance where conditional expressions are required like in if or while constructs) >>
 
I think this is a great feature.
 
But - exuse me if I insist - why groovy is not able to convert string to number (for example in math expresion like 4/'2' and numeric context    ) ?
 
I hope you agree that this could be a smart feature.
 
thanks
Jochen Theodorou | 1 Jul 13:15 2008
Picon

Re: [groovy-user] Bug in Joint Compiler?

David Clark schrieb:
> On Monday 30 June 2008, Jochen Theodorou wrote:
>> what does the GroovyCastException say? "tries to cast it to Base" is
>> usually not the full story... there should be two types mentioned
> 
> Exception in thread "main" 
> org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast 
> object 'SUCCESSFULLY ASSIGNED VAR' with class 'java.lang.String' to 
> class 'Base'
> 
> Base is the name of the base class.

So a String is used where Base should be used.

I reduced the trace to this:

> at 
> org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation.castToType(DefaultTypeTransformation.java:340)
>         at 
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.castToType(ScriptBytecodeAdapter.java:635)
>         at Derived$_task_closure1.doCall(Derived.groovy)
>         at groovy.lang.Closure.call(Closure.java:292)
>         at 
> org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:1079)
>         at Derived.task(Derived.groovy:4)
>         at Derived.main(Derived.groovy:10)

that means the cast happens inside the compiler generated doCall 
method... most likely before the real doCall method would be called... 
so it should be the line:

["SUCCESSFULLY ASSIGNED VAR"].each { var = it; };

The only reason I can imagine that this happens is because there is 
somewhere a side effect which changes the type "it"... or "var"... If it 
is "var", then we should take a look at why the line numer does not show 
up... well, might be related to the problem. Anyway "var"is of type 
String and it somehow gets changed to Base... hmm... Frankly, I have no 
idea why this happens. Clear is, it should not... no... it must not.... 
can you please fill a bug report for this... I will try to adress this 
problem soon.

bye blackdrag

--

-- 
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/
http://www.g2one.com/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Jochen Theodorou | 1 Jul 13:30 2008
Picon

Re: [groovy-user] cast

Francesco Pasqualini schrieb:
> Hi Guillaume,
>  you say*:*
>  
> << groovy is able to "coerce" types to boolean values as needed (for 
> instance where conditional expressions are required like in if or while 
> constructs) >>
>  
> I think this is a great feature.
>  
> But - exuse me if I insist - why groovy is not able to convert string to 
> number (for example in math expresion like 4/'2' and numeric context    ) ?
>  
> I hope you agree that this could be a smart feature.

in a if and while the context is quite clear. you have a syntactic hint 
that a boolean will be used here. in an expression x/y you don't have a 
hint as of what types will be used for x and y.

I am very much against uncontrolled type changes, especially in 
combination with operators. I really don't want let Groovy go the C++ 
road to operation overloading hell.  We already have one case that 
changes it type in a not so good controlable way.. and that is when a 
GString is converted into a String... But I think we can life with that, 
if it is the only exception, and it is only there because GString can 
not be a sub class of String.

So if the String does get promoted to an int, then there would be still 
the way of providing additional div methods. But think about it... what 
sense does String#div(int) have? Or Integer#div(String)? I don't see a 
reason the justifies adding them, by only looking at the method 
signature... They don't make much sense.

If you still want ot have that, then you have two ways: change the 
MetaClass of String and Integer to add these methods or add them using a 
category. In any way you get what you wanted to have.

I only have problems adding this to the main language

bye blackdrag

--

-- 
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/
http://www.g2one.com/

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Gmane