Arc Forumnew | comments | leaders | submitlogin
2 points by tc-rucho 5574 days ago | link | parent

  Regarding the last part:
  What we are talking about here is:
  num => float
  int => int
Of course an integer is a number, but number here means what float does everywhere else.

Having 'isa report 2 as 'num, would only screw up things. In any case, this is what 'or is meant to be used for. (or (isa intg 'int) (isa intg 'num))



1 point by palsecam 5573 days ago | link

> Having 'isa report 2 as 'num, would only screw up things.

OK, I too can consider this point of view, that's why I asked what people here think about this proposal. Thanks for giving your opinion tc-rucho!

> (or (isa intg 'int) (isa intg 'num))

Yep true, this makes it easy to check.

But yes, as rntz pointed it out, don't forget num is not just only float here. We are not in C ;-)

   arc> (type 3+2i)   ; (Mz)Scheme/Arc also handle complex numbers natively
   num
Although this doesn't invalidate your point, it's just a question of terminology.

-----

2 points by rntz 5574 days ago | link

'num is not float; rationals are also 'nums.

  arc> (/ 2 3)
  2/3
  arc> (type 2/3)
  num

-----