Arc Forumnew | comments | leaders | submitlogin
3 points by jsgrahamus 2662 days ago | link | parent

I vote for inexact.

2 points by akkartik 2662 days ago | link

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:

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 2661 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 2661 days ago | link

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


2 points by jsgrahamus 2661 days ago | link

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