« Return to Thread: with issue

with issue

by Ralf Hemmecke :: Rate this Message:

Reply to Author | View in Thread

Hi Peter, hi Stephen

I remember that long time ago I was told that an instance where

   A with B

behaves different from

   with {A; B}

is a bug.

What would you say about the following?

---BEGIN aaa.as
#include "aldor"
A: with == add;
Cat: Category == with;
Cat2: Category == with;
extend IntegerSegment(Z: IntegerType) : with {
        Cat with {Cat2; foo: A -> A};
} == add {foo(a: A): A == a;}
---END aaa.as

Compiling with

   aldor aaa.as

results in

"aaa.as", line 5: extend IntegerSegment(Z: IntegerType) : with {
                   .............................................^
[L5 C46] #1 (Error) Improper form appearing in `with' statement.

Well, of course in that case it is easy to fix the sources, but the
question is whether the above program should be considered a well-formed
Aldor program. Is it?

Ralf

_______________________________________________
Aldor-l mailing list
Aldor-l@...
http://aldor.org/mailman/listinfo/aldor-l_aldor.org

 « Return to Thread: with issue

LightInTheBox - Buy quality products at wholesale price!