Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#39 Domain cannot be derived from Union.

None
open
None
5
2014-05-16
2014-05-12
No

When I try to derive a domain from Union as follows:

Bug() : with
    stringify : % -> String
  == Union(Integer, Float, List(%)) add
    ...

... compiler gets confused. However this works well:

)abbrev domain BUG Bug
Bug() : with
    stringify : % -> String
  == add
    Rep := Union(Integer, Float, List(%))

I could use the latter but I'd like the domain to behave as an union with extra methods attached - i.e. I'd expect default construction / coercion rules for unions to be applied to this domain.

1 Attachments

Discussion

  • Bill Page
    Bill Page
    2014-05-12

    Yes! I would like to click +1 for this bug, and similar use of other builtin domains.

     
  • I only spotted those two, are there any others? Could you provide a list?

     
  • Bill Page
    Bill Page
    2014-05-12

    Mapping

    but this also raises the question about which operations should be exported by builtin types. See http://axiom-wiki.newsynthesis.org/SandBoxMorphism

     
  • Ok. While we'd like to keep Mapping a first class citizen, I'm having some doubts about it.

    Functions are usually a stateless "objects" unless you grabbed a closure. What'd be the semantics of delivering a domain from Mapping? What are your expectations?

     
    Last edit: Krystian Bacławski 2014-05-16