[racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-10 Thread Jon Zeppieri
On Sun, Nov 10, 2019 at 7:38 PM Jon Zeppieri wrote: > > On Sun, Nov 10, 2019 at 4:45 PM Jon Zeppieri wrote: > > > > On Sun, Nov 10, 2019 at 3:26 PM Jon Zeppieri wrote: > > > = > > > ;; If the tzdata package is installed, put its zoneinfo directory at > > > ;; the head of the search path. >

Re: [racket-users] Syntax pattern to match a sequence with x identical elements?

2019-11-10 Thread Jonathan Simpson
I verified that the pre-release version 7.4.0.902 resolves my issue with ~between. With that fix I was able to complete the macro I was working on. Thanks again for the advice and the quick response by the Racket dev team! -- Jon On Sunday, October 13, 2019 at 10:57:17 AM UTC-4, Jonathan

Re: [racket-users] Using the top level to fix unbound identifier

2019-11-10 Thread Jonathan Simpson
I just wanted to follow up to say that I finally got this working! I finally re-implemented all of my non-hygienic macros with syntax-parse, which resolved the unbound identifiers. Once again, thanks to everyone who offered help and suggestions. -- Jon On Sunday, August 18, 2019 at 8:01:36 PM

Re: [racket-users] Evaluating to get the output with a specific lang

2019-11-10 Thread Jay McCarthy
I feel like I might not understand what you want, but it feels like you just want to use `make-module-evaluator` from `racket/sandbox`: ``` #lang racket/base (require racket/sandbox) (define (read-script s) (((make-module-evaluator s) 'script) 5)) (module+ test (read-script "#lang

[racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-10 Thread Jon Zeppieri
On Sun, Nov 10, 2019 at 4:45 PM Jon Zeppieri wrote: > > On Sun, Nov 10, 2019 at 3:26 PM Jon Zeppieri wrote: > > = > > ;; If the tzdata package is installed, put its zoneinfo directory at > > ;; the head of the search path. > > (define-runtime-path-list tzdata-paths > > (match

Re: [racket-users] Evaluating to get the output with a specific lang

2019-11-10 Thread Christopher Lemmer Webber
Hey Eric! Thanks, I'll try to soak in this a bit tomorrow. :) Eric Griffis writes: > This works: > > 1. mkdir foo; cd foo; raco pkg install > > 2. create foo/main.rkt: > > ``` > #lang racket/base > > (module reader racket/base > (require racket/port) > (provide (rename-out [foo-read read] >

Re: [racket-users] Evaluating to get the output with a specific lang

2019-11-10 Thread Eric Griffis
This works: 1. mkdir foo; cd foo; raco pkg install 2. create foo/main.rkt: ``` #lang racket/base (module reader racket/base (require racket/port) (provide (rename-out [foo-read read] [foo-read-syntax read-syntax])) (define (foo-read port) `(module ,(gensym

Re: [racket-users] Parameters and dynamic-require

2019-11-10 Thread Jay McCarthy
When I run ``` #lang racket/load (module p racket/base (define out (make-parameter 'original-value)) (provide out)) (module a racket/base (require 'p) (displayln (list 'a (out))) (define a 43) (provide a)) (require 'p) (displayln (list 'outer (out))) (out "foo") (displayln

[racket-users] Re: raco distribute and runtime paths, conditioned on whether a package was installed at compile time

2019-11-10 Thread Jon Zeppieri
On Sun, Nov 10, 2019 at 3:26 PM Jon Zeppieri wrote: > = > ;; If the tzdata package is installed, put its zoneinfo directory at > ;; the head of the search path. > (define-runtime-path-list tzdata-paths > (match (find-relevant-directories '(tzdata-zoneinfo-module-path)) > [(cons info-dir

Re: [racket-users] Evaluating to get the output with a specific lang

2019-11-10 Thread Christopher Lemmer Webber
Well, I think I figured out how to get further: with example1.rkt being: ``` #lang racket/base ;; #lang dungeon/misery (define ((make-start-game read-save-file) player-name) (list 'running-this-read-save-file: read-save-file 'on-player-name: player-name 'result:

Re: [racket-users] Re: raco setup equivalent for building standalone executables?

2019-11-10 Thread Martin DeMello
Thanks, that's helpful. I'll probably take the same route as you with a build.rkt; it would be nice to have everything self-contained and not depend on platform-specific shell scripts or another language. martin On Fri, Nov 8, 2019 at 7:06 PM Alex Harsanyi wrote: > > There is no such raco

Re: [racket-users] Evaluating to get the output with a specific lang

2019-11-10 Thread Eric Griffis
On Sun, Nov 10, 2019 at 6:45 AM Christopher Lemmer Webber < cweb...@dustycloud.org> wrote: > > It sounds like what I want is the case of the export. I'll run with this. > I guess a question remaining then is: if I'm doing this kind of dynamic > import of the module, is there a way to require

Re: [racket-users] Modeling a context-sensitive evaluation context with PLT Redex?

2019-11-10 Thread Simon Schlee
I have no experience with Redex (it is one of the things I want to get more familiar with in the future), but I happened to watch this talk: "Finding bugs without running or even looking at code" by Jay Parlar https://www.youtube.com/watch?v=FvNRlE4E9QQ Maybe a tool like this is interesting to

[racket-users] Understanding sandbox.rkt

2019-11-10 Thread Christopher Lemmer Webber
> Jay McCarthy writes: >> Modules don't evaluate to values. They have effects and they have >> exported symbols. If you want to observe the evaluation of your >> language's module, you'll have to look at one of those two things. >> Both are used by existing Racket languages and infrastructure:

Re: [racket-users] Evaluating to get the output with a specific lang

2019-11-10 Thread Christopher Lemmer Webber
Christopher Lemmer Webber writes: > I guess a question remaining then is: if I'm doing this kind of dynamic > import of the module, is there a way to require from it (especially if > it isn't assigned to a "filename" on disk?). It appears there must be; > when I look at `build-program` in

[racket-users] Parameters and dynamic-require

2019-11-10 Thread Jens Axel Søgaard
Hi All, How can I set a parameter used in a dynamically required module? Example: A parameter `out` is defined in a module p. Before requiring (dynamically) module a, we want to set the parameter. The attempt below fails. (module p racket/base (define out (make-parameter 'original-value))

Re: [racket-users] Evaluating to get the output with a specific lang

2019-11-10 Thread Christopher Lemmer Webber
Thanks Jay for the helpful response as usual Jay; I really do appreciate it. It sounds like what I want is the case of the export. I think I can figure out how to modify the #%module-begin to do that. I guess a question remaining then is: if I'm doing this kind of dynamic import of the module,