[Aldor-l] LabelSpecies for L: LabelType -> CombinatorialSpecies L

Martin Rubey martin.rubey at univie.ac.at
Mon Oct 23 04:16:55 EDT 2006


Dear all,

> > > is there a way to check whether two constants are identical. I.e., I'd
> > > like to have
> > > foo(A: SomeCat, B: SomeCat): Boolean
> > > return true, if A and B are identical, false otherwise.

> > What about
> > 
> >    (A pretend Pointer) = (B pretend Pointer)

> Thanks, yes, that appears to work. At first, I also thought that this would
> be it, but I was discouraged by
 
> -------------------------------------------------------------------------------
> rubey at aquin:~$ aldor -gloop
>      AA  L      DDDD      OOO    RRRR
>     A A  L      D   D    O   O   R   R
>    A  A  L      D    D  O     O  R   R
>   AAAAA  L      D    D  O     O  RRRR
>  A    A  L      D   D    O   O   R  R
> A     A  LLLLL  DDDD      OOO    R   R
> 
> (c) Numerical Algorithms Group Ltd 1995-2001
> Release: Aldor(C) version 1.0.3 for LINUX(glibc2.3) 
> Type "#int help" for more details.
> %1 >> #include "aldor"
>                                            Comp: 80 msec, Interp: 10 msec
> %2 >> #include "aldorinterp"
>                                            Comp: 40 msec, Interp: 0 msec
> %3 >> import from MachineInteger, Pointer
>                                            Comp: 10 msec, Interp: 0 msec
> %4 >> MachineInteger pretend Pointer
> 0x854b940 @ Pointer
>                                            Comp: 0 msec, Interp: 100 msec
> %5 >> MachineInteger pretend Pointer
> 0x85879c0 @ Pointer
>                                            Comp: 0 msec, Interp: 0 msec
> %6 >> MachineInteger pretend Pointer
> 0x8587d20 @ Pointer
> -------------------------------------------------------------------------------
> 
> In compiled code, it works, though.

Oops, no it does not work. Well, not always.

???

Ah, now I understand. It works in the compiler, since there the literal Integer
is always translated to the same thing. In the interpreter, I get new domains
"Integer" every time I use it...

Thus, saying 

I==Integer

in the interpreter suffices. Hm, I guess this has also consequences for our
parser discussion...

Martin
 




More information about the Aldor-l mailing list