Bill Page wrote: > > The following simple patch > > https://github.com/billpage/fricas/commit/dad89022088a2a9c410344d10b1cda06773a61f9.patch > > adds value constructor functions to tagged Unions in order to support > Unions where the same type appears more than once. I noticed that the > current hyperdoc documentation for Union already states that one > purpose of tags is to "disambiguate" branches that have the same type > but the current implementation does not support it. > > Arguably one could also implement this using the 'setelt!' analogous > to the idiom implemented in Record but the following use-case > > (7) -> z:Union(f1 : Void, f2 : Void) > Type: Void > (8) -> z:=f2(void()) > > (8) "()" > Type: Union(f1: Void,f2: Void,...) > (9) -> z case f2 > > (9) true > Type: Boolean
That works. However: (4) -> f2(void())$Union(f1 : Void, f2 : Void) The function f2 is not implemented in Union(f1: Void,f2: Void) . (4) -> f2(void()) There are no library operations named f2 Use HyperDoc Browse or issue )what op f2 to learn if there is any operation containing " f2 " in its name. Cannot find a definition or applicable library operation named f2 with argument type(s) Void Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. so more is needed to have consistent support for such feature. -- 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 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.