On 28/10/11 21:10 PM, Jalaluddin Morris wrote:
On 28/10/11 02:19 AM, Ralf Hemmecke wrote:
Waldek,

I like your patch.

On _input_ side there is only one syntax: square brackets.

Sufficient for me at the moment. In fact, I don't know yet whether I like to have all the fancy input things that for example Mathematica offers. That's input sugar anyway, and can probably be added also to FriCAS if there is any need/wish.

Concerning output, I believe that that best is use the same form
as for input.  Round brackets in output come from original code,
but it is easy to change them to square brackets.

Actually, currently I tend to favour square brackets even of round brackets are closer to what one would see in mathematics. Square brackets make it currently easier to cut&paste.

It's not my final word. Future might bring better input output support, but currently, I'm for square brackets.

    a: Pr := [1,x]

Yes, that should work, because the compiler (and also the interpreter get a clear hint of what the target type should be.

Ralf

Isn't a list more free form and potentially heterogeneous than a product?

A list could be an ordered n-tuple of the wide range of types in the Fricas Kingdom plus those constructed by the user, while a product would have each position in the n-tuple (perhaps differently) typed according to specified rules.

So a product would be a sub-type of type list because there would be some specified constraints on the entries at each position.

Do I make sense? Please feel free to trash my submission. :)

Jalaluddin
So I think products and lists are similar and the same type of brackets should be used for both.

One particular product I suggest is of subtype "Markov" where the type of the n+1th entry in the list is a function only of the nth entry and, of course the first entry is in the domain of the function - so perhaps, formally, a product type would be a function which generates strings of types. Fricas would be taught that mathematical: R^2 ; constructive: x \in R, y \in R, [x,y];
and functional:
(define (f list)
    (and (real? (car list))
           (real? (cadr list))
           (empty? (cddr list))))

definitions are equivalent.

Jalaluddin

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