Re: parser problem?

2020-05-16 Thread OCsite
Daniel, just for the record, the problem occurs with “1>2?[3] as Set:null” and similar expressions. It is not caused, far as I understand, solely by “as”, but rather by a combination with the “safe” (non-NPE) indexing syntax, as Paul mentioned before. > On 16 May 2020, at 2:51, Daniel.Sun

Re: More Groovy 3 woes

2020-05-16 Thread OCsite
Daniel, > On 16 May 2020, at 10:58, Daniel.Sun wrote: > The joint compilation issue should be fixed in Groovy 3.0.4, which will be > released in a couple of days. > > If you want to try in a hurry, here is link to SNAPSHOT: > https://github.com/apache/groovy/actions/runs/106435124 great,

Re: More Groovy 3 woes

2020-05-16 Thread OCsite
Daniel, > On 16 May 2020, at 2:42, Daniel.Sun wrote: >> having enclosed all the “foo as bar”'s in ternary operators in parentheses > We have fixed some issues related to ternary operator since Groovy 3 was > released. Please provide a code snippet to show the ternary operator issue > you

Re: parser problem?

2020-05-18 Thread OCsite
Hi there, > On 16 May 2020, at 2:41, Paul King wrote: > I'd suggest creating an issue for this. We might be able to improve Groovy or > if not we should assess whether the current doco around safe indexing > explains possible interactions well enough. GROOVY-9561

How to test and deploy without groovy-all? (was: More Groovy 3 woes)

2020-05-18 Thread OCsite
Hi there, > On 16 May 2020, at 14:17, OCsite wrote: > First, can you (or anyone) please suggest what to do with my classpath now > when groovy-all's gone? I still can't see a reasonable solution for that :( All the documentation I've found so far is > http://groovy-lang.org/

Re: How to test and deploy without groovy-all?

2020-05-18 Thread OCsite
Thanks again, but... > On 18 May 2020, at 17:07, Mauro Molinari wrote: > > Il 18/05/20 16:29, OCsite ha scritto: >> Or am I wrong and there is some magic which would prevent this scenario? > Your application will fail at compilation time if some JAR is missing. > ... I am

Re: How to test and deploy without groovy-all?

2020-05-18 Thread OCsite
t, > not some "common build too"), and not "just JAR"s? > > My 5 cents, > T > > On Mon, May 18, 2020 at 6:47 PM OCsite mailto:o...@ocs.cz>> > wrote: > >> On 18 May 2020, at 18:12, Mauro Molinari > <mailto:mauro...@tiscali.it>

Re: How to test and deploy without groovy-all?

2020-05-18 Thread OCsite
> On 18 May 2020, at 18:12, Mauro Molinari wrote: > > Il 18/05/20 17:48, OCsite ha scritto: >> (Actually I can't imagine the Maven/Gradle workflow to be considerably >> different: the principle of creating the application package and installing >> it plus all th

Re: How to test and deploy without groovy-all? (was: More Groovy 3 woes)

2020-05-18 Thread OCsite
ng from groovy/lib on the classpath. > > I hope that gives you some ideas. > - Keith > > 1. https://github.com/gradle/gradle-groovy-all > <https://github.com/gradle/gradle-groovy-all> > >> On May 18, 2020, at 8:43 AM, OCsite mailto:o...@ocs.cz>> wrote: >> >

Re: How to test and deploy without groovy-all? (was: More Groovy 3 woes)

2020-05-18 Thread OCsite
groovy > groovy-all > 2.5.9 > provided > pom > > > Now, while I do admit I have not tried a build yet with Groovy 3, the Maven > dependency for groovy-all does exist… > > > > > From: OCsite mailto:o...@ocs.cz>> &g

ASTT to correctly work with pre-processed sources?

2020-05-18 Thread OCsite
There's another thing I'd like to ask for a help with. Some of my groovy sources are actually pre-processed (in a way remotely similar to the well-known CPP, i.e., before groovyc is called, a temporary groovy source is generated from one or more original sources; it's the generated temp file

Re: How to test and deploy without groovy-all?

2020-05-18 Thread OCsite
on a build server. > > Andy > > [1] https://imperceptiblethoughts.com/shadow/ > <https://imperceptiblethoughts.com/shadow/> > [2] https://github.com/andyjduncan/serverless-dyndns > <https://github.com/andyjduncan/serverless-dyndns> > On Mon, May 18, 2020 at

Re: How to test and deploy without groovy-all?

2020-05-19 Thread OCsite
ess. Is there really any danger that such a JAR would get amongst the other modules unintentionally and unwanted?!? Again, I do apologise for my massive ignorance, but I really can't see how :-O Thanks, OC > From: OCsite mailto:o...@ocs.cz>> > Reply-To: "users@groovy.apache.org &l

Re: How to test and deploy without groovy-all?

2020-05-19 Thread OCsite
, there'll be 5 or 6 out :) > On 19 May 2020, at 7:15, Jochen Theodorou wrote: > On 19.05.20 03:53, OCsite wrote: >> Well, thanks, I'll check the thing, though at the first look it rather >> seems to be a tool for a Gradle project owner who wants to move his >> projects into

Re: How to test and deploy without groovy-all?

2020-05-19 Thread OCsite
r as I know that is, is impossible with JARs, for there's no information of the inter-version compatibility at all, so the point is moot. > On 19 May 2020, at 13:32, Paul King wrote: > > > On Tue, May 19, 2020 at 8:32 PM OCsite mailto:o...@ocs.cz>> > wrote: > Paul, >

Re: ASTT to correctly work with pre-processed sources?

2020-05-19 Thread OCsite
that, returned to the external fixes, leaving the preprocessed-file name and linenumbers in generated .classes. Thanks and all the best, OC > On Tue, May 19, 2020 at 12:19 PM OCsite mailto:o...@ocs.cz>> > wrote: > There's another thing I'd like to ask for a help with. > &

Re: Loading groovy files from a remote repository

2020-05-24 Thread OCsite
Hi there, far as I know, you have to build your own index which would contain the classname:pathname pairs for all classes — I am afraid there's no standard tool which would do that for you automatically. Alas, it is essentially impossible to obtain the class information directly from a

Re: problem during calling method from closure

2020-10-14 Thread OCsite
Anton, > ...You cannot refer to the method of an object that has not yet been > constructed. As a matter of fact, you can. This darned Java “method-calling” lingo is terribly misleading; we definitely should have sticked with Alan Kay's “message-sending”, and there would be much less

ASTT to convert positional to named?

2020-05-31 Thread OCsite
Hi there, for both convenience and considerably improved source readability and robustness, I am considering an ASTT which would convert positional arguments to named ones, i.e., something like @Named foo(bar,int bax=666,List baz) { ... whatever ... } turned to something like foo(Map

Re: Omitting parentheses on .size() ?

2020-08-01 Thread OCsite
MG, > On 1 Aug 2020, at 14:59, MG wrote: > What was the reason again Groovy does not add getSize() here... ?-) Consistency I guess. Having a List.size would lead to a request to add Map.size, which alas would clash with Map['size']. All the best, OC > On 01/08/2020 04:06, Paul King wrote: >>

Re: Omitting parentheses on .size() ?

2020-08-04 Thread OCsite
Guys, > On 4 Aug 2020, at 16:13, MG wrote: > On 04/08/2020 15:16, Basurita wrote: >> On 8/1/20 14:41, MG wrote: >>> Hmmm, I am for consistency, but at least I use very few maps as compared to >>> lists, and rarely ever output the size of a map, but constantly for >>> lists, so having getSize()

Re: What projects use Groovy as its main development language ?

2020-06-27 Thread OCsite
Mg, my main client here in Czech Republic allowed me to turn all our WebObjects projects from Java to Groovy years ago (and still there are non-trivial parts of the legacy codebase in the original Java :)) Those project include a couple of web applications like e.g., an auctioning system or a

how to determine whether a method was compiled or runtime-added?

2020-06-05 Thread OCsite
The reason I am playing now with metaclass is that I would need to check for a given method whether it exists (that's easy), and if it does, whether it's an originally compiled one or one added dynamically at runtime. What's the best (most robust and reliable) way to do that? So far I haven't

Re: do I miss something here, or is this a Groovy bug?

2020-06-05 Thread OCsite
And another thing which I don't understand and seems highly suspicious — do I just miss something of importance, or is it a bug? === 127 ocs /tmp> /usr/local/groovy-3.0.4/bin/groovy q Caught: java.lang.VerifyError: Bad type on operand stack Exception Details: Location:

Re: do I miss something here, or is this a Groovy bug?

2020-06-05 Thread OCsite
t! OC [1] Agreed, using this might lead someone who is used to an object-oriented language like Ruby or Smalltalk to believe that it would work properly when inherited, but it would not, for Java's at best half-OO, half-C++-like-crap. But that's beside the point here :) > > Cheers, Paul.

Re: Calling original method from extension class

2020-07-17 Thread OCsite
Alberto, far as I understand properly, at the very least you should be able to do that programmatically, like this (do not forget ExpandoMetaClass.enableGlobally()): def original=UnicastRemoteObject.metaClass.getMetaMethod("toString", new Class[])

build/runtime versions

2020-12-22 Thread OCsite
Hi there, I have just found one of my clients might be using at his deployment site a different Groovy version than the one used to build the application — probably the worst case was a pretty old runtime version 2.3.8 for an app built with 2.4.17 (seems it runs OK, strangely enough). (i) are

Geb Safari automation

2021-06-13 Thread OCsite
Hi there, I'd like to use Geb for a Safari (not FF/Chrome) automation; can anyone help? I've tried steps from this article: https://blog.codecentric.de/en/2013/02/browser-automation-and-acceptance-testing-with-geb/ just updated for Safari instead of Firefox and using current versions of the

parsing multipart/related soaps?

2021-02-16 Thread OCsite
Hi there, I am working with SOAP through the groovy-wslite library (willing to switch to another if there's one, but haven't found any other). The problem is the server gives me multipart/related responses, which cause the groovy-wslite SAX parser to choke on “Content is not allowed in

Re: recognise empty closure?

2021-02-18 Thread OCsite
but we >> could check and set some property to closure while compiling, then get the >> property at runtime. It will be an new improvement, not sure if others like >> it or not. >> >> Cheers, >> Daniel Sun >> >> On 2021/02/17 15:06:47, OCsite &

Re: parsing multipart/related soaps?

2021-02-16 Thread OCsite
Well meantime I've found SimpleMimeReader, which does not quite work as-is, but can be comparatively easily tweaked to do what's needed. Still, if there's a groovier option for a SOAP client than groovy-wslite+SimpleMimeReader, I'd be interested... Thanks, OC > On 17 Feb 2021, at 1:40, OCs

recognise empty closure?

2021-02-17 Thread OCsite
Hi there, is it possible to reliably recognise an empty closure, i.e., „{}“, programmatically? def foo(Closure bar) { if (?bar-is-empty?) throw new Exception('The closure cannot be empty!') else bar() } foo { println "ok" } // OK foo { 1 } // OK foo { } // throws Thanks! OC

Re: dynamically install a method/property to be visible through reflexion?

2021-08-28 Thread OCsite
Rachel, Paul, thanks a lot! Pity not even today's Java supports something like Objective-C runtime support for managing the methods in a class :( Anyway, I might try to create my (sub)classes dynamically at runtime — this is an idea which did not occur to me before; and although I can see

Re: dynamically install a method/property to be visible through reflexion?

2021-08-30 Thread OCsite
Jochen, thanks a lot! > On 29 Aug 2021, at 19:22, Jochen Theodorou wrote: > On 28.08.21 14:46, OCsite wrote: >> Pity not even today's Java supports something like Objective-C runtime >> support for managing the methods in a class :( >> >> Anyway, I might

Re: Checking directory state using Groovy

2021-10-20 Thread OCsite
James, > On 20. 10. 2021, at 13:18, James McMahon wrote: > One thing I've been thinking about recently is whether these refinements > always make things easier to read and maintain, or more cryptic and > difficult? Some groovy things I've seen sometimes make it a little more > difficult to

Style guide (was: Checking directory state using Groovy)

2021-10-20 Thread OCsite
Just in case someone happens to be checking this guide now based on my recommendation... > On 20 Oct 2021, at 14:00, OCsite wrote: > There used to be a style guide amongst the documentation somewhere, let me > see... here you are: http://groovy-lang.org/style-guide.html > &l

Re: Checking directory state using Groovy

2021-10-15 Thread OCsite
James, if I understand right, for this you need the canXXX methods of File, which is a standard Java API (all Java APIs are directly accessible from Groovy): https://docs.oracle.com/javase/8/docs/api/index.html?java/io/File.html I doubt there's a groovier way for that, but of course I might be

3 > 4 regression

2023-11-01 Thread OCsite
Hi there, looks like 3 used to inline private static finals, while 4 does not, which causes the following regression. Is that the intended behaviour, or a bug? Thanks, OC === 1030 ocs /tmp> /usr/local/groovy-3.0.8/bin/groovy q wth 1032 ocs /tmp> /usr/local/groovy-4.0.0-alpha-1/bin/groovy q.m

Re: Small survey on the usage of the metaclass system and MOP

2024-01-08 Thread OCsite
Jochen, > On 8. 1. 2024, at 16:10, Jochen Theodorou wrote: > I would like to know from users on this list mostly if they are using > specific features of the meta class system and MOP, but especially what for. > > (1) categories > ... > use (CategoryClass) { > // some code and callstack here

Re: Small survey on the usage of the metaclass system and MOP

2024-01-09 Thread OCsite
2024, at 22:12, Jochen Theodorou wrote: > > On 08.01.24 20:42, OCsite wrote: > [...]> - the extension class list is collected compile-time and (eventually >> when my build script creates the application) automatically added to the >> /org.codehaus.groovy.runtime.Extensio