groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam L. Davis (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-9023) In Groovy console, add a script binding allowing values to associate to code lines
Date Fri, 08 Mar 2019 01:25:00 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-9023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16787424#comment-16787424
] 

Adam L. Davis commented on GROOVY-9023:
---------------------------------------

Sorry for being unclear before. Updated text so intent is clearer. Target is a list of values
over time for each variable. _console.put('x', x++) might be clearer but requires more typing.

> In Groovy console, add a script binding allowing values to associate to code lines
> ----------------------------------------------------------------------------------
>
>                 Key: GROOVY-9023
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9023
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Groovy Console
>    Affects Versions: 3.0.0-alpha-4
>            Reporter: Adam L. Davis
>            Priority: Minor
>
> # Add internal method to groovy console for determining line of code in script from method
call (I've got a way to do this but perhaps someone could find a better way):
>  try \{throw new Exception()}
> catch (Exception e)
> { StackTraceUtils.sanitize(e) return e.stackTrace[0] }
> 2. Add script binding (named _c maybe) to script which has a method or methods that add
a value to a list associated with current code line and variable name (propertyMissing?).
> Allowing following syntax:
> x = 1
>  for (i in 1..10) _c.x = x++
>  x
> 3. Output the values from _c into console's output. For example, following above:
> x = 1
> {{x = 2 3 4 5 6 7 8 9 10 11}}
> x = 11
>  4. Output lines up with code line that produced it (or at least near it).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message