Hi,

Thanks for your clarifications Bill.


Just to say that my original question to Ralf was a much more low level quest 
for clarifications in the user guide:

1) A user reads:

section 5.3 pag 149
"An if-then-else expression always returns a value. If the else clause is missing 
then the entire expression returns the unique value of Void. If both clauses are present, 
the type of the value returned by if is obtained by resolving the types of the values of 
the two clauses. See Section 2.10 on page 109 for more information." (Check also the 
boxed text above this statement.)

2) The user does not really understand the statement and, if he is motivated, 
tries to experiment:

(1) -> if 1>2 then 1   -- here he expects Void
                                                                   Type: Void
(2) -> if 2>1 then 1  -- here he expects Void but gets PositiveInteger

   (2)  1
                                                        Type: PositiveInteger
(3) -> if 2>1 then 1 else [1,2,3] -- here he expects common supertype, but 
which one?

   (3)  1
                                                        Type: PositiveInteger
(4) -> if 1>2 then 1 else [1,2,3] --  here he expects common supertype, which  
one?

   (4)  [1, 2, 3]
                                                  Type: List(PositiveInteger)

3) The user is puzzled because

* in (2) below he gets Type: Positive Integer not Type: Void
* in (3) and (4) below he sees 2 different types and not a "common supertype"



From your explanations now I understand that there are a lot of hidden coercitions in the game and 
that what is said in the user guide does not contradict the experiments. But I feel it would be 
helpful to have some clarifying information in the user guide not after page 149. Writing "the 
unique value of Void" is not of help because what is not evident is the fact that "every 
value can be coerced to Void". I realize now that this is said at pag 763, sec 9.87 (in my 
version of FricasUG), but at least a footnote in page 149 would have helped.

ric

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

Reply via email to