Union with equal types

3 views
Skip to first unread message

Ralf Hemmecke

unread,
May 2, 2023, 5:13:24 PM5/2/23
to fricas-devel
Suppose I have a union

U ==> Union(elem: T, oppo :T)

with the meaning that oppo represents a concept of "opposite".

According to page 145 of the aldor user guide

==============
-- This import causes both union branches to be ‘Integer’.
import from MyType(Integer, Integer);
fun [coef == 7];
fun [expon == 7];
==============

I would be able to create an element that lives in the elem or oppo side
of the union U.

How can I do that in SPAD?

Ralf

Waldek Hebisch

unread,
May 2, 2023, 8:11:54 PM5/2/23
to fricas...@googlegroups.com
AFAIK ATM there is no way. The attached patch tries to add Aldor way
to SPad compiler.

--
Waldek Hebisch
compiler.diff
Reply all
Reply to author
Forward
0 new messages