Re: questions about groovysh's doc

Paul King <[email protected]> Wed, 16 Jul 2025 23:56:53 +1000
Newsgroups gmane.comp.lang.groovy.user
Message-ID <CAMbkE7Snvwh=X9p3RN6Dak9WDWp_tswUOyT=ok4ToQrVdVfU1Q@mail.gmail.com>
--000000000000a7602f063a0c44fe
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 16, 2025 at 6:07=E2=80=AFPM Xeno Amess <[email protected]> wr=
ote:

> I see
> https://github.com/apache/groovy/blob/master/subprojects/groovy-groovysh/=
src/spec/doc/groovysh.adoc
>
> and still have several questions...
>
> 1. it said 'Features: No need for *go* command to execute buffer.'
> what be the *go* here mean?
> and what the *go* do with groovy/groovysh?
> I just feel somehow confused.
>

That is a little outdated. In very old versions of groovysh, I believe you
entered commands and then typed "go" to execute them.


> 2. what is *the buffer* mean in this doc...
> (and save/load)
>

The current version (but changing in 5.0.0-beta-2) of Groovysh has the idea
of a buffer where part lines are added until a complete compilable snippet
is obtained. Once the buffer (potentially empty) plus the last entered line
together are compilable, the code is compiled and the buffer reset.


> 3. also another question, I binded several variables, and injected some
> functions, how can I save the whole context, and load it for use when nex=
t
> time(something like squeak if you know it)
> I ask as it seems not the same save/load you provided as command...
>

You should check out the new version coming in 5.0.0-beta-2.

Paul.

--000000000000a7602f063a0c44fe
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g=
mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Jul 16,=
 2025 at 6:07=E2=80=AFPM Xeno Amess &lt;<a href=3D"mailto:[email protected]=
om">[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_=
quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,=
204);padding-left:1ex"><div dir=3D"ltr">I see <a href=3D"https://github.com=
/apache/groovy/blob/master/subprojects/groovy-groovysh/src/spec/doc/groovys=
h.adoc" target=3D"_blank">https://github.com/apache/groovy/blob/master/subp=
rojects/groovy-groovysh/src/spec/doc/groovysh.adoc</a>=C2=A0<div>and still =
have several questions...</div><div><br></div><div>1.=C2=A0<span style=3D"c=
olor:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe=
 UI&quot;,Roboto,Oxygen,Ubuntu,&quot;Fira Sans&quot;,&quot;Droid Sans&quot;=
,&quot;Helvetica Neue&quot;,sans-serif;font-size:14px">it said &#39;Feature=
s: No need for=C2=A0</span><b style=3D"color:rgb(23,43,77);font-family:-app=
le-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&quo=
t;Fira Sans&quot;,&quot;Droid Sans&quot;,&quot;Helvetica Neue&quot;,sans-se=
rif;font-size:14px">go</b><span style=3D"color:rgb(23,43,77);font-family:-a=
pple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&q=
uot;Fira Sans&quot;,&quot;Droid Sans&quot;,&quot;Helvetica Neue&quot;,sans-=
serif;font-size:14px">=C2=A0command to execute buffer.&#39;</span></div><sp=
an style=3D"color:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFon=
t,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&quot;Fira Sans&quot;,&quot;Dro=
id Sans&quot;,&quot;Helvetica Neue&quot;,sans-serif;font-size:14px">what be=
 the=C2=A0</span><b style=3D"color:rgb(23,43,77);font-family:-apple-system,=
BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&quot;Fira San=
s&quot;,&quot;Droid Sans&quot;,&quot;Helvetica Neue&quot;,sans-serif;font-s=
ize:14px">go</b><span style=3D"color:rgb(23,43,77);font-family:-apple-syste=
m,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&quot;Fira S=
ans&quot;,&quot;Droid Sans&quot;,&quot;Helvetica Neue&quot;,sans-serif;font=
-size:14px">=C2=A0here mean?</span><br style=3D"color:rgb(23,43,77);font-fa=
mily:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ub=
untu,&quot;Fira Sans&quot;,&quot;Droid Sans&quot;,&quot;Helvetica Neue&quot=
;,sans-serif;font-size:14px"><span style=3D"color:rgb(23,43,77);font-family=
:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu=
,&quot;Fira Sans&quot;,&quot;Droid Sans&quot;,&quot;Helvetica Neue&quot;,sa=
ns-serif;font-size:14px">and what the=C2=A0</span><b style=3D"color:rgb(23,=
43,77);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Ro=
boto,Oxygen,Ubuntu,&quot;Fira Sans&quot;,&quot;Droid Sans&quot;,&quot;Helve=
tica Neue&quot;,sans-serif;font-size:14px">go</b><span style=3D"color:rgb(2=
3,43,77);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,=
Roboto,Oxygen,Ubuntu,&quot;Fira Sans&quot;,&quot;Droid Sans&quot;,&quot;Hel=
vetica Neue&quot;,sans-serif;font-size:14px">=C2=A0do with groovy/groovysh?=
</span><br style=3D"color:rgb(23,43,77);font-family:-apple-system,BlinkMacS=
ystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&quot;Fira Sans&quot;,&=
quot;Droid Sans&quot;,&quot;Helvetica Neue&quot;,sans-serif;font-size:14px"=
><span style=3D"color:rgb(23,43,77);font-family:-apple-system,BlinkMacSyste=
mFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&quot;Fira Sans&quot;,&quot=
;Droid Sans&quot;,&quot;Helvetica Neue&quot;,sans-serif;font-size:14px">I j=
ust feel somehow confused.</span></div></blockquote><div><br></div><div>Tha=
t is a little outdated. In very old versions of groovysh, I believe=C2=A0yo=
u entered commands and then typed &quot;go&quot; to execute them.</div><div=
>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px =
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"=
ltr"><div><span style=3D"color:rgb(23,43,77);font-family:-apple-system,Blin=
kMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&quot;Fira Sans&qu=
ot;,&quot;Droid Sans&quot;,&quot;Helvetica Neue&quot;,sans-serif;font-size:=
14px">2.=C2=A0</span><span style=3D"color:rgb(23,43,77);font-family:-apple-=
system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&quot;F=
ira Sans&quot;,&quot;Droid Sans&quot;,&quot;Helvetica Neue&quot;,sans-serif=
;font-size:14px">what is=C2=A0</span><b style=3D"color:rgb(23,43,77);font-f=
amily:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen,U=
buntu,&quot;Fira Sans&quot;,&quot;Droid Sans&quot;,&quot;Helvetica Neue&quo=
t;,sans-serif;font-size:14px">the buffer</b><span style=3D"color:rgb(23,43,=
77);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Robot=
o,Oxygen,Ubuntu,&quot;Fira Sans&quot;,&quot;Droid Sans&quot;,&quot;Helvetic=
a Neue&quot;,sans-serif;font-size:14px">=C2=A0mean in this doc...</span></d=
iv><span style=3D"color:rgb(23,43,77);font-family:-apple-system,BlinkMacSys=
temFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&quot;Fira Sans&quot;,&qu=
ot;Droid Sans&quot;,&quot;Helvetica Neue&quot;,sans-serif;font-size:14px">(=
and save/load)</span></div></blockquote><div><br></div><div><font color=3D"=
#172b4d" face=3D"-apple-system, system-ui, Segoe UI, Roboto, Oxygen, Ubuntu=
, Fira Sans, Droid Sans, Helvetica Neue, sans-serif">The current version (b=
ut changing in 5.0.0-beta-2) of Groovysh has the idea of a buffer where par=
t lines are added until a=C2=A0complete compilable snippet is obtained. Onc=
e the buffer (potentially empty) plus the last entered line together are co=
mpilable, the code is compiled and the buffer reset.</font></div><div>=C2=
=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"=
><div><span style=3D"color:rgb(23,43,77);font-family:-apple-system,BlinkMac=
SystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&quot;Fira Sans&quot;,=
&quot;Droid Sans&quot;,&quot;Helvetica Neue&quot;,sans-serif;font-size:14px=
">3.=C2=A0</span><span style=3D"color:rgb(23,43,77);font-family:-apple-syst=
em,BlinkMacSystemFont,&quot;Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&quot;Fira =
Sans&quot;,&quot;Droid Sans&quot;,&quot;Helvetica Neue&quot;,sans-serif;fon=
t-size:14px">also another question, I binded several variables, and injecte=
d some functions, how can I save the whole context, and load it for use whe=
n next time(something like squeak if you know it)</span></div><span style=
=3D"color:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,&quot;=
Segoe UI&quot;,Roboto,Oxygen,Ubuntu,&quot;Fira Sans&quot;,&quot;Droid Sans&=
quot;,&quot;Helvetica Neue&quot;,sans-serif;font-size:14px">I ask as it see=
ms not the same save/load you provided as command...</span></div></blockquo=
te><div><br></div><div><font color=3D"#172b4d" face=3D"-apple-system, syste=
m-ui, Segoe UI, Roboto, Oxygen, Ubuntu, Fira Sans, Droid Sans, Helvetica Ne=
ue, sans-serif">You should check out the new version coming in 5.0.0-beta-2=
.</font></div><div><br></div><div><font color=3D"#172b4d" face=3D"-apple-sy=
stem, system-ui, Segoe UI, Roboto, Oxygen, Ubuntu, Fira Sans, Droid Sans, H=
elvetica Neue, sans-serif">Paul.</font></div><div>=C2=A0</div></div></div>

--000000000000a7602f063a0c44fe--