oldk1331 wrote:
> "node?(u, v)" should return true only when they point to the
> same data structure, aka when they share part of data structure,
> so it should use 'eq?' instead of '='.
>
> Because this is much more faster and fits well to functional
> programming style.
Well, this is controversial. Theoreticaly aggregate can be
represented in a compressed way and create nodes only on
demand, so that '=' is true, but not 'eq?'. More realistically
user my create a node which should be '=' to some node in
the aggregate and use say search to find position. With 'eq?'
such code would fail.
I am not sure if the two reasons above are important enough
to always use '='. But if we decide to use 'eq?' it would
need some big red scare in documentation. Also, bugs due to
using 'eq?' are likely to be hard to find. In the past
code used '=' and 'eq?' was limited to use as an optimization
(with appropriate care to avoid bugs).
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.