Bill Page wrote:
> 
> On Sat, Oct 22, 2011 at 12:06 PM, Waldek Hebisch wrote:
> > Bill Page wrote:
> >>
> >> On Fri, Oct 21, 2011 at 4:25 PM, Ralf Hemmecke wrote:
> >> > On 10/21/2011 09:17 PM, Waldek Hebisch wrote:
> >> >>
> >> >> I propose to change 'selectfirst' to 'first' and
> >> >> 'selectsecond' to 'second'.
> >> >
> >>
> >> Ok. I would prefer also that it export 'elt' so that one might write
> >> x.1 and x.2 or or x(1) and x(2).
> >>
> >
> > What type elt should have? =A0For x(1) type is "obvious", but
> > for x(i) not so.
> >
> 
> Perhaps it is possible to overload elt as follows:
> 
>   elt: (%,1) -> A
>   elt: (%,2) -> B
> 
> I have seen such use of constants as domains elsewhere in FriCAS such as
> 
> elt: (%,"left") -> %
> elt: (%,"right") -> %
> 
> in aggcat.spad.pamphlet.

Well, "left" is treated as a type and there is special code to
handle this case.  1 and 2 are not treated a types and there is
no support for them.

> >> Conversion from 'List Any' would also be nice
> >>
> >> =A0 [x,y]::Product(A,B)
> >> =A0 [x,y,z]::Product(A,Product(B,C))
> >>
> >> where domainOf(x)=3DA, domainOf(y)=3DB etc. Conversion from 'List A' cou=
> ld
> >> be a special case
> >>
> >> =A0 [x,y]::Product(A,A)
> >> =A0 etc.
> >
> > Again, what type proposed convert should have?
> >
> 
> convert: List Any -> %
> 
> if A is B then
>   convert List A -> %
> 
> Of course convert can result in failure.

That will work for two element lists.  But I do not see how you
this could work for the three-element case.

-- 
                              Waldek Hebisch
[email protected] 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to