[M3devel] Strange behavior in recent CM3-compiled code...

Jay jay.krell at cornell.edu
Tue Jun 16 11:16:39 CEST 2009


I haven't figured it out, but:


Here is the code for the Fmt.Bool:

 

.L6:

 ; assume the parameter to Fmt.Bool is TRUE, by
 ; storing 1 in the parameter place


        movq    $1, 16(%rsp)

 

 ; do a bunch of stuff, no need to understand..


        movq    32(%rsp), %rax
        testq   %rax, %rax
        je      .L7
        movq    32(%rsp), %rax
        testb   $1, %al
        jne     .L8
        movq    32(%rsp), %rax
        movq    312+MM_Main(%rip), %rdx
        movq    -8(%rax), %rax
        salq    $43, %rax
        shrq    $44, %rax

 

 ; at this point, between $rdx and $rax, one is
 ; typecode of the object, one is the typecode of the type
 ; they compare equal


        cmpq    %rdx, %rax

 

  ; This is not taken.


        jne     .L9

 

  ; This is taken.


        jmp     .L7


.L8:
  ; This does not run.
        movq    312+MM_Main(%rip), %rax
        cmpq    $3, %rax
        je      .L7
.L9:

 ; Had the expression resolved to FALSE, this would be
 ; where FALSE is passed to Fmt.Bool
        movq    $0, 16(%rsp)
.L7:
        movq    16(%rsp), %rdi
        call    Fmt__Bool at PLT


 

And here is the code for the IF:


.L11:

 ; just gloss over this part..


        movq    40(%rsp), %rax
        testq   %rax, %rax
        je      .L12
        movq    40(%rsp), %rax
        testb   $1, %al
        jne     .L13
        movq    40(%rsp), %rax
        movq    312+MM_Main(%rip), %rdx
        movq    -8(%rax), %rax
        salq    $43, %rax
        shrq    $44, %rax

 

 ; again at this point, we have the typecodes, and they compare equal

 

        cmpq    %rdx, %rax

 

 ; This is not taken.


        jne     .L14


.L13:

 

 ; At this point things have gone wrong.
 ; The Fmt.Bool path did not compare the typecode to 3.
 ; after the jne, there should have been a jmp to I guess .L12.

 

        movq    312+MM_Main(%rip), %rax
        cmpq    $3, %rax
        jne     .L14


.L12:
        .stabn  68,0,19,.LM9-.LFBB2
.LM9:
        leaq    128+L_1(%rip), %rdi
        call    Main__PutLn at PLT
        jmp     .L15
        .p2align 4,,10
        .p2align 3
.L14:
        .stabn  68,0,21,.LM10-.LFBB2
.LM10:
        leaq    168+L_1(%rip), %rdi
        call    Main__PutLn at PLT


 

Thanks for the small test case!


 - Jay


 


From: jay.krell at cornell.edu
To: mika at async.caltech.edu
Date: Tue, 16 Jun 2009 08:50:02 +0000
CC: m3devel at elegosoft.com
Subject: Re: [M3devel] Strange behavior in recent CM3-compiled code...



Well, the number 3 is REFANY_typecode.
I need to compare the if code to the printing code though..
 
 - Jay
 


From: jay.krell at cornell.edu
To: mika at async.caltech.edu
CC: m3devel at elegosoft.com
Subject: RE: [M3devel] Strange behavior in recent CM3-compiled code...
Date: Tue, 16 Jun 2009 08:44:21 +0000



Cool.
Here is a smaller repro, on birch AMD64_LINUX.
 
The problem is not the AND, the problem is the IF.
 

MODULE Main;
IMPORT IO, Fmt;
PROCEDURE PutLn(what : TEXT) =
BEGIN IO.Put(what & "\n") END PutLn;

TYPE
Pair = REF RECORD
rest : REFANY;
END;
VAR
t := NEW(Pair, rest := NEW(Pair, rest := NIL));
BEGIN
PutLn("ISTYPE(t.rest,Pair)? " & Fmt.Bool(ISTYPE(t.rest,Pair)));
IF ISTYPE(t.rest,Pair) THEN
PutLn("in IF clause...")
ELSE
PutLn("in ELSE clause...")
END
END Main.

Tony this is presumably your type tagging changes??

The problem in the code I think is the compare to the number 3.

.L13:
        movq    312+MM_Main(%rip), %rax
        cmpq    $3, %rax            <====
        jne     .L14
.L12:
        .stabn  68,0,19,.LM9-.LFBB2
.LM9:
        leaq    128+L_1(%rip), %rdi
        call    Main__PutLn at PLT
        jmp     .L15
        .p2align 4,,10
        .p2align 3
.L14:
        .stabn  68,0,21,.LM10-.LFBB2
.LM10:
        leaq    168+L_1(%rip), %rdi
        call    Main__PutLn at PLT
 

What is that for?
 

It comes right from the IL:

(118) set_source_line
  source line   17
(119) import_procedure
  procedure RTHooks__CheckLoadTracedRef nparams 0x1 rettype 0xd
(120) declare_param
  param M3_Af40ku_ref type 0xb typeid 0x1c1c45e6 bytesize 0x40 alignment 0x40 in
_memory 0x0 up_level 0x0
  mode 0x11 (DImode)
(121) set_runtime_proc
(122) load
  m3cg_load (MM_Main): offset 0x640, convert 0xb -> 0xb
(123) store
  store (noname) offset 0x0 src_t 0xb dst_t 0xb
(124) load_nil
(125) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(126) if_eq
(127) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(128) loophole
(129) load_integer
  integer 0x1
(130) and
(131) if_true
(132) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(133) load_indirect
  load address offset 0xffffffffffffffc0 src_t 0x7 dst_t 0x7
(134) extract_mn
(135) if_false
(136) start_call_direct
  start call procedure RTHooks__CheckLoadTracedRef, level 0x0, type 0xd
(137) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(138) pop_param
  pop param type 0xb
(139) call_direct
  call procedure RTHooks__CheckLoadTracedRef, type 0xd
(140) set_label
(141) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(142) load_indirect
  load address offset 0x0 src_t 0xb dst_t 0xb
(143) store
  store (noname) offset 0x0 src_t 0xb dst_t 0xb
(144) load_nil
(145) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(146) if_eq
(147) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(148) loophole
(149) load_integer
  integer 0x1
(150) and
(151) if_true
(152) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(153) load_indirect
  load address offset 0xffffffffffffffc0 src_t 0x7 dst_t 0x7
(154) extract_mn
(155) if_false
(156) start_call_direct
  start call procedure RTHooks__CheckLoadTracedRef, level 0x0, type 0xd
(157) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(158) pop_param
  pop param type 0xb
(159) call_direct
  call procedure RTHooks__CheckLoadTracedRef, type 0xd
(160) set_label
(161) load_integer
  integer 0x1
(162) declare_temp
  temp var type 0x7 size 0x40 alignment 0x40
(163) store
  store (noname) offset 0x0 src_t 0x7 dst_t 0x7
(164) load_nil
(165) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(166) if_eq
(167) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(168) loophole
(169) load_integer
  integer 0x1
(170) and
(171) if_true
(172) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(173) load_indirect
  load address offset 0xffffffffffffffc0 src_t 0x7 dst_t 0x7
(174) extract_mn
(175) load
  m3cg_load (MM_Main): offset 0x9c0, convert 0x7 -> 0x7
(176) if_eq
(177) jump
(178) set_label
(179) load_integer
  integer 0x3
(180) load
  m3cg_load (MM_Main): offset 0x9c0, convert 0x7 -> 0x7
(181) if_eq
(182) set_label
(183) load_integer
  integer 0x0
(184) store
  store (noname) offset 0x0 src_t 0x7 dst_t 0x7
(185) set_label
(186) import_procedure
  procedure Fmt__Bool nparams 0x1 rettype 0xb
(187) declare_param
  param M3_AicXUJ_b type 0x0 typeid 0x1e59237d bytesize 0x8 alignment 0x8 in_mem
ory 0x0 up_level 0x0
  mode 0xe ()
(188) start_call_direct
  start call procedure Fmt__Bool, level 0x0, type 0xb
(189) load
  m3cg_load (noname): offset 0x0, convert 0x7 -> 0x7
(190) pop_param
  pop param type 0x0
(191) call_direct
  call procedure Fmt__Bool, type 0xb
(192) store
  store (noname) offset 0x0 src_t 0xb dst_t 0xb
(193) start_call_direct
  start call procedure RTHooks__Concat, level 0x0, type 0xb
(194) load_address
  load address (L_1) offset 0x280
(195) pop_param
  pop param type 0xb
(196) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(197) pop_param
  pop param type 0xb
(198) call_direct
  call procedure RTHooks__Concat, type 0xb
(199) store
  store (noname) offset 0x0 src_t 0xb dst_t 0xb
(200) start_call_direct
  start call procedure Main__PutLn, level 0x0, type 0xd
(201) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(202) pop_param
  pop param type 0xb
(203) call_direct
  call procedure Main__PutLn, type 0xd
(204) set_source_line
  source line   18
(205) load
  m3cg_load (MM_Main): offset 0x640, convert 0xb -> 0xb
(206) store
  store (noname) offset 0x0 src_t 0xb dst_t 0xb
(207) load_nil
(208) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(209) if_eq
(210) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(211) loophole
(212) load_integer
  integer 0x1
(213) and
(214) if_true
(215) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(216) load_indirect
  load address offset 0xffffffffffffffc0 src_t 0x7 dst_t 0x7
(217) extract_mn
(218) if_false
(219) start_call_direct
  start call procedure RTHooks__CheckLoadTracedRef, level 0x0, type 0xd
(220) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(221) pop_param
  pop param type 0xb
(222) call_direct
  call procedure RTHooks__CheckLoadTracedRef, type 0xd
(223) set_label
(224) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(225) load_indirect
  load address offset 0x0 src_t 0xb dst_t 0xb
(226) store
  store (noname) offset 0x0 src_t 0xb dst_t 0xb
(227) load_nil
(228) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(229) if_eq
(230) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(231) loophole
(232) load_integer
  integer 0x1
(233) and
(234) if_true
(235) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(236) load_indirect
  load address offset 0xffffffffffffffc0 src_t 0x7 dst_t 0x7
(237) extract_mn
(238) if_false
(239) start_call_direct
  start call procedure RTHooks__CheckLoadTracedRef, level 0x0, type 0xd
(240) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(241) pop_param
  pop param type 0xb
(242) call_direct
  call procedure RTHooks__CheckLoadTracedRef, type 0xd
(243) set_label
(244) load_nil
(245) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(246) if_eq
(247) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(248) loophole
(249) load_integer
  integer 0x1
(250) and
(251) if_true
(252) load
  m3cg_load (noname): offset 0x0, convert 0xb -> 0xb
(253) load_indirect
  load address offset 0xffffffffffffffc0 src_t 0x7 dst_t 0x7
(254) extract_mn
(255) load
  m3cg_load (MM_Main): offset 0x9c0, convert 0x7 -> 0x7
(256) if_ne
(257) set_label
(258) load_integer
  integer 0x3               <===== 
(259) load
  m3cg_load (MM_Main): offset 0x9c0, convert 0x7 -> 0x7
(260) if_ne
(261) set_label
(262) set_source_line
  source line   19
(263) start_call_direct
  start call procedure Main__PutLn, level 0x0, type 0xd
(264) load_address
  load address (L_1) offset 0x400
(265) pop_param
  pop param type 0xb
(266) call_direct
  call procedure Main__PutLn, type 0xd
(267) jump
(268) set_label
(269) set_source_line
  source line   21
(270) start_call_direct
  start call procedure Main__PutLn, level 0x0, type 0xd
(271) load_address
  load address (L_1) offset 0x540
(272) pop_param
  pop param type 0xb
(273) call_direct
  call procedure Main__PutLn, type 0xd
(274) set_label
(275) set_label
(276) load_address
  load address (MM_Main) offset 0x0
(277) exit_proc
(278) free_temp
(279) free_temp
(280) free_temp
(281) free_temp
(282) free_temp
(283) end_procedure
  procedure Main_M3
(284) comment
  comment: `global constant type descriptor'
(285) declare_record
  record id 0xffffffff, fields 0x0, size 0x940
(286) comment
  comment: `global data type descriptor'
 
 
I'll dig a bit more.
 

 - Jay






 
> To: jay.krell at cornell.edu
> Date: Tue, 16 Jun 2009 00:59:10 -0700
> From: mika at async.caltech.edu
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] Strange behavior in recent CM3-compiled code...
> 
> This small example exhibits it!
> 
> MODULE Main;
> IMPORT IO, Fmt;
> 
> PROCEDURE PutLn(what : TEXT) =
> BEGIN IO.Put(what & "\n") END PutLn;
> 
> 
> TYPE 
> Pair = BRANDED "Pair" REF RECORD
> first, rest : REFANY;
> END;
> 
> PROCEDURE Rest(p : Pair) : REFANY = 
> BEGIN
> IF p = NIL THEN RETURN NIL ELSE RETURN p.rest END
> END Rest;
> 
> VAR 
> t := NEW(Pair, first := "first", 
> rest := NEW(Pair, first := "second", 
> rest := NIL));
> 
> BEGIN
> PutLn("t.rest # NIL? " & Fmt.Bool(t.rest#NIL));
> PutLn("ISTYPE(t.rest,Pair)? " & Fmt.Bool(ISTYPE(t.rest,Pair)));
> PutLn("Rest(t.rest) = NIL? " & Fmt.Bool(Rest(t.rest)=NIL));
> PutLn("conjunction? " & Fmt.Bool(
> (t.rest # NIL) AND (ISTYPE(t.rest,Pair)) AND (Rest(t.rest) = NIL) ));
> IF (t.rest # NIL) AND (ISTYPE(t.rest,Pair)) AND (Rest(t.rest) = NIL) THEN
> PutLn("in IF clause...")
> ELSE
> PutLn("in ELSE clause...")
> END
> END Main.
> 
> Output:
> 
> (133)rover:~/testcm3/src>m3build -O
> --- building in ../FreeBSD4 ---
> m3build: missing ../src/m3overrides
> new source -> compiling ../src/Main.m3
> -> linking prog
> (134)rover:~/testcm3/src>../FreeBSD4/prog
> t.rest # NIL? TRUE
> ISTYPE(t.rest,Pair)? TRUE
> Rest(t.rest) = NIL? TRUE
> conjunction? TRUE
> in IF clause...
> (135)rover:~/testcm3/src>cm3 -clean
> --- cleaning ../FreeBSD4 ---
> 
> (136)rover:~/testcm3/src>cm3
> --- building in ../FreeBSD4 ---
> 
> new source -> compiling Main.m3
> -> linking prog
> (137)rover:~/testcm3/src>../FreeBSD4/prog 
> t.rest # NIL? TRUE
> ISTYPE(t.rest,Pair)? TRUE
> Rest(t.rest) = NIL? TRUE
> conjunction? FALSE
> in ELSE clause...
> (138)rover:~/testcm3/src>
> 
> Jay writes:
> >--_55f6c801-7d57-4602-a131-dda139b64dfd_
> >Content-Type: text/plain; charset="iso-8859-1"
> >Content-Transfer-Encoding: quoted-printable
> >
> >
> >Kneejerk generic response:
> >
> >=20
> >
> >I don't know the operator precedence. Can you put in parens?
> >
> >Have you looked at the code?
> >
> >Can you mail us a small self contained repro?
> >
> >Can you test it on birch?
> >
> > (That way -- all your files are there and easily gotten/investigated by o=
> >thers.)
> >
> >Optimization enabled? Works without? I know=2C I shouldn't even ask this so=
> >rt of thing without evidence.
> >
> >=20
> >
> > - Jay
> >=20
> >> To: m3devel at elegosoft.com
> >> Date: Tue=2C 16 Jun 2009 00:01:18 -0700
> >> From: mika at async.caltech.edu
> >> CC: mika at camembert.async.caltech.edu
> >> Subject: [M3devel] Strange behavior in recent CM3-compiled code...
> >>=20
> >>=20
> >> Hello everyone=2C
> >>=20
> >> I'm trying to update to the latest CM3 again=2C so that I can get my
> >> Mac working=2C and push my project of migrating a largish codebase
> >> from PM3 to CM3 a little further.
> >>=20
> >> I updated CM3 today from CVS=2C on both my Mac and on a FreeBSD system=2C
> >> and ... my Scheme interpreter broke. Here's what the code looks like=2C
> >> with annotations:
> >>=20
> >> 49 Debug.Out("t.rest =3D NIL? " & Fmt.Bool(t.rest=3DNIL))=3B
> >> 50 Debug.Out("ISTYPE(t.rest=2CT)? " & Fmt.Bool(ISTYPE(t.rest=2CT)))=3B
> >> 51 Debug.Out("Rest(t.rest) =3D NIL? " & Fmt.Bool(Rest(t.rest)=3DNIL))=3B
> >> 52
> >> 53 IF t.rest # NIL AND ISTYPE(t.rest=2CT) AND Rest(t.rest) =3D NIL THEN
> >> 54 Debug.Out("in IF clause...")=3B
> >> 55
> >> 56 IF SymEq(t.first=2C "quote") THEN special :=3D "'"
> >> 57 ELSIF SymEq(t.first=2C "quasiquote") THEN special :=3D "`"
> >> 58 ELSIF SymEq(t.first=2C "unquote") THEN special :=3D "=2C"
> >> 59 ELSIF SymEq(t.first=2C "unquote-splicing") THEN special :=3D "=2C@"
> >> 60 END
> >> 61 ELSE
> >> 62 Debug.Out("in ELSE clause...")
> >> 63 END=3B
> >>=20
> >> all you need to know is that Debug.Out prints out debugging information
> >> to the terminal. What I see is...
> >>=20
> >> t.rest =3D NIL? FALSE
> >> ISTYPE(t.rest=2CT)? TRUE
> >> Rest(t.rest) =3D NIL? TRUE
> >> in ELSE clause...
> >>=20
> >> What gives!?
> >>=20
> >> Note this behavior occurs on both the Mac and on FreeBSD4 with a
> > compiler and runtime bootstrapped today from some previous CM3.
> >> My old CM3 compiler was timestamped... April 30=2C I believe=2C and the
> >> code behaved properly under that one.
> >>=20
> >> I believe I have also tried it both with and without compiler
> >> optimizations.
> >>=20
> >> I find it baffling that so much stuff (mentor!) can work if "AND" isn't
> >> working right. This is the only if statement in many=2C many source files
> >> that seems to be working wrong.
> >>=20
> >> Is it possible I'm missing something?? No I don't think so... here's a mo=
> >re
> >> explicit version:
> >>=20
> >> Debug.Out("t.rest # NIL? " & Fmt.Bool(t.rest#NIL))=3B
> >> Debug.Out("ISTYPE(t.rest=2CT)? " & Fmt.Bool(ISTYPE(t.rest=2CT)))=3B
> >> Debug.Out("Rest(t.rest) =3D NIL? " & Fmt.Bool(Rest(t.rest)=3DNIL))=3B
> >> Debug.Out("conjunction? " & Fmt.Bool(
> >> t.rest # NIL AND ISTYPE(t.rest=2CT) AND Rest(t.rest) =3D NIL ))=3B
> >> IF t.rest # NIL AND ISTYPE(t.rest=2CT) AND Rest(t.rest) =3D NIL THEN
> >> ...
> >>=20
> >> output is:
> >>=20
> >> t.rest # NIL? TRUE
> >> ISTYPE(t.rest=2CT)? TRUE
> >> Rest(t.rest) =3D NIL? TRUE
> >> conjunction? FALSE
> >> in ELSE clause...
> >>=20
> >> TRUE AND TRUE AND TRUE is FALSE??
> >>=20
> >> Note that:=20
> >>=20
> >> VAR q=2C w=2C e :=3D TRUE=3B
> >>=20
> >> Debug.Out("conjunction? " & Fmt.Bool(
> >> q AND w AND e))=3B
> >>=20
> >> results in TRUE (as it should).
> >>=20
> >>=20
> >> Mika
> >>=20
> >
> >--_55f6c801-7d57-4602-a131-dda139b64dfd_
> >Content-Type: text/html; charset="iso-8859-1"
> >Content-Transfer-Encoding: quoted-printable
> >
> ><html>
> ><head>
> ><style>
> >.hmmessage P
> >{
> >margin:0px=3B
> >padding:0px
> >}
> >body.hmmessage
> >{
> >font-size: 10pt=3B
> >font-family:Verdana
> >}
> ></style>
> ></head>
> ><body class=3D'hmmessage'>
> >Kneejerk generic response:<BR>
> >&nbsp=3B<BR>
> >I don't know the operator precedence. Can you put in parens?<BR>
> >Have you looked at the code?<BR>
> >Can you mail us a small self contained repro?<BR>
> >Can you test it on birch?<BR>
> >&nbsp=3B (That way -- all your files are there and easily gotten/investigat=
> >ed by others.)<BR>
> >Optimization enabled? Works without? I know=2C I shouldn't even ask this so=
> >rt of thing without evidence.<BR>
> >&nbsp=3B<BR>
> >&nbsp=3B- Jay<BR>&nbsp=3B<BR>&gt=3B To: m3devel at elegosoft.com<BR>&gt=3B Dat=
> >e: Tue=2C 16 Jun 2009 00:01:18 -0700<BR>&gt=3B From: mika at async.caltech.edu=
> ><BR>&gt=3B CC: mika at camembert.async.caltech.edu<BR>&gt=3B Subject: [M3devel=
> >] Strange behavior in recent CM3-compiled code...<BR>&gt=3B <BR>&gt=3B <BR>=
> >&gt=3B Hello everyone=2C<BR>&gt=3B <BR>&gt=3B I'm trying to update to the l=
> >atest CM3 again=2C so that I can get my<BR>&gt=3B Mac working=2C and push m=
> >y project of migrating a largish codebase<BR>&gt=3B from PM3 to CM3 a littl=
> >e further.<BR>&gt=3B <BR>&gt=3B I updated CM3 today from CVS=2C on both my =
> >Mac and on a FreeBSD system=2C<BR>&gt=3B and ... my Scheme interpreter brok=
> >e. Here's what the code looks like=2C<BR>&gt=3B with annotations:<BR>&gt=3B=
> > <BR>&gt=3B 49 Debug.Out("t.rest =3D NIL? " &amp=3B Fmt.Bool(t.rest=3DNIL))=
> >=3B<BR>&gt=3B 50 Debug.Out("ISTYPE(t.rest=2CT)? " &amp=3B Fmt.Bool(ISTYPE(t=
> >.rest=2CT)))=3B<BR>&gt=3B 51 Debug.Out("Rest(t.rest) =3D NIL? " &amp=3B Fmt=
> >.Bool(Rest(t.rest)=3DNIL))=3B<BR>&gt=3B 52<BR>&gt=3B 53 IF t.rest # NIL AND=
> > ISTYPE(t.rest=2CT) AND Rest(t.rest) =3D NIL THEN<BR>&gt=3B 54 Debug.Out("i=
> >n IF clause...")=3B<BR>&gt=3B 55<BR>&gt=3B 56 IF SymEq(t.first=2C "quote") =
> >THEN special :=3D "'"<BR>&gt=3B 57 ELSIF SymEq(t.first=2C "quasiquote") THE=
> >N special :=3D "`"<BR>&gt=3B 58 ELSIF SymEq(t.first=2C "unquote") THEN spec=
> >ial :=3D "=2C"<BR>&gt=3B 59 ELSIF SymEq(t.first=2C "unquote-splicing") THEN=
> > special :=3D "=2C@"<BR>&gt=3B 60 END<BR>&gt=3B 61 ELSE<BR>&gt=3B 62 Debug.=
> >Out("in ELSE clause...")<BR>&gt=3B 63 END=3B<BR>&gt=3B <BR>&gt=3B all you n=
> >eed to know is that Debug.Out prints out debugging information<BR>&gt=3B to=
> > the terminal. What I see is...<BR>&gt=3B <BR>&gt=3B t.rest =3D NIL? FALSE<=
> >BR>&gt=3B ISTYPE(t.rest=2CT)? TRUE<BR>&gt=3B Rest(t.rest) =3D NIL? TRUE<BR>=
> >&gt=3B in ELSE clause...<BR>&gt=3B <BR>&gt=3B What gives!?<BR>&gt=3B <BR>&g=
> >t=3B Note this behavior occurs on both the Mac and on FreeBSD4 with a<BR>&g=
> >t=3B compiler and runtime bootstrapped today from some previous CM3.<BR>&gt=
> >=3B My old CM3 compiler was timestamped... April 30=2C I believe=2C and the=
> ><BR>&gt=3B code behaved properly under that one.<BR>&gt=3B <BR>&gt=3B I bel=
> >ieve I have also tried it both with and without compiler<BR>&gt=3B optimiza=
> >tions.<BR>&gt=3B <BR>&gt=3B I find it baffling that so much stuff (mentor!)=
> > can work if "AND" isn't<BR>&gt=3B working right. This is the only if state=
> >ment in many=2C many source files<BR>&gt=3B that seems to be working wrong.=
> ><BR>&gt=3B <BR>&gt=3B Is it possible I'm missing something?? No I don't thi=
> >nk so... here's a more<BR>&gt=3B explicit version:<BR>&gt=3B <BR>&gt=3B Deb=
> >ug.Out("t.rest # NIL? " &amp=3B Fmt.Bool(t.rest#NIL))=3B<BR>&gt=3B Debug.Ou=
> >t("ISTYPE(t.rest=2CT)? " &amp=3B Fmt.Bool(ISTYPE(t.rest=2CT)))=3B<BR>&gt=3B=
> > Debug.Out("Rest(t.rest) =3D NIL? " &amp=3B Fmt.Bool(Rest(t.rest)=3DNIL))=
> >=3B<BR>&gt=3B Debug.Out("conjunction? " &amp=3B Fmt.Bool(<BR>&gt=3B t.rest =
> ># NIL AND ISTYPE(t.rest=2CT) AND Rest(t.rest) =3D NIL ))=3B<BR>&gt=3B IF t.=
> >rest # NIL AND ISTYPE(t.rest=2CT) AND Rest(t.rest) =3D NIL THEN<BR>&gt=3B .=
> >..<BR>&gt=3B <BR>&gt=3B output is:<BR>&gt=3B <BR>&gt=3B t.rest # NIL? TRUE<=
> >BR>&gt=3B ISTYPE(t.rest=2CT)? TRUE<BR>&gt=3B Rest(t.rest) =3D NIL? TRUE<BR>=
> >&gt=3B conjunction? FALSE<BR>&gt=3B in ELSE clause...<BR>&gt=3B <BR>&gt=3B =
> >TRUE AND TRUE AND TRUE is FALSE??<BR>&gt=3B <BR>&gt=3B Note that: <BR>&gt=
> >=3B <BR>&gt=3B VAR q=2C w=2C e :=3D TRUE=3B<BR>&gt=3B <BR>&gt=3B Debug.Out(=
> >"conjunction? " &amp=3B Fmt.Bool(<BR>&gt=3B q AND w AND e))=3B<BR>&gt=3B <B=
> >R>&gt=3B results in TRUE (as it should).<BR>&gt=3B <BR>&gt=3B <BR>&gt=3B Mi=
> >ka<BR>&gt=3B <BR></body>
> ></html>=
> >
> >--_55f6c801-7d57-4602-a131-dda139b64dfd_--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20090616/d774d9b4/attachment-0002.html>


More information about the M3devel mailing list