<div dir="ltr"><div><div><div><div>Aha! Thanks for catching this Marc -- I was quite certain there was a real issue here!<br></div><br>The problem comes from generative structs using gensym for their symbol id and quotes are not interned by the (gxc) compiler. This doesn't happen with defstruct at module level, but my srfi/9 implementation emits a gensym without checking if it's in module scope.<br>.<br></div>So what happened here is that gxc (the gerbil compiler) with its new shiny optimizer inlined the struct  operation, but the record definition was a gensym coming from my srfi/9 define-record.<br><br></div>Macro at fault!<br><br></div>-- vyzo<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 10, 2017 at 3:12 PM, Marc Feeley <span dir="ltr"><<a href="mailto:feeley@iro.umontreal.ca" target="_blank">feeley@iro.umontreal.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In your file I see these expressions:<br>
<br>
  (define std/srfi/14#:char-set<br>
    (make-struct-type '#::char-set3224 '#f '1 ':char-set '((fields: s)) '#f))<br>
<br>
  (if (##structure-instance-of? _bcs3729_ '#::char-set3224) ...)<br>
<br>
Note that #::char-set3224 appears multiple times, and it is an *uninterned* symbol.  When the parser reads these uninterned symbols, multiple independent symbols with the same name are created.  So your code is faulty because you will not get the same uninterned symbol (as you probably intended).<br>
<br>
The error message you are getting is due to the Gambit compiler not handling this faulty case well.  I will add a better handling of this (not generating identically named #defines) but still that will not make your code work as intended.<br>
<br>
Marc<br>
<div><div class="h5"><br>
<br>
<br>
> On May 10, 2017, at 6:19 AM, Dimitris Vyzovitis <<a href="mailto:vyzo@hackzen.org">vyzo@hackzen.org</a>> wrote:<br>
><br>
> Bringing this up to the list, because this is an interesting output from gsc and the file attachment feature of github doesn't work.<br>
> So I have this file which is the compiled output of gxc for srfi-14, with some optimizations applied (namely inlining of struct ops in this case).<br>
> This results to gsc generating a bunch of cascading redefinitions, which result in gcc warnings.<br>
><br>
> > gsc 14__0.scm<br>
> 14__0.c:337:0: warning: "___SYM__3a_char_2d_set3224" redefined<br>
>  #define ___SYM__3a_char_2d_set3224 ___SYM(3,___S__3a_char_2d_<wbr>set3224)<br>
>  ^<br>
> 14__0.c:336:0: note: this is the location of the previous definition<br>
>  #define ___SYM__3a_char_2d_set3224 ___SYM(2,___S__3a_char_2d_<wbr>set3224)<br>
>  ^<br>
> 14__0.c:338:0: warning: "___SYM__3a_char_2d_set3224" redefined<br>
>  #define ___SYM__3a_char_2d_set3224 ___SYM(4,___S__3a_char_2d_<wbr>set3224)<br>
>  ^<br>
> 14__0.c:337:0: note: this is the location of the previous definition<br>
>  #define ___SYM__3a_char_2d_set3224 ___SYM(3,___S__3a_char_2d_<wbr>set3224)<br>
>  ^<br>
> 14__0.c:339:0: warning: "___SYM__3a_char_2d_set3224" redefined<br>
>  #define ___SYM__3a_char_2d_set3224 ___SYM(5,___S__3a_char_2d_<wbr>set3224)<br>
>  ^<br>
> 14__0.c:338:0: note: this is the location of the previous definition<br>
>  #define ___SYM__3a_char_2d_set3224 ___SYM(4,___S__3a_char_2d_<wbr>set3224)<br>
>  ^<br>
><br>
> So what's up with that?<br>
><br>
> -- vyzo<br>
</div></div>> <14__0.scm>___________________<wbr>____________________________<br>
> Gambit-list mailing list<br>
> <a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
> <a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" rel="noreferrer" target="_blank">https://webmail.iro.umontreal.<wbr>ca/mailman/listinfo/gambit-<wbr>list</a><br>
<br>
</blockquote></div><br></div>