On Mon, Mar 01, 2021 at 10:30:51PM +0100, Ralf Hemmecke wrote:
> Hi Waldek,
> 
> I just saw the recent commit about 0 and 1 in types.
> Actually, I have not yet commented to your patch, because I first wanted
> to look up how difficult/reasonable it would be to remove (Zero) and
> (One) altogether.
> 
> You have probably improved type matching by your hack, which is good and
> thanks for that, but what I really wonder is: Why is there a need for
> (Zero) and (One) when we coudld just have 0 and 1?
> 
> Is the reason that (Zero) and (One) count as identifiers and 0 and 1 as
> numbers? AFAIU, in Aldor 0 and 1 count as special identifiers.
> Do you think it would be too naive to just replace (Zero) and (One) in
> all of FriCAS by just 0 and 1?

Short answer is that I do not know.  I think that keeping just 0
and 1 can work, but that would require going trough all compiler
code looking for special cases and adding extra code where needed.
Alternatively, do the change and run a lot of tests to find
places that break down.

At low level 'Zero' and 'One' are Lisp symbols, so evaluating
them works like all other symbols, in particular Boot '["Zero"]'
gives function call which produces correct value.  Plain 0
would need special handling.  That is probably why original
authors introduced this scheme.

Let me add that I plan rather large compiler restructuring
and I hope that problems like this will then go away.  But
I do not want to wait long for fix, people regularly meet
this problem.
-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/20210301220448.GA23426%40math.uni.wroc.pl.

Reply via email to