On Wed, Nov 19, 2008 at 12:31 PM, Ralf Hemmecke wrote:
> ...
> But it shows that 'is'/'has' might lead to lots of branches and thus
> the code doesn't scale very well.
>
> But look at
>
> mygcd(R: EuclideanDomain)(a: R, b: R): R == {
> R has Field => if zero? a and zero? b then 0 else 1;
> while not zero? b repeat { (a, b) := (b, a rem b) }
> return a;
> }
>
> That I consider a case where 'has' is useful.
>
I agree. I am not arguing against such usage. It seems to me that when
'has' refers to a category this tells us a lot about the user's
intentions (i.e. it is good documentation) and because categories are
(usually) rather large things, it is unlikely that we will see a lot
of branching code.
'is' however is something else. It invites the programmer to deal with
specific cases rather than the most general case.
> ...
Regards,
Bill Page.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---