Re: questions about groovysh's doc
Xeno Amess <[email protected]> Sat, 19 Jul 2025 17:43:49 +0800
| Newsgroups | gmane.comp.lang.groovy.user |
|---|---|
| Message-ID | <CAFF4x5+6Kwn9HTEWWhhYA=1J_P7427GTopdtQGuM-cYrFfaf1g@mail.gmail.com> |
--00000000000011de71063a45151d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I see the record command, and wonder should I use record to achieve this... still, not found where to load the record into the sh...(I mean by programmably, not like manually open the file then click ctrl+c then ctrl+v and paste to the shell window) Xeno Amess <[email protected]> =E4=BA=8E2025=E5=B9=B47=E6=9C=8819=E6=97= =A5=E5=91=A8=E5=85=AD 17:40=E5=86=99=E9=81=93=EF=BC=9A > question 1 and 2 is cleared. > still, I'm uncertain about question 3 > 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) > > > Paul King <[email protected]> =E4=BA=8E2025=E5=B9=B47=E6=9C=8816=E6=97= =A5=E5=91=A8=E4=B8=89 21:57=E5=86=99=E9=81=93=EF=BC=9A > >> >> >> On Wed, Jul 16, 2025 at 6:07=E2=80=AFPM Xeno Amess <[email protected]>= wrote: >> >>> I see >>> https://github.com/apache/groovy/blob/master/subprojects/groovy-groovys= h/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 buffe= r >> 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 n= ext >>> 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. >> >> > --00000000000011de71063a45151d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr">I see the record command, and wonder shou= ld I use record to achieve this...</div><div>still, not found where to load= the record into the sh...(I mean by programmably, not like manually open t= he file then click ctrl+c then ctrl+v and paste to the shell window)</div><= br><div class=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class= =3D"gmail_attr">Xeno Amess <<a href=3D"mailto:[email protected]">xenoa= [email protected]</a>> =E4=BA=8E2025=E5=B9=B47=E6=9C=8819=E6=97=A5=E5=91=A8= =E5=85=AD 17:40=E5=86=99=E9=81=93=EF=BC=9A<br></div><blockquote class=3D"gm= ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,= 204,204);padding-left:1ex"><div dir=3D"ltr">question 1 and 2 is cleared.<di= v>still, I'm uncertain about question 3=C2=A0</div><div><span style=3D"= color:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,"Sego= e UI",Roboto,Oxygen,Ubuntu,"Fira Sans","Droid Sans"= ;,"Helvetica Neue",sans-serif;font-size:14px">3.=C2=A0</span><spa= n style=3D"color:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont= ,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sans","Droi= d Sans","Helvetica Neue",sans-serif;font-size:14px">also ano= ther question, I binded several variables, and injected some functions, how= can I save the whole context, and load it for use when next time(something= like squeak if you know it)</span></div><div><br></div></div><br><div clas= s=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">Paul King <<a hr= ef=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a>&g= t; =E4=BA=8E2025=E5=B9=B47=E6=9C=8816=E6=97=A5=E5=91=A8=E4=B8=89 21:57=E5= =86=99=E9=81=93=EF=BC=9A<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"><div dir=3D"ltr"><br></div><br><div class=3D"gm= ail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Jul 16, 2025 at 6:= 07=E2=80=AFPM Xeno Amess <<a href=3D"mailto:[email protected]" target= =3D"_blank">[email protected]</a>> wrote:<br></div><blockquote class= =3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg= b(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/d= oc/groovysh.adoc" target=3D"_blank">https://github.com/apache/groovy/blob/m= aster/subprojects/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"color:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,&= quot;Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sans","Droid = Sans","Helvetica Neue",sans-serif;font-size:14px">it said &#= 39;Features: No need for=C2=A0</span><b style=3D"color:rgb(23,43,77);font-f= amily:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,U= buntu,"Fira Sans","Droid Sans","Helvetica Neue&quo= t;,sans-serif;font-size:14px">go</b><span style=3D"color:rgb(23,43,77);font= -family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen= ,Ubuntu,"Fira Sans","Droid Sans","Helvetica Neue&q= uot;,sans-serif;font-size:14px">=C2=A0command to execute buffer.'</span= ></div><span style=3D"color:rgb(23,43,77);font-family:-apple-system,BlinkMa= cSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sans"= ,"Droid Sans","Helvetica Neue",sans-serif;font-size:14p= x">what be the=C2=A0</span><b style=3D"color:rgb(23,43,77);font-family:-app= le-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,&quo= t;Fira Sans","Droid Sans","Helvetica Neue",sans-se= rif;font-size:14px">go</b><span style=3D"color:rgb(23,43,77);font-family:-a= pple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,&q= uot;Fira Sans","Droid Sans","Helvetica Neue",sans-= serif;font-size:14px">=C2=A0here mean?</span><br style=3D"color:rgb(23,43,7= 7);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto= ,Oxygen,Ubuntu,"Fira Sans","Droid Sans","Helvetica= Neue",sans-serif;font-size:14px"><span style=3D"color:rgb(23,43,77);f= ont-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxy= gen,Ubuntu,"Fira Sans","Droid Sans","Helvetica Neu= e",sans-serif;font-size:14px">and what the=C2=A0</span><b style=3D"col= or:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,"Segoe U= I",Roboto,Oxygen,Ubuntu,"Fira Sans","Droid Sans",&= quot;Helvetica Neue",sans-serif;font-size:14px">go</b><span style=3D"c= olor:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,"Segoe= UI",Roboto,Oxygen,Ubuntu,"Fira Sans","Droid Sans"= ,"Helvetica Neue",sans-serif;font-size:14px">=C2=A0do with groovy= /groovysh?</span><br style=3D"color:rgb(23,43,77);font-family:-apple-system= ,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sa= ns","Droid Sans","Helvetica Neue",sans-serif;font-= size:14px"><span style=3D"color:rgb(23,43,77);font-family:-apple-system,Bli= nkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sans&q= uot;,"Droid Sans","Helvetica Neue",sans-serif;font-size= :14px">I just feel somehow confused.</span></div></blockquote><div><br></di= v><div>That is a little outdated. In very old versions of groovysh, I belie= ve=C2=A0you entered commands and then typed "go" to execute them.= </div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0p= x 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><d= iv dir=3D"ltr"><div><span style=3D"color:rgb(23,43,77);font-family:-apple-s= ystem,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fi= ra Sans","Droid Sans","Helvetica Neue",sans-serif;= font-size:14px">2.=C2=A0</span><span style=3D"color:rgb(23,43,77);font-fami= ly:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubun= tu,"Fira Sans","Droid Sans","Helvetica Neue",= sans-serif;font-size:14px">what is=C2=A0</span><b style=3D"color:rgb(23,43,= 77);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Robot= o,Oxygen,Ubuntu,"Fira Sans","Droid Sans","Helvetic= a Neue",sans-serif;font-size:14px">the buffer</b><span style=3D"color:= rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI&q= uot;,Roboto,Oxygen,Ubuntu,"Fira Sans","Droid Sans",&quo= t;Helvetica Neue",sans-serif;font-size:14px">=C2=A0mean in this doc...= </span></div><span style=3D"color:rgb(23,43,77);font-family:-apple-system,B= linkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sans= ","Droid Sans","Helvetica Neue",sans-serif;font-si= ze:14px">(and save/load)</span></div></blockquote><div><br></div><div><font= color=3D"#172b4d" face=3D"-apple-system, system-ui, Segoe UI, Roboto, Oxyg= en, Ubuntu, Fira Sans, Droid Sans, Helvetica Neue, sans-serif">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=C2=A0complete compilable snippet is obt= ained. Once the buffer (potentially empty) plus the last entered line toget= her are compilable, 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.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,= BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,"Fira San= s","Droid Sans","Helvetica Neue",sans-serif;font-s= ize:14px">3.=C2=A0</span><span style=3D"color:rgb(23,43,77);font-family:-ap= ple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,&qu= ot;Fira Sans","Droid Sans","Helvetica Neue",sans-s= erif;font-size:14px">also another question, I binded several variables, and= injected some functions, how can I save the whole context, and load it for= use when next time(something like squeak if you know it)</span></div><span= style=3D"color:rgb(23,43,77);font-family:-apple-system,BlinkMacSystemFont,= "Segoe UI",Roboto,Oxygen,Ubuntu,"Fira Sans","Droid= Sans","Helvetica Neue",sans-serif;font-size:14px">I ask as = it seems not the same save/load you provided as command...</span></div></bl= ockquote><div><br></div><div><font color=3D"#172b4d" face=3D"-apple-system,= system-ui, Segoe UI, Roboto, Oxygen, Ubuntu, Fira Sans, Droid Sans, Helvet= ica Neue, 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"-ap= ple-system, system-ui, Segoe UI, Roboto, Oxygen, Ubuntu, Fira Sans, Droid S= ans, Helvetica Neue, sans-serif">Paul.</font></div><div>=C2=A0</div></div><= /div> </blockquote></div> </blockquote></div></div> --00000000000011de71063a45151d--