<div dir="ltr">That's an awesome trick, Marc. Thanks!<div><br></div><div>But still.. I don't see any difference:</div><div><br></div><div><div>> (define-type context</div><div>  id: a0000000-0000-0000-0000-000000000000</div>

<div>  constructor: macro-make-context</div><div>  macros:                                                                                                                                                                                         </div>

<div>  ;; opaque: WITHOUT OPAQUE</div><div>  unprintable:</div><div>  a)</div><div><br></div><div>(begin</div><div>  (##define-macro (macro-make-context p1) (##list '(let () (##declare (extended-bindings)) ##structure) ''#<type #19 context> p1))</div>

<div>  (##define-macro (make-constant-context p1) (##define-type-construct-constant 'make-constant-context '#<type #19 context> p1))</div><div>  (##define-macro (context? obj) `((let () (##declare (extended-bindings)) ##structure-direct-instance-of?) ,obj ,''##type-1-a0000000-0000-0000-0000-000000000000))</div>

<div>  (##define-macro (context-a obj) (##list '(let () (##declare (extended-bindings)) ##direct-structure-ref) obj 1 ''#<type #19 context> #f))</div><div>  (##define-macro (context-a-set! obj val) (##list '(let () (##declare (extended-bindings)) ##direct-structure-set!) obj val 1 ''#<type #19 context> #f)))</div>

<div><br></div><div>> (define-type context</div><div>  id: a0000000-0000-0000-0000-000000000000</div><div>  constructor: macro-make-context</div><div>  macros:</div><div>  opaque: ;; WITH OPAQUE</div><div>  unprintable:</div>

<div>  a)</div><div><br></div><div>(begin</div><div>  (##define-macro (macro-make-context p1) (##list '(let () (##declare (extended-bindings)) ##structure) ''#<type #20 context> p1))</div><div>  (##define-macro (make-constant-context p1) (##define-type-construct-constant 'make-constant-context '#<type #20 context> p1))</div>

<div>  (##define-macro (context? obj) `((let () (##declare (extended-bindings)) ##structure-direct-instance-of?) ,obj ,''##type-1-a0000000-0000-0000-0000-000000000000))</div><div>  (##define-macro (context-a obj) (##list '(let () (##declare (extended-bindings)) ##direct-structure-ref) obj 1 ''#<type #20 context> #f))</div>

<div>  (##define-macro (context-a-set! obj val) (##list '(let () (##declare (extended-bindings)) ##direct-structure-set!) obj val 1 ''#<type #20 context> #f)))</div></div><div><br></div><div><br></div><div>

There is no difference!</div><div>I noticed that some attributes produce no difference in the output, but will somehow set some internal flag of Gambit. That's the case of :unprintable, which makes a difference when pretty-printing the object but produces no difference in the generated function/macros. If this is the case, what does opaque: actually do?</div>

<div><br></div><div><br></div><div>Thanks a lot!</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><br><br><span style="font-family:verdana,sans-serif">        </span><span style="font-family:verdana,sans-serif"><font size="1">Álvaro Castro-Castilla</font></span><span style="font-family:verdana,sans-serif"><font size="1"><br>

</font></span><span style="font-family:verdana,sans-serif"><font size="1">          D</font></span><span style="font-family:verdana,sans-serif;font-size:x-small">igital Experiences.</span><span style="font-family:verdana,sans-serif;font-size:x-small">   </span><span style="font-family:verdana,sans-serif;font-size:x-small">--   </span><a href="http://blog.fourthbit.com/" style="font-family:verdana,sans-serif;font-size:x-small" target="_blank">visit The Blog</a><br clear="all">



<span style="font-family:verdana,sans-serif"></span><div><span style="font-family:verdana,sans-serif"><font size="1"><br>

</font></span></div><blockquote style="margin:0px 0px 0px 40px;border:medium none;padding:0px"><div><span style="font-family:verdana,sans-serif"><font size="1"><a href="http://fourthbit.com" target="_blank"><img src="https://s3.amazonaws.com/fourthbit-main/logo_inverted.png"></a><br>

<br>

</font></span></div></blockquote></div></div>
<br><br><div class="gmail_quote">On Tue, Apr 15, 2014 at 4:57 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">

<div class="HOEnZb"><div class="h5"><br>
On Apr 15, 2014, at 9:59 AM, Álvaro Castro-Castilla <<a href="mailto:alvaro.castro.castilla@gmail.com">alvaro.castro.castilla@gmail.com</a>> wrote:<br>
<br>
> Hi!<br>
><br>
> I've been figuring out all the attributes available with define-type in Gambit. Testing and thanks to:<br>
><br>
> <a href="https://mercure.iro.umontreal.ca/pipermail/gambit-list/attachments/20090226/af2ee44c/attachment-0001.txt" target="_blank">https://mercure.iro.umontreal.ca/pipermail/gambit-list/attachments/20090226/af2ee44c/attachment-0001.txt</a><br>


> <a href="https://mercure.iro.umontreal.ca/pipermail/gambit-list/2004-December/000043.html" target="_blank">https://mercure.iro.umontreal.ca/pipermail/gambit-list/2004-December/000043.html</a><br>
><br>
> I could understand all but one: opaque. The ways to "learn" how things work with macros producing code is generally the trick (pp (lambda () (macro...)) 'asdf). But what about macros that produce macros? In that case you get an empty form with 'asdf, so no way to know what has been generated.<br>


><br>
> That of course applies to define-type. There is no difference in generated code with opaque: keyword, so I assume that it only affects non-generative types. Can I see the generated code in such case?<br>
><br>
> Reading Gambit's code in nonstd.scm doesn't clarify things either.<br>
><br>
><br>
> Thank you!<br>
><br>
<br>
</div></div>Try:<br>
<br>
(set! ##define-type-expansion-show? #t)<br>
<span class="HOEnZb"><font color="#888888"><br>
Marc<br>
<br>
</font></span></blockquote></div><br></div>