[racket-users] Re: Running from command line and staying in REPL?

2018-09-13 Thread Jon Kleiser
I have found some info 
here: 
https://docs.racket-lang.org/guide/racket.html#%28part._start-interactive-mode%29
However, I haven't reached my goal yet. If I do this
racket -t hello.rkt -i
then my hello.rkt is executed, and I end with a ">" prompt, but trying a 
command like (exit) at that point is not very successful, as you can see 
here:
$ racket -t hello.rkt -i
Welcome to Racket v7.0.
'hello-racket-world
> (exit)
; readline-input:1:0: #%top-interaction: unbound identifier;
;  also, no #%app syntax transformer is bound
;   at: #%top-interaction
;   in: (#%top-interaction exit)
; [,bt for context]

and then
> ,bt
; readline-input:1:0: #%top-interaction: unbound identifier;
;  also, no #%app syntax transformer is bound
;   at: #%top-interaction
;   in: (#%top-interaction exit)
;   location...:
;readline-input:1:0
;   context...:
;raise-syntax-error
;expand-capturing-lifts
;expand-single
;temp74_0
;compile16
;temp68_2
;/Applications/Racket_v7.0/share/pkgs/xrepl-lib/xrepl/xrepl.rkt:1477:0
;/Applications/Racket_v7.0/collects/racket/repl.rkt:11:26

Then I have to hit Ctrl-D to get back into the shell.

torsdag 13. september 2018 10.19.22 UTC+2 skrev Jon Kleiser følgende:
>
> Hi,
>
> I would like to run some Racket programs in the macOS Terminal (racket 
> foo.rkt bar1 bar2), and keep staying in the Racket REPL when my code has 
> completed. Is that possible?
>
> /Jon
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Running from command line and staying in REPL?

2018-09-13 Thread Jon Kleiser
Hi,

I would like to run some Racket programs in the macOS Terminal (racket 
foo.rkt bar1 bar2), and keep staying in the Racket REPL when my code has 
completed. Is that possible?

/Jon

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Running from command line and staying in REPL?

2018-09-13 Thread Jon Kleiser
Works like a charm. Thanks!
Maybe that "21.1.1 Interactive Mode" chapter should mention that "-it" 
solution?

torsdag 13. september 2018 12.58.57 UTC+2 skrev Matthias Felleisen følgende:
>
>
> $ racket -it foo.bar 
>
>
>
> On Sep 13, 2018, at 4:19 AM, Jon Kleiser  > wrote:
>
> Hi,
>
> I would like to run some Racket programs in the macOS Terminal (racket 
> foo.rkt bar1 bar2), and keep staying in the Racket REPL when my code has 
> completed. Is that possible?
>
> /Jon
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users...@googlegroups.com .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Running from command line and staying in REPL?

2018-09-13 Thread Jon Kleiser
Sorry, but I'm not quite happy yet. ;-)
When I get the ">" prompt, the definitions made in my hello.rkt seems to be 
gone. I get "cannot reference an identifier before its definition". How can 
I avoid that definitions and data get lost?

torsdag 13. september 2018 13.03.42 UTC+2 skrev Jon Kleiser følgende:
>
> Works like a charm. Thanks!
> Maybe that "21.1.1 Interactive Mode" chapter should mention that "-it" 
> solution?
>
> torsdag 13. september 2018 12.58.57 UTC+2 skrev Matthias Felleisen 
> følgende:
>>
>>
>> $ racket -it foo.bar 
>>
>>
>>
>> On Sep 13, 2018, at 4:19 AM, Jon Kleiser  wrote:
>>
>> Hi,
>>
>> I would like to run some Racket programs in the macOS Terminal (racket 
>> foo.rkt bar1 bar2), and keep staying in the Racket REPL when my code has 
>> completed. Is that possible?
>>
>> /Jon
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Running from command line and staying in REPL?

2018-09-13 Thread Jon Kleiser
I think I found the answer: Use (provide . . .).

torsdag 13. september 2018 13.16.15 UTC+2 skrev Jon Kleiser følgende:
>
> Sorry, but I'm not quite happy yet. ;-)
> When I get the ">" prompt, the definitions made in my hello.rkt seems to 
> be gone. I get "cannot reference an identifier before its definition". How 
> can I avoid that definitions and data get lost?
>
> torsdag 13. september 2018 13.03.42 UTC+2 skrev Jon Kleiser følgende:
>>
>> Works like a charm. Thanks!
>> Maybe that "21.1.1 Interactive Mode" chapter should mention that "-it" 
>> solution?
>>
>> torsdag 13. september 2018 12.58.57 UTC+2 skrev Matthias Felleisen 
>> følgende:
>>>
>>>
>>> $ racket -it foo.bar 
>>>
>>>
>>>
>>> On Sep 13, 2018, at 4:19 AM, Jon Kleiser  wrote:
>>>
>>> Hi,
>>>
>>> I would like to run some Racket programs in the macOS Terminal (racket 
>>> foo.rkt bar1 bar2), and keep staying in the Racket REPL when my code has 
>>> completed. Is that possible?
>>>
>>> /Jon
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to racket-users...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Non-ASCII characters stripped from input in macOS Terminal

2018-09-14 Thread Jon Kleiser
Thanks, Matthew! That was the final touch. I guess I will have to repeat 
that "ln -s" line after I upgrade Racket to the next version. Right?

fredag 14. september 2018 15.55.57 UTC+2 skrev Matthew Flatt følgende:
>
> I forgot that Mac OS provides "/usr/lib/libreadline.dylib" as a symlink 
> to libedit, so installing readline via Homebrew doesn't (and shouldn't) 
> replace it. 
>
> To point Racket at your Homebrew-installred readline, go to the "lib" 
> directory adjacent to the "bin" directory that contains "racket", and 
> run 
>
>   ln -s /usr/local/opt/readline/lib/libreadline.dylib 
>
> That way, Racket will find the "libreadline.dylib" from Homebrew 
> instead of the not-libreadline from the OS, since Racket looks in its 
> own "lib" first. 
>
> At Fri, 14 Sep 2018 06:43:25 -0700 (PDT), Jon Kleiser wrote: 
> > Thanks for the info. However, there must be one detail I'm missing. 
> > I have done "brew install readline", and "raco pkg install 
> readline-gpl", 
> > and when I now do "raco pkg show", I get this: 
> > 
> > Installation-wide: 
> >  PackageChecksum Source 
> >  main-distribution  34484fc4a83e3441...  catalog...tribution 
> >  racket-lib 570306a2bfa6057f...  catalog racket-lib 
> >  [198 auto-installed packages not shown] 
> > User-specific for installation "7.0": 
> >  Package   Checksum   Source 
> >  readline-gpl  2990d5f3a3d43c2d2f...  catalog...eadline-gpl 
> > 
> > However, when I do "racket", I still get 
> > "\U+FFC3\U+FFA6\U+FFC3\U+FFB8\U+FFC3\U+FFA5" when typing "æøå" at the 
> > prompt. Is there something I should (require ...)? 
> > 
> > fredag 14. september 2018 13.54.07 UTC+2 skrev Matthew Flatt følgende: 
> > > 
> > > This is a problem with libedit, which Racket uses by default, and the 
> > > version of libedit that comes with Mac OS is not built with Unicode 
> > > support. 
> > > 
> > > If you insteall readline (e.g., through Homebrew), then installing the 
> > > "readline-gpl" Racket package will use readline and support Unicode 
> > > input. 
> > > 
> > > At Fri, 14 Sep 2018 01:28:46 -0700 (PDT), Jon Kleiser wrote: 
> > > > If I enter this in the REPL in my macOS Terminal 
> > > > (string->list "hei") 
> > > > then I get '(#\h #\e #\i), as expected, but if I replace "hei" with 
> > > "høy", 
> > > > the input line suddenly looks like this 
> > > > (string->list "h\U+FFC3\U+FFB8y") 
> > > > and what I get back is '(#\h #\y). The letter "ø" has been stripped 
> > > away. 
> > > > The same happens with letters "æ" and "ø", typical Norwegian 
> characters. 
> > > > Is there something I can do to make the macOS Terminal REPL handle 
> these 
> > > > Norwegian characters better? 
> > > > In the DrRacket REPL this strange translation and stripping does not 
> > > happen. 
> > > > 
> > > > -- 
> > > > You received this message because you are subscribed to the Google 
> > > Groups 
> > > > "Racket Users" group. 
> > > > To unsubscribe from this group and stop receiving emails from it, 
> send 
> > > an 
> > > > email to racket-users...@googlegroups.com . 
> > > > For more options, visit https://groups.google.com/d/optout. 
> > > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Racket Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to racket-users...@googlegroups.com . 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Non-ASCII characters stripped from input in macOS Terminal

2018-09-14 Thread Jon Kleiser
If I enter this in the REPL in my macOS Terminal
(string->list "hei")
then I get '(#\h #\e #\i), as expected, but if I replace "hei" with "høy", 
the input line suddenly looks like this
(string->list "h\U+FFC3\U+FFB8y")
and what I get back is '(#\h #\y). The letter "ø" has been stripped away. 
The same happens with letters "æ" and "ø", typical Norwegian characters.
Is there something I can do to make the macOS Terminal REPL handle these 
Norwegian characters better?
In the DrRacket REPL this strange translation and stripping does not happen.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Non-ASCII characters stripped from input in macOS Terminal

2018-09-14 Thread Jon Kleiser
My Terminal "Advanced" tab also says "Unicode (UTF-8)".
When I run the PicoLisp REPL, then I have no translation and stripping, 
"høy" is entered as "høy", it seems.

fredag 14. september 2018 10.55.28 UTC+2 skrev Jens Axel Søgaard følgende:
>
>
> Den fre. 14. sep. 2018 kl. 10.28 skrev Jon Kleiser  >:
>
>> If I enter this in the REPL in my macOS Terminal
>> (string->list "hei")
>> then I get '(#\h #\e #\i), as expected, but if I replace "hei" with 
>> "høy", the input line suddenly looks like this
>> (string->list "h\U+FFC3\U+FFB8y")
>> and what I get back is '(#\h #\y). The letter "ø" has been stripped 
>> away. The same happens with letters "æ" and "ø", typical Norwegian 
>> characters.
>> Is there something I can do to make the macOS Terminal REPL handle these 
>> Norwegian characters better?
>> In the DrRacket REPL this strange translation and stripping does not 
>> happen.
>>
>
> FWIW It is more a terminal problem than a Racket problem.
> If I paste  høy  into the terminal, I see  h\U+FFC3\U+FFB8y.
> My "Text Encoding" in the "Advanced" tab in the settings for terminal says 
> "Unicode (UTF-8)".
>  
> -- 
> Jens Axel Søgaard
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Non-ASCII characters stripped from input in macOS Terminal

2018-09-14 Thread Jon Kleiser
Thanks for the info. However, there must be one detail I'm missing.
I have done "brew install readline", and "raco pkg install readline-gpl", 
and when I now do "raco pkg show", I get this:

Installation-wide:
 PackageChecksum Source
 main-distribution  34484fc4a83e3441...  catalog...tribution
 racket-lib 570306a2bfa6057f...  catalog racket-lib
 [198 auto-installed packages not shown]
User-specific for installation "7.0":
 Package   Checksum   Source
 readline-gpl  2990d5f3a3d43c2d2f...  catalog...eadline-gpl

However, when I do "racket", I still get 
"\U+FFC3\U+FFA6\U+FFC3\U+FFB8\U+FFC3\U+FFA5" when typing "æøå" at the 
prompt. Is there something I should (require ...)?

fredag 14. september 2018 13.54.07 UTC+2 skrev Matthew Flatt følgende:
>
> This is a problem with libedit, which Racket uses by default, and the 
> version of libedit that comes with Mac OS is not built with Unicode 
> support. 
>
> If you insteall readline (e.g., through Homebrew), then installing the 
> "readline-gpl" Racket package will use readline and support Unicode 
> input. 
>
> At Fri, 14 Sep 2018 01:28:46 -0700 (PDT), Jon Kleiser wrote: 
> > If I enter this in the REPL in my macOS Terminal 
> > (string->list "hei") 
> > then I get '(#\h #\e #\i), as expected, but if I replace "hei" with 
> "høy", 
> > the input line suddenly looks like this 
> > (string->list "h\U+FFC3\U+FFB8y") 
> > and what I get back is '(#\h #\y). The letter "ø" has been stripped 
> away. 
> > The same happens with letters "æ" and "ø", typical Norwegian characters. 
> > Is there something I can do to make the macOS Terminal REPL handle these 
> > Norwegian characters better? 
> > In the DrRacket REPL this strange translation and stripping does not 
> happen. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Racket Users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to racket-users...@googlegroups.com . 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.