Re: [racket-users] Can a macro have an affect above/outside its scope?

2016-03-22 Thread Hendrik Boom
On Mon, Mar 21, 2016 at 08:37:57AM -0700, Brian Adkins wrote: > On Monday, March 21, 2016 at 11:19:18 AM UTC-4, Neil Van Dyke wrote: > > I propose that it's time for `#lang racket/base` to have a `define/provide`. > > > > (Out of all the possible combinations of definition forms and other > >

define/provide (Was: [racket-users] Can a macro have an affect above/outside its scope?)

2016-03-21 Thread Neil Van Dyke
Brian Adkins wrote on 03/21/2016 11:37 AM: As I mentioned in my original post, I wasn't suggesting we emulate the Elixir behavior - I was really just curious about macro limitations :) I have hijacked the thread. Pray I do not hijack it further. :) `define/provide` seems a bit long to me.

Re: [racket-users] Can a macro have an affect above/outside its scope?

2016-03-21 Thread Brian Adkins
On Monday, March 21, 2016 at 11:19:18 AM UTC-4, Neil Van Dyke wrote: > I propose that it's time for `#lang racket/base` to have a `define/provide`. > > (Out of all the possible combinations of definition forms and other > things we might often want to do with the defined identifier(s) at the >

Re: [racket-users] Can a macro have an affect above/outside its scope?

2016-03-21 Thread Neil Van Dyke
I propose that it's time for `#lang racket/base` to have a `define/provide`. (Out of all the possible combinations of definition forms and other things we might often want to do with the defined identifier(s) at the same time, the pair of `define` and `provide` together is overwhelmingly the

Re: [racket-users] Can a macro have an affect above/outside its scope?

2016-03-21 Thread Brian Adkins
Sure, or just switch the semantics so p means public. I'm no concerned with the difficulty of public vs. private so much as adding or updating the provide from from a define. On Monday, March 21, 2016 at 10:56:49 AM UTC-4, Sean Kanaley wrote: > What if you define define as define/provide and

Re: [racket-users] Can a macro have an affect above/outside its scope?

2016-03-21 Thread Sam Tobin-Hochstadt
Here's what I would do: - Add `(provide (all-defined-out))` at the top of the file (or in a #lang elixir) - Have `(define ...)` just be the regular racket define. - Have `(definep f e)` work like this: (define f* e) (define-syntax f (make-rename-transformer (syntax-property #'f*

Re: [racket-users] Can a macro have an affect above/outside its scope?

2016-03-21 Thread Sean Kanaley
What if you define define as define/provide and define definep as define? That doesn't answer the question about black magic though. On Mon, Mar 21, 2016 at 10:51 AM, Brian Adkins wrote: > I've been porting my friend's Elixir code to Racket with great success. > When I

[racket-users] Can a macro have an affect above/outside its scope?

2016-03-21 Thread Brian Adkins
I've been porting my friend's Elixir code to Racket with great success. When I asked what the equivalent of (provide my-func) was in Elixir, they mentioned that you can define a private function with defp instead of def. For example: defmodule MyModule do def foo(a) do ... end defp