[racket-users] How do you set the expander of a module to a module in the same file as the module whose expander you want to set

2017-05-17 Thread Vityou
If I have a module called reader, and I want to set its expander with syntax/module-reader to a module in the same file as reader, how would I do so? I have tried submod, but apparently you can only use it in a require/provide statement. -- You received this message because you are

Re: [racket-users] using a created language in the repl

2017-05-17 Thread Vityou
I did reprovide all of the #%... forms from racket, and the repl works with base.rkt, it's when I have a reader that the repl doesn't work. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving

[racket-users] using a created language in the repl

2017-05-17 Thread Vityou
I made a little lambda-calculus language and it works for everything, except when I try to use it in the repl: racket -I lambda-calculus. It acts like it worked, but when I try to type an expression it says that all the variables like #%top-interaction don't exist. I made a pure language and

[racket-users] Re: Checking if two lists contain a word

2017-06-25 Thread Vityou
Try taking a look at the `and` function: https://docs.racket-lang.org/reference/if.html#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._and%29%29 On Sunday, June 25, 2017 at 11:40:08 AM UTC-6, philipp.t...@gmail.com wrote: > Hello its me again, > > I have the task to make a

[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

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

2017-05-24 Thread Vityou
> > ;; - - -  > > > > #lang s-exp "new-lang.rkt” ;; new-lang-client.rkt  > > > ((lambda (x) x) >  (lambda (y) y)) > > > > > > > On May 23, 2017, at 10:03 PM, Vityou <zle...@gmail.com> wrote: > > > On Tuesday, May 23, 2017 at 7:17

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  > > > > &g

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 <zlee...@gmail.com> wrote: > > > > I might be ab

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-27 Thread Vityou
s already. > > > > > On May 25, 2017, at 7:09 PM, Vityou <zlee...@gmail.com> wrote: > > > > 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 > >>

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

2017-05-25 Thread Vityou
)) > (lambda ,(lam-parameters v) ,@(lam-bodies v))) > v)) > ...)])) > > > > > On May 24, 2017, at 3:41 PM, Vityou <zlee...@gmail.com> wrote: > > > > On Wednesday, May 24, 2017 at 12:05:19 PM UTC-6, Vityou wrot

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, a

Re: [racket-users] using a created language in the repl

2017-05-28 Thread Vityou
I think what happens is that when you use the language with the repl it ignores the reader and just looks at the exports from the language (main.rkt). On Thursday, May 25, 2017 at 10:14:58 AM UTC-6, Dmitry Pavlov wrote: > Vityou, > > > > I will give you an example

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

2017-05-28 Thread Vityou
better than that. Parens rock. > > > > On May 28, 2017, at 9:51 PM, Vityou <zlee...@gmail.com> wrote: > > > > 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. Se

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

2017-05-29 Thread Vityou
quote body since it isn't a lambda expression. On Monday, May 29, 2017 at 7:11:31 AM UTC-6, Matthias Felleisen wrote: > This is totally different technology. See > http://www.ccs.neu.edu/racket/pubs/#esop2001-cff > > > > On May 28, 2017, at 11:17 PM, Vityou <zlee...@gmail.c

[racket-users] Increasing speed of a simulation

2017-04-30 Thread Vityou
I am working on an ant colony simulation/game/thing. Right now I'm using 2htdp/universe and 2htdp/image and the racket language. To represent an ant, I made a struct with a position, angle, and carrying-food?. To test the speed of the simulation I made a new ant with a random angle on every

Re: [racket-users] How to delay evaluation of a set! expression

2017-12-21 Thread Vityou
That works ok but if I want to define a class macro like this: (define-syntax (define/method stx) (syntax-parse stx [(_ method-list (name arg ...) body) #'(begin (define (name arg ...) body) (set! method-list (cons `(name ,name) method-list)))])) (define-syntax

[racket-users] How to delay evaluation of a set! expression

2017-12-21 Thread Vityou
I am trying to make a macro that helps with creating class-like closures. #lang racket (require (for-syntax syntax/parse)) (define-syntax (define/method stx) (syntax-parse stx [(_ (name arg ...) body) #'(begin (define (name arg ...) body) (set! method-list (cons

[racket-users] How to handle define forms in a scribble-like language

2018-08-16 Thread Vityou
I'm attempting to make a language similar to scribble. I'm using the `make-at-reader` that scribble provides, and have my module-begin as this: (define-syntax md-module-begin (syntax-parser [(_ (expr1 ...)) #'(#%module-begin (define doc (parse-markdown (string-append (begin expr1) ...)))

Re: [racket-users] How to handle define forms in a scribble-like language

2018-08-16 Thread Vityou
lift them to the module level. > > -Philip > > On Thu, Aug 16, 2018 at 11:58 PM, Vityou > > wrote: > >> I'm attempting to make a language similar to scribble. I'm using the >> `make-at-reader` that scribble provides, and have my module-begin as this: >> >&

Re: [racket-users] How to handle define forms in a scribble-like language

2018-08-18 Thread Vityou
arser > [(_ expr1 ...) >#:with doc (syntax-local-introduce (datum->syntax #f 'doc)) >#'(wrapping-modbeg (define doc "") > expr1 ...)]))) > > (module example (submod ".." lang) > (provide doc) > "Example&quo

Re: [racket-users] How to handle define forms in a scribble-like language

2018-08-17 Thread Vityou
Stupid question, but how would I saving them in a global variable? So far I have this: (define-syntax handle (syntax-parser [(_ b:expr) #`(set! #,(syntax-local-introduce (datum->syntax #f 'doc)) (string-append #,(syntax-local-introduce (datum->syntax #f 'doc)) b))])) (define-syntax

Re: [racket-users] How to handle define forms in a scribble-like language

2018-08-17 Thread Vityou
Thanks for the example. I'm still somewhat new to racket, so I may have to study the example for a while before I understand it. The `make-wrapping-module-begin` that Alexis mentioned seems to do something similar, so I may end up using that due to it's simplicity. -- You received this

[racket-users] Is there a way to enter! a file from the command line?

2018-09-08 Thread Vityou
I'm testing out vscode to see if it is good for writing racket, and I like it so far. It allows you to set a custom run command for a language. Right now, racket's is just set to "racket". This is fine, but I would like it to be similar to DrRacket's interactions window, where it "enter!"s

Re: [racket-users] Is there a way to enter! a file from the command line?

2018-09-08 Thread Vityou
> > You could do > > racket --repl --eval '(enter! "foo.rkt")' > Thanks, I tried --eval, I don't know why I didn't think to add --repl. Also, have you seen:

[racket-users] Reason why char=? accepts only one argument?

2019-11-24 Thread Vityou
Not sure if this is the main reason, but say you are applying char=? to a list of unknown length to see if all elements are equal. It makes sense that a list with 1 element is a list with all elements equal. -- You received this message because you are subscribed to the Google Groups "Racket