On Mon, Sep 18, 2017 at 6:04 PM, Ralf Hemmecke <r...@hemmecke.org> wrote: >> Since data in Lisp is already tagged, we can always prevent >> unnecessary memory allocation, for Integer, we can use NIL >> to indicate failure, > > Really? The (lisp) integer 0 and NIL are distinguishable? > Does that work for all implementations of lisp? I would bet that this is > an implementation detail of the specific lisp fork (sbcl, ccl, gcl, etc.)
NIL is a symbol, it's always different from integer 0 in Common Lisp. > There's only one big BUT. I don't like so much to make the FriCAS > algebra dependent on LISP details. IF this is done, then it must be done > in a very restricted area of the code. In general the Algebra code > should have zero knowledge about whether it runs on top of C, Lisp, or Java. > > Ralf First we can always have Rep := Union("failed", R) as default implementation (which is generic), and second, I believe for other target languages, there are similar tricks. For Lisp, since it's already a dynamic language and has tagged data type, we should take advantage of that and should not tag data again (by Union("failed" ...)). -- 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 fricas-devel+unsubscr...@googlegroups.com. To post to this group, send email to fricas-devel@googlegroups.com. Visit this group at https://groups.google.com/group/fricas-devel. For more options, visit https://groups.google.com/d/optout.