[gambit-list] How pipe from shell to gsc ('s repl)?

Marc Feeley feeley at iro.umontreal.ca
Wed Jul 13 11:36:04 EDT 2016


You mean they don’t fit well in terms of length?  If I recall correctly you can have a quoted command line argument that spans multiple lines:

% car script.sh
#! /bin/sh

gsc -e '
(define n 1000)
(define (f x) (* x x))
(pp (f n))
(pp "hello")
'

Marc

> On Jul 13, 2016, at 10:44 AM, Adam <adam.mlmb at gmail.com> wrote:
> 
> Ah, yes of course -e works universally; I meant universal in the sense pluripotent, panacea, here, that is, that there are instances when you want to launch gsc with code parameters, but they don't fit well into a command line argument, so it's not universal in the sense that -e can't receive code as parameters also via stdin. Only that.
> 
> 2016-07-13 22:28 GMT+08:00 Marc Feeley <feeley at iro.umontreal.ca>:
> I’m not sure what you mean when you say the “-e” command line option is not universal.  It should work on all platforms, regardless of the OS.
> 
> Marc
> 
> > On Jul 13, 2016, at 1:22 AM, Adam <adam.mlmb at gmail.com> wrote:
> >
> > Marc,
> >
> > How do I pipe commands into Gambit on "all" unices?
> >
> > The "-e" argument is not universal so I may just want to pipe to Gambit's stdin.
> >
> > The following just brings you a REPL with no input made to it, and you do the typing - does Gambit use some very exotic means of console input, or does it empty its read buffer at start?? If so why, and how do I make it simply use "stdin"?
> >
> > cat << 'eof' | gsc
> >
> > (display "Hello world\n")
> > ,q
> >
> > eof
> >
> >
> > Thanks
> >
> 
> 




More information about the Gambit-list mailing list