Arc Forumnew | comments | leaders | submitlogin
1 point by akkartik 2432 days ago | link | parent

Thanks, I ended up going with the third option, but with a twist: display prints inexact but write prints exact. So at the prompt you still see exact numbers:

  arc> (/ 3 2)
  arc> (prn "aa: " (/ 3 2))
  aa: 1.5

1 point by Pauan 2432 days ago | link

Well, the whole reason I did it in Arc/Nu was because I liked to use the REPL as a calculator, and I hated having it print rationals. So, having the REPL print rationals kinda defeats the point in my eyes, but I don't care since I don't use Anarki.


2 points by akkartik 2432 days ago | link

Yeah, I don't actually want to see rationals at the prompt. It's just that lisp has this nice distinction between 'write and 'print, with the guarantee that 'read can handle anything 'write emits. I'm loath to have write+read change a value in subtle ways.

In this case, that the repl uses 'write is an unfortunate constraint. Still thinking..


2 points by akkartik 2431 days ago | link

Update: I just realized my print solution sucks:

  arc> (prn (/ 3 2))
  arc> (prn (list (/ 3 2)))
Rolling it back. Let's just explicitly use real for now.