Re: Quoted symbols in R7RS mode don't work
Shiro Kawai <[email protected]> Sat, 25 Apr 2026 09:15:27 -1000
| Newsgroups | gmane.lisp.scheme.gauche |
|---|---|
| Message-ID | <CALN0JNFwAC0+c-MiUHCOkscSLPFbYXQToHd_=SDFHfQDRLngCg@mail.gmail.com> |
--===============7552106861935134827== Content-Type: multipart/alternative; boundary="000000000000eb7ef806504db480" --000000000000eb7ef806504db480 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That's because you started REPL with Gauche native namespace, where traditional Gauche libraries are available by default, and then switched to a namespace where only (srfi 1) is imported. Starting gosh with -r7 option gives you R7RS REPL. $ gosh -r7 gosh[r7rs.user]$ 'foo foo But I see users expecting R7RS REPL are easily confused with the behavior. I can notice the users when the user switched from Gauche mode to R7RS mode first time on REPL. Cf. See "Using R7RS REPL" and "Switching from Gauche REPL" sections below. https://practical-scheme.net/gauche/man/gauche-refe/R7RS-integration.html#R= 7RS-integration On Sat, Apr 25, 2026 at 9:00=E2=80=AFAM John Cowan <[email protected]> wrote: > So it turns out this is because when you start R7RS mode, (scheme > base) is not auto-imported, which vioates R7RS section 5.7: > > For convenience and ease of use, the global Scheme environment in a > REPL must not be empty, but must start out with at least the bindings > provided by the base library > > On Sat, Apr 25, 2026 at 2:44=E2=80=AFPM John Cowan <[email protected]> wrote= : > > > > johnwcowan@skunk:~/Documents/mung$ gosh -V > > Gauche scheme shell, version 0.9.15-p2 > > [utf-8,pthreads,snapshot=3D20241205], x86_64-pc-linux-gnu > > (version "0.9.15-p2") > > (command "gosh") > > (scheme.id gauche) > > (languages scheme r5rs r7rs) > > (encodings utf-8) > > (website "https://practical-scheme.net/gauche") > > (build.platform "x86_64-pc-linux-gnu") > > (build.configure) > > (build.gosh-version "0.9.15-p2") > > (scheme.path "/usr/share/gauche-0.98/site/lib" > > "/usr/share/gauche-0.98/0.9.15-p2/lib") > > (threads pthreads) > > (gauche.net.tls mbedtls) > > > > johnwcowan@skunk:~/Documents/mung$ gosh > > gosh$ 'foo > > foo > > gosh$ (import (srfi 1)) > > gosh[r7rs.user]$ 'foo > > *** UNBOUND-VARIABLE-ERROR: unbound variable: foo > > Stack Trace: > > _______________________________________ > > 0 (report-error e) > > 1 (eval expr env) > > at > "/usr/share/gauche-0.98/0.9.15-p2/lib/gauche/interactive.scm":405 > > 2 (evaluator exp (vm-current-module)) > > 3 (with-error-handler (^e (report-error e) #t) (^ () (let loop2 ... > > > _______________________________________________ > Gauche-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/gauche-devel > --000000000000eb7ef806504db480 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-size:large">Tha= t's because you started REPL with Gauche native namespace, where tradit= ional Gauche libraries are available by default, and then switched to a nam= espace where only (srfi 1) is imported.<br><br>Starting gosh with -r7 optio= n gives you R7RS REPL.<br><br>$ gosh -r7<br>gosh[r7rs.user]$ 'foo<br>fo= o<br><br>But I see users expecting R7RS REPL are easily confused with the b= ehavior.=C2=A0 I can notice the users when the user switched from Gauche mo= de to R7RS mode first time on REPL.</div><div class=3D"gmail_default" style= =3D"font-size:large"><br>Cf. See "Using R7RS REPL" and "Swit= ching from Gauche REPL" sections below.</div><div class=3D"gmail_defau= lt" style=3D"font-size:large"><br><a href=3D"https://practical-scheme.net/g= auche/man/gauche-refe/R7RS-integration.html#R7RS-integration">https://pract= ical-scheme.net/gauche/man/gauche-refe/R7RS-integration.html#R7RS-integrati= on</a></div></div><br><div class=3D"gmail_quote gmail_quote_container"><div= dir=3D"ltr" class=3D"gmail_attr">On Sat, Apr 25, 2026 at 9:00=E2=80=AFAM J= ohn Cowan <<a href=3D"mailto:[email protected]">[email protected]</a>> wrot= e:<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">So it turns o= ut this is because when you start R7RS mode, (scheme<br> base) is not auto-imported, which vioates R7RS section 5.7:<br> <br> =C2=A0For convenience and ease of use, the global Scheme environment in a<b= r> REPL must not be empty, but must start out with at least the bindings<br> provided by the base library<br> <br> On Sat, Apr 25, 2026 at 2:44=E2=80=AFPM John Cowan <<a href=3D"mailto:co= [email protected]" target=3D"_blank">[email protected]</a>> wrote:<br> ><br> > johnwcowan@skunk:~/Documents/mung$ gosh -V<br> > Gauche scheme shell, version 0.9.15-p2<br> > [utf-8,pthreads,snapshot=3D20241205], x86_64-pc-linux-gnu<br> > (version "0.9.15-p2")<br> > (command "gosh")<br> > (<a href=3D"http://scheme.id" rel=3D"noreferrer" target=3D"_blank">sch= eme.id</a> gauche)<br> > (languages scheme r5rs r7rs)<br> > (encodings utf-8)<br> > (website "<a href=3D"https://practical-scheme.net/gauche" rel=3D"= noreferrer" target=3D"_blank">https://practical-scheme.net/gauche</a>"= )<br> > (build.platform "x86_64-pc-linux-gnu")<br> > (build.configure)<br> > (build.gosh-version "0.9.15-p2")<br> > (scheme.path "/usr/share/gauche-0.98/site/lib"<br> > "/usr/share/gauche-0.98/0.9.15-p2/lib")<br> > (threads pthreads)<br> > (gauche.net.tls mbedtls)<br> ><br> > johnwcowan@skunk:~/Documents/mung$ gosh<br> > gosh$ 'foo<br> > foo<br> > gosh$ (import (srfi 1))<br> > gosh[r7rs.user]$ 'foo<br> > *** UNBOUND-VARIABLE-ERROR: unbound variable: foo<br> > Stack Trace:<br> > _______________________________________<br> >=C2=A0 =C2=A00=C2=A0 (report-error e)<br> >=C2=A0 =C2=A01=C2=A0 (eval expr env)<br> >=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0at "/usr/share/gauche-0.98/0.9.1= 5-p2/lib/gauche/interactive.scm":405<br> >=C2=A0 =C2=A02=C2=A0 (evaluator exp (vm-current-module))<br> >=C2=A0 =C2=A03=C2=A0 (with-error-handler (^e (report-error e) #t) (^ ()= (let loop2 ...<br> <br> <br> _______________________________________________<br> Gauche-devel mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">Gau= [email protected]</a><br> <a href=3D"https://lists.sourceforge.net/lists/listinfo/gauche-devel" rel= =3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/listi= nfo/gauche-devel</a><br> </blockquote></div> --000000000000eb7ef806504db480-- --===============7552106861935134827== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============7552106861935134827== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Gauche-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gauche-devel --===============7552106861935134827==--