Re: [racket-users] on-boarding new racketeers

2019-08-13 Thread Stephen De Gabrielle
I’m travelling so haven’t been able to properly read the discussion :( I do want to add: A) Keep local git repos (backups) on storage you control- this is important as you never know when you will lose access to a data centre (github, gitlab, Amazon, azure, iCloud , Dropbox , etc.) B) I know sim

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

2019-08-13 Thread Matthew Butterick
> On 13 Aug 19, at 7:03 PM, Jonathan Simpson wrote: > > In the following magic code, a new function(called a named query in magic) > tga-image is defined and later used inside the definition of the function > test-scope. The issue is that tga-image is an unbound identifier in > test-scope. If

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

2019-08-13 Thread Jonathan Simpson
The error during the expansion of use-name in the line macro is the same as what I was seeing before I made the format-id change. I'm running Racket 6.11 so perhaps that explains why I wasn't seeing the problem you were without format-id. I really have no idea, but at least it does look like we

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

2019-08-13 Thread Tom Gillespie
It is the same error, but I think it is occurring at a different place. Running raco macro-stepper on name-test.rkt the original error was happening in define-values (because format-id was not used). After making the format-id changes it occurs during the expansion of use-name when expanding the l

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

2019-08-13 Thread Jonathan Simpson
On Tuesday, August 13, 2019 at 10:41:33 PM UTC-4, Jonathan Simpson wrote: > > I changed the lines in named-query from > > [name (datum->syntax stx (string->symbol (syntax->datum #'magic-name))) > to > (format-id stx "~a" (syntax-e #'magic-name)) > > Of course this should be (datum->syntax stx (str

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

2019-08-13 Thread Jonathan Simpson
I changed the lines in named-query from [name (datum->syntax stx (string->symbol (syntax->datum #'magic-name))) to (format-id stx "~a" (syntax-e #'magic-name)) and I still get the same error. I also switched to using format-id where I use the name, with no change either. Am I using this correctl

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

2019-08-13 Thread Tom Gillespie
Without have read this carefully, are you maybe looking for https://docs.racket-lang.org/reference/syntax-util.html#%28def._%28%28lib._racket%2Fsyntax..rkt%29._format-id%29%29? If you just pass string->symbol and then use datum->syntax you will get binding errors. Tom On Tue, Aug 13, 2019 at 7:03

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

2019-08-13 Thread Jonathan Simpson
I have a bug I'm trying to fix in #lang magic( https://github.com/jjsimpso/magic). I'm pretty sure I know what the cause is and I know what I want to do, but I don't know how to do it. The situation is this: In the following magic code, a new function(called a named query in magic) tga-image is

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread 'Wayne Harris' via Racket Users
On Tuesday, August 13, 2019 9:51 PM, Philip McGrath wrote: > The relevant chapter of the reference is "Concurrency and Parallelism" > (https://docs.racket-lang.org/reference/threads.html): > >> All constant-time procedures and operations provided by Racket are >> thread-safe because they are a

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread Philip McGrath
The relevant chapter of the reference is "Concurrency and Parallelism" ( https://docs.racket-lang.org/reference/threads.html): > All constant-time procedures and operations provided by Racket are > thread-safe because they are atomic. For example, set! >

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread 'Wayne Harris' via Racket Users
Thanks! Here's what I did in shared-model.rkt: (define *db* (box #f)) (define (get-in-memory-results) (let ([in-mem (unbox *db*)]) (if in-mem (begin (displayln "database: cache hit") in-mem) (begin (displayln "database: cache miss")

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread Jay McCarthy
I think it is pretty simple. ``` (define (make-periodically-updating-value compute1) (define the-data (box (compute1))) (define the-updater-t (thread (λ () (let loop () (set-box! the-data (compute1)) (sleep interval) (loop) (λ () (unbox the-

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread 'Wayne Harris' via Racket Users
Is there an example somewhere showing how this could be done? My wish is to have one thing (a thread or something) periodically updating data (say every 30 minutes) and all servlets handling http connections reading. It is perfectly fine for me if while something writes the data, everything el

Re: [racket-users] on-boarding new racketeers

2019-08-13 Thread Hadi Moshayedi
Thanks Stephen! On Mon, Aug 12, 2019 at 7:52 AM Stephen De Gabrielle < spdegabrie...@gmail.com> wrote: > 5. Put the location of the scribble source file at the beginning of every > scribble file because it is really hard to find the location of scribble > source; > 'Quick: An Introduction to Rack

Re: [racket-users] Re: on-boarding new racketeers

2019-08-13 Thread Neil Van Dyke
Alexis, I appreciate the recent enthusiasm and efforts. I helped build the current small Racket community (really starting when I moved to it exclusively, after developing portable open source for all the Schemes).  My name is still up there with yours on "https://www.racket-lang.org/team.html

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread George Neuner
On 8/13/2019 2:24 PM, 'Wayne Harris' via Racket Users wrote: With Chrome, I visited localhost:/main a first time and refreshed it. (So I got a cache miss followed by a cache hit.) With Firefox, I did the same and got a cache miss on the first request. I expected a cache hit. $ racket

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread Jay McCarthy
Hi Wayne, Your `in-memory-database` is a parameter. Parameters are thread-specific storage [1]. Every request in the web-server is handled by a different thread, so I think this will not work how you think it should. Jay 1. https://docs.racket-lang.org/reference/parameters.html#%28form._%28%28l

Re: [racket-users] Re: on-boarding new racketeers

2019-08-13 Thread Alexis King
Oh, come on. “Adding labels to repositories” and “adding issue templates” isn’t “increasing lock-in.” There’s no slippery slope here. I think the time and energy Stephen has dedicated to the community should be thanked and appreciated, not discouraged. I’m frustrated by the number of words you s

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread George Neuner
On 8/13/2019 11:47 AM, 'Wayne Harris' via Racket Users wrote: I'd like to save database results in memory because my database only changes between long time intervals.  By building a minimum application, I see my cache-strategy seems to work per servlet: by opening a new browser, the first re

Re: [racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread 'Wayne Harris' via Racket Users
On Tuesday, August 13, 2019 2:17 PM, George Neuner wrote: > On 8/13/2019 11:47 AM, 'Wayne Harris' via Racket Users wrote: > > > I'd like to save database results in memory because my database only > > changes between long time intervals.  By building a minimum > > application, I see my cache-stra

[racket-users] Re: on-boarding new racketeers

2019-08-13 Thread Stephen Foster
+1 Thanks for thinking about this. I'll start moving some of my repos in this direction. On Monday, August 12, 2019 at 7:52:37 AM UTC-7, Stephen De Gabrielle wrote: > > Hi, > > I've been thinking about small things that can be done to lower the > barriers to entry to the racket community, and

Re: [racket-users] Re: on-boarding new racketeers

2019-08-13 Thread Neil Van Dyke
I know this particular one is a minor thing, but they add up, over time... Please consider approaches that are open, rather than owned, and try not to increase lock-in by big-business plays. It's pragmatic to keep using GitHub in limited ways right now, *but* part of that is being judicious a

[racket-users] web-server: how to save database results in memory across all requests?

2019-08-13 Thread 'Wayne Harris' via Racket Users
I'd like to save database results in memory because my database only changes between long time intervals. By building a minimum application, I see my cache-strategy seems to work per servlet: by opening a new browser, the first request yields a cache-miss. Looking through the documentation, I

[racket-users] Fwd: [Racket]MetaPict of the day via /r/Racket

2019-08-13 Thread Stephen De Gabrielle
-- Forwarded message - From: Date: Tue, 13 Aug 2019 at 16:27 Subject: [Racket]MetaPict of the day via /r/Racket To: *MetaPict of the day* https://i.redd.it/5j03z60c06g31.jpg Submitted August 13, 2019 at 08:03AM by sdegabrielle via reddit https://www.reddit.com/r/Racket/comment

Re: [racket-users] Clarify project policy on racket2 syntax

2019-08-13 Thread Kira
понедельник, 12 августа 2019 г., 15:49:45 UTC+3 пользователь Robby Findler написал: > > > As for adopting-new-syntax vs backwards-compatibility, does it help if > I were to tell you that anything new will always be "opt in", in the > sense that existing programs will continue to work completely

Re: [racket-users] Clarify project policy on racket2 syntax

2019-08-13 Thread Kira
I do feel different concerns and not even sure about some of them, so I will try to explain myself if this is in some interest to someone. And perhaps better understand myself in process. 1. I am value my time, I am not so young for learning whole new thing each week. 2. I came to Racket somewhe