Arc Forumnew | comments | leaders | submitlogin
2 points by akkartik 4322 days ago | link | parent

Hmm, I thought about it some more, and it seems worth preserving exact because you lose information in going to inexact.

The solution I ended up with was to use your name and Pauan's trick: https://github.com/nex3/arc/commit/4227a4a9b9.

Now instead of

  (coerce (/ 3 2) 'num)
You'd say:

  (real (/ 3 2))
What do you think? Easy to change if you prefer.


1 point by Pauan 4322 days ago | link

Since that's being done in Anarki, I'd rather use $.exact->inexact, rather than relying upon Racket's auto-coercion. My trick is best used in Arc 3.1 which doesn't have (easy) access to Racket.

-----

2 points by akkartik 4322 days ago | link

Ok, done. For some reason I thought your trick was more permissive..

-----

2 points by jsgrahamus 4321 days ago | link

I like the (real (/ 3 2)) format. You easily get both.

-----