Menu

#20 crash first time trying to compile Rep with macro rhs

open
nobody
None
5
2008-01-15
2008-01-15
No

After freshly starting axiom, compiling the following .spad file (attached to preserve indentation):

FOO ==> Foo

)abbrev domain ABC Foo
Foo() : with
fun1 : Integer -> Integer
== add
Rep := Integer
fun1 i == i

)abbrev domain TEST Test
Test() : with
fun2 : Integer -> Integer
== add
Rep := FOO
fun2 i == i

Will abort with a "memory may be damaged" error. Compiling the same file again will succeed without problem. This only happens if the Rep of Test is (1) a macro and (2) a domain. E.g., Using the macro "INT ==> Integer" doesn't work nor does using "Foo" instead of "FOO" as the Rep of Test.

Discussion

  • Anonymous

    Anonymous - 2008-01-15
     
  • Nobody/Anonymous

    Logged In: NO

    This is a problem with:
    (1) postparsing determining at parsing time
    whether a symbol designates a niladic
    domain or not -- and therefore generating
    different ASTs;
    (2) macro substitution happening after postparsing.

    Several proposed fixes:
    (a) upfix postparsing being fooled -- we might just
    as well remove the postparsing kludge
    (b) throw away the old parser.

    -- Gaby

     

Log in to post a comment.

MongoDB Logo MongoDB