Re: [racket-users] making a language that can return the body of a function

2017-05-29 Thread Vityou
It turns out that I can just do: (define-syntax (new-lambda stx) (syntax-parse stx [(_ (parameter:id) body:expr) #'(lambda-structure 'parameter body (lambda (parameter) body))])) because my lambda-calculus

Re: [racket-users] making a language that can return the body of a function

2017-05-29 Thread Matthias Felleisen
This is totally different technology. See http://www.ccs.neu.edu/racket/pubs/#esop2001-cff > On May 28, 2017, at 11:17 PM, Vityou wrote: > > I just noticed that the stepper for intermediate student with lambda pretty > much does what I want. I guess I can look into that.

Re: [racket-users] making a language that can return the body of a function

2017-05-28 Thread Vityou
I just noticed that the stepper for intermediate student with lambda pretty much does what I want. I guess I can look into that. On Sunday, May 28, 2017 at 7:55:08 PM UTC-6, Matthias Felleisen wrote: > I misunderstood because of your mismatched parentheses. Without eval, you > can’t do better

Re: [racket-users] making a language that can return the body of a function

2017-05-28 Thread Matthias Felleisen
I misunderstood because of your mismatched parentheses. Without eval, you can’t do better than that. Parens rock. > On May 28, 2017, at 9:51 PM, Vityou wrote: > > On Sunday, May 28, 2017 at 2:01:09 PM UTC-6, Matthias Felleisen wrote: >> You need to apply the function, not

Re: [racket-users] making a language that can return the body of a function

2017-05-28 Thread Vityou
On Sunday, May 28, 2017 at 2:01:09 PM UTC-6, Matthias Felleisen wrote: > You need to apply the function, not just compute the substitution. See > applicable struct in previous message. This should just work out, w/o much > ado. > > > > > On May 28, 2017, at 12:40 AM, Vityou

Re: [racket-users] making a language that can return the body of a function

2017-05-28 Thread Matthias Felleisen
You need to apply the function, not just compute the substitution. See applicable struct in previous message. This should just work out, w/o much ado. > On May 28, 2017, at 12:40 AM, Vityou wrote: > > On Thursday, May 25, 2017 at 5:50:29 PM UTC-6, Matthias Felleisen

Re: [racket-users] making a language that can return the body of a function

2017-05-27 Thread Vityou
On Thursday, May 25, 2017 at 5:50:29 PM UTC-6, Matthias Felleisen wrote: > The client module can refer to all imported #% forms. If you don’t export it > from the language module, it’s not there. [Well, mostly] Implicitly the > client module already refers to #% forms already. > > > > > On

Re: [racket-users] making a language that can return the body of a function

2017-05-25 Thread Matthias Felleisen
The client module can refer to all imported #% forms. If you don’t export it from the language module, it’s not there. [Well, mostly] Implicitly the client module already refers to #% forms already. > On May 25, 2017, at 7:09 PM, Vityou wrote: > > On Wednesday, May 24,

Re: [racket-users] making a language that can return the body of a function

2017-05-25 Thread Vityou
On Wednesday, May 24, 2017 at 2:05:23 PM UTC-6, Matthias Felleisen wrote: > Don’t eval. This is a bit crude but it now your lam-s keep track of your > environment, too. > > #lang racket ;; new-lang.rkt > > (provide > #%app > #%datum > #%top-interaction > (rename-out > (new-lambda

Re: [racket-users] making a language that can return the body of a function

2017-05-24 Thread Matthias Felleisen
Don’t eval. This is a bit crude but it now your lam-s keep track of your environment, too. #lang racket ;; new-lang.rkt (provide #%app #%datum #%top-interaction (rename-out (new-lambda lambda) (new-mb #%module-begin))) (require racket/stxparam) (define-syntax (new-lambda stx)

Re: [racket-users] making a language that can return the body of a function

2017-05-24 Thread Vityou
On Wednesday, May 24, 2017 at 12:05:19 PM UTC-6, Vityou wrote: > On Tuesday, May 23, 2017 at 8:21:59 PM UTC-6, Matthias Felleisen wrote: > > Try to start with this:  > > > > > > > > > > > > #lang racket ;; new-lang.rkt  > > > > > > (provide > >  #%app > >  #%datum > >  #%top-interaction > >

Re: [racket-users] making a language that can return the body of a function

2017-05-24 Thread Vityou
On Tuesday, May 23, 2017 at 8:21:59 PM UTC-6, Matthias Felleisen wrote: > Try to start with this:  > > > > > > #lang racket ;; new-lang.rkt  > > > (provide >  #%app >  #%datum >  #%top-interaction >  (rename-out >   (new-lambda lambda) >   (new-mb     #%module-begin))) > > >

Re: [racket-users] making a language that can return the body of a function

2017-05-23 Thread Matthias Felleisen
Try to start with this: #lang racket ;; new-lang.rkt (provide #%app #%datum #%top-interaction (rename-out (new-lambda lambda) (new-mb #%module-begin))) (define-syntax (new-lambda stx) (syntax-case stx () [(_ (x ...) e ...) #'(lam '(x ...) '(e ...) (lambda (x ...) e

Re: [racket-users] making a language that can return the body of a function

2017-05-23 Thread Vityou
On Tuesday, May 23, 2017 at 7:17:18 PM UTC-6, Matthias Felleisen wrote: > Why do you interpret S-expressions instead of re-mapping lambda and #%app? > > > > > > > On May 23, 2017, at 9:14 PM, Vityou wrote: > > > > I might be able to do something like this, but what I'm

Re: [racket-users] making a language that can return the body of a function

2017-05-23 Thread Vityou
I might be able to do something like this, but what I'm looking for is something that will be able to show the variables available to it in adition to its source. I'll probable have to do something like what you did with the struct accept add a field with its available variables and modify

Re: [racket-users] making a language that can return the body of a function

2017-05-23 Thread Philip McGrath
I think you will probably want to define an applicable struct type with custom printing behavior and then replace Racket's lambda with your own macro to create instances of that struct type. I think what you want may be more complex than this, but here's an example that simply carries along its

[racket-users] making a language that can return the body of a function

2017-05-23 Thread Vityou
In lambda calculus, the function is the only datatype, so it would be useful to see the body of a function when it is returned in some expression in the repl (so you can see what number was returned or some other encoding). I have got this working by making a language where the reader turns