axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Re: Going mad with pattern matching


From: Martin Rubey
Subject: Re: [Axiom-developer] Re: Going mad with pattern matching
Date: 31 May 2007 14:47:49 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Ralf Hemmecke <address@hidden> writes:

> Sorry Martin, I haven't followed this thread, but when you say "abused", does
> that have something to do with the use of default arguments?
> 
> http://www.aldor.org/docs/HTML/chap6.html#4
> 
>        line(x: Float, m: Float == 1, b: Float == 0) : Float == m*x + b;
>        x: Float := 3.2;
>        print << line(x, 8.0) << newline;       -- 8.0 * x + 0
>        print << line(x) << newline;            -- 1   * x + 0
>        print << line(x, b == 5.0) << newline;  -- 1   * x + 5.0

well, I should have been more careful.  The "optional" arguments as in "draw"
or "guess" I meant are quite in line with Aldor semantics of default arguments
-- from a users perspective.  (Some things do not work.  Try
guessRat(q)([1,q,q^2,q^3,q^4]) for example.  Furthermore, the implementation in
SPAD is not nearly as convenient as in Aldor.) So, "abuse" was far too strong a
word.  I should have said: "==" is not only used for constant assignment (in
SPAD: function definition).  So far I know of two exceptions: rules and
optional (or rather, default) arguments.

Martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]