>> In fact, is it really clear that FriCAS accesses tmp0 from outside the
>> function? If I'm not wrong, in Aldor you would have to declare
> 
> I think it is common practice to use "free variable" because we
> have lexical scope.
> 
>>   free tmp0;
>>
>> inside subtractIfCan.

Oh, I'm not against free variables at the moment (i.e. if there is no
conflict with parallel execution (for example a parallel for loop).

My reference to Aldor only was, because there was a subtle problem.
Maybe your version also works fine if it were Aldor, because you first
read the value tmp0. However, if you have first something like

  tmp0 := ...

inside the function, then it is not clear whether the compiler is
supposed to assign to the variable in the outer scope or whether the
programmer wants the compiler to create a new local variable.
BTW, how is this problem dealt with in SPAD?

Ralf

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