You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2019/03/07 21:25:00 UTC

[jira] [Commented] (GROOVY-9023) In Groovy console, add a script binding allowing values to associate to code lines

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

Paul King commented on GROOVY-9023:
-----------------------------------

I would suggest using/enhancing the existing binding:
{code}
x = 6
y = 7
z = x * y
println binding.variables // raw but could be made prettier
{code}

> 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
>
> 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: {{_c.x = x}}
> 3. Output the values from _c into console's output. {{x = 1}}
> 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)