Ralf Hemmecke wrote:
> 
> On 10/08/2017 05:55 AM, Bill Page wrote:
> > "Union(R,"failed")" on the other hand does seem to take about 80%
> > longer to unwrap a value.
> 
> I'm not a compiler expert (and I don't actually like Union(X,"failed")
> so much, but we can have Monad in FriCAS without changing the language.
> We can have Maybe with a global failed().
> We can have Maybe with GENSYM(). Since latter behaves (up to function
> names) exactly as Union(X,"failed"), why wouldn't it make sense to
> specialise the compiler so that Union(X,"failed") uses the
> "Maybe+GENSYM" code that Qian wrote?

Well, there is(or was) code in Spad compiler to handle "easy"
cases of Union-s in simpler, presumbaly more efficient way
(actually using Lisp tags).  But this code was not used
(conditions were set so it was never used).  AFAICS really
simple code gives incorrect semantics, and trying to give
correct semantics with simpler code for some cases means
that we need runtime checks that seem to cost more than
just using current code.

-- 
                              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.

Reply via email to