Redefining alien types on SBCL



If I do this in slime-repl:

(define-alien-type nil (struct foo (str c-string)))

(define-alien-type nil
(struct foo
(a int)
(b (array (* (struct foo)) 100))))

(with-alien ((f (struct foo)))
(slot (deref (slot f 'b) 7) 'a))



and I got the error:

There is no slot named B in #<SB-ALIEN-INTERNALS:ALIEN-RECORD-TYPE
(STRUCT FOO

(STR

C-STRING))>.

This is an inconvenience because I'd like to experiment in the repl.
How can avoid this error?

Note: the same thing happens when redefining generic methods.

.



Relevant Pages

  • Re: struct enumerating types
    ... typedef int bool; ... conversion argument for a pointer to an unsigned char, ... }; struct foo foo_obj; ...
    (comp.lang.c)
  • Re: Initializing compound type containing opaque type
    ... A workaround would be to rearrange the members of `struct foo' as ... which again provokes a missing initializer warning but is accepted. ... Though that'd initialize all members to 0, ...
    (comp.lang.c)
  • Re: Constructor equivalent
    ... int main ... // by the transmit ISR immediately ... // in transmit fifo. ...
    (comp.lang.c)
  • Re: [ubuntu-hardened] Re: Collecting NX information
    ... > trampoline at all is just a bypass of the non-exec stack... ... > I think mixing all these into one big flag is a mistake. ... struct foo *newfoo{ ... int long; ...
    (Linux-Kernel)
  • Re: copy constructors and printf
    ... > call to va_arg in the function body. ... The presence of copy-ctor is enough to make a UDT non-POD, ... int main ... `struct foo' through `...'; ...
    (comp.lang.cpp)