<br><div class="gmail_quote">2011/10/28 Vok Vojwo <span dir="ltr"><<a href="mailto:ceving@gmail.com">ceving@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Is (void) distinct from all other types?<br></blockquote><div><br>It's a unique value yes. (void) => #!void . (eq? (void) #!void) => #t .  (if #f #t) => #!void . (member #!void (list #f 0 "" '() #!unbound (not #!void))) => #f .<br>

<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

Is this a proper way to check if anything is undefined?<br>
<br>
(let ()<br>
  (define a)<br></blockquote><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
  (eq? a (void)))<br></blockquote><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

I think (define a) does not conform to RnRS, because define requires<br>
two arguments. Is there a RnRS conforming way to check if anything is<br>
undefined/unspecified?<br></blockquote><div><br>Don't base your code on checks for if variables are not defined, it reflects bad coding practice (as it doesn't deliver on transition into local scopes and it renders optimizations ineffective), so reconsider what you want to achieve and how. The B.H. module system does not use anything like this afaik, for instance.<br>

<br>You could do (eval varname-symbol) though, exception shows it didn't exist. For more sophisticated introspection of globals, you could check out Gambit's internal structures for this.<br><br>There is a #!unbound value also, that comes into play in some circumstances.<br>

 </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
_______________________________________________<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" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
</blockquote></div><br>