At Sat, 1 Jul 2017 14:06:04 -0700, Matthew Butterick wrote: > Good idea, but can I introduce a new macro (which naturally needs expansion) > into a fully-expanded module (which does not)?
Yes, you can expand, add non-core forms, and let the result get expanded again. You're right that there's nothing like `#%boolean`. Beware that adjusting all the `if`s in a fully expanded module won't help if the expanded code call calls `filter`, `not`, or any other function from a different module that expects a boolean. That's hitting the limits of how well we know to make different kinds of languages interoperate. At Sat, 1 Jul 2017 14:53:44 -0700, Matthew Butterick wrote: > > > On Jul 1, 2017, at 2:24 PM, Deren Dohoda <deren.doh...@gmail.com> wrote: > > > > If your #lang has Greg's "if" then any module written in that #lang will > > use > that "if". > > IIUC Greg is suggesting something different than the usual shadow-and-export > fandango that a module language ordinarily uses. > > He is suggesting that, because all conditional forms expand into some version > of #%kernel `if` (again IIUC) that we change what values this #%kernel `if` > accepts as true (thereby affecting all higher-level conditional forms) by > operating on the fully expanded syntax object (because that's where the > #%kernel `if` is totally exposed, IIUC #3). > > IOW, #%kernel `if` is the closest thing to a single point of control for all > Boolean behavior. > > Of course you could use shadow-and-export to change all the conditionals > individually — `if` `and` `or` `cond` ... — but this would a drag, and > error-prone anyhow. > > > > So if I understand, your concern is that someone calls a procedure which > > has > some conditional behavior but that procedure, being written in another module > entirely, won't use Greg's "if". That is, your #lang will provide all sorts > of > procedures from racket/base and other modules, and those won't see Greg's > "if". Is that correct? > > Not quite. I just want code written within modules that use my DSL to have a > more expansive notion of falsiness. (What happens in "another module > entirely" > is none of my business. Though, in the same way a module might provide > special-effects flavors of `#%datum` or `#%app` or `#%top`, we could imagine > modules that provide special Boolean behavior) > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.