On 1/30/19 2:36 AM, oldk1331 wrote:
> Yes, this is a bug introduced during my cleanup of Factored domain.

Thanks for fixing it so quickly.

> Now to think about it, if we really want to avoid extra allocation,
> a better approach is to use local variable:
> 
>     __one := [1, empty()]
>     1 == __one

Honestly, it would surprise me if that works. In fact, I believe in
Aldor that would even lead to a subtle bug. The Aldor compiler reorders
== and := assignments. == assignments always come first. Maybe Peter
Broadbery can say more about it.

Have you checked whether in FriCAS

    1 == [1, empty()]

i.e., the current situation, really leads to allocation of a new record
each time 1 is used?

In fact, it keeps confusing me.

In Aldor, if write something like

  foo: % == [1, empty()]
  bar(): % == [1, empty()]

then in the use of bar() I would expect a new allocation every time
bar() is used. But not so for foo. In Aldor bar is a function but foo is
a constant (no function call).

I were happy it that would be the same in FriCAS, but 1 in FriCAS is
ONE() and not really a constant. :-(

Ralf

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/6f685bc3-12ac-1b79-792c-3f8c3f051a18%40hemmecke.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to