Arc Forumnew | comments | leaders | submit | kens1's commentslogin
1 point by kens1 6316 days ago | link | parent | on: Getting started question

Try installing and running arc in the same directory as mzscheme. I think there are some assumptions that everything is in the current directory.

-----

2 points by kens1 6316 days ago | link | parent | on: Reading raw string

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.

-----

3 points by kens1 6316 days ago | link | parent | on: what does x!y do

Good explanation. As an aside, the four syntax characters "~ : ! ." are the "special syntax". You can see the effects of these with ssexpand. Also, ~ and : can be combined, and ! and . can be combined, but not the other combinations (e.g. ~ and !).

  arc> (ssexpand '~a:b:~c)
  (compose (complement a) b (complement c))
  arc> (ssexpand 'd.e!f)
  (d e (quote f))
I just noticed that (car (ssexpand '.a)) returns the Scheme eof object. This doesn't seem like a good thing.

-----

4 points by absz 6316 days ago | link

Good point. To be precise (as you noted), () [] ' , and ,@ are taken care of by mzscheme's read, but ~ : . and ! are handled afterwards in ssexpand (or its equivalent in ac.scm).

There are other bugs like those--pretty much any special syntax character on its own or in an incomplete way becomes an EOF.

-----