Arc Forumnew | comments | leaders | submitlogin
2 points by kens1 6316 days ago | link | parent

Readline is reading what is immediately after the (readline):

  arc> (readline)hello world!
  "hello world!\r"
I'm not sure if that's a bug or a feature :-) For the behavior you want, you could try:

  (def myreadline () (let x (readline) (if (is x "\r") (readline) x)))


2 points by yurez 6316 days ago | link

Looks like your version eats empty lines :)

  arc> (repeat 3 (myreadline))
  1
  2
  
  3
  nil
  arc>
Anyway, I think the problem is with readline checking for #\newline char, instead of some magic-os-dependent-line-separator.

-----