
@hlgr has joined the channel

Hi folks! I just joined and am wondering: this channel does look like a friendly discussion/ideas/support place. Are all (racket-related) things on the table?

@hanna.barabakh has joined the channel

Specifically, I am wondering about best-practices to generating transformers: say, I have a list of symbols and want to define a transformer for each (simplest case, I want to define-syntax
for each of '(thing1 thing2 thing3)
as #'5
)

I (think I) have run into two problems: first, I cannot introduce transformers in the global scope from inside a loop and second, I cannot refer to the iterator value from within the define-syntax
form

I am just learning all of this so I might be inaccurately describing it (bear with me, please :slightly_smiling_face:)

Here’s how I would do it:
#lang racket
(define-syntax-rule (define-transformer name)
(define-syntax (name stx) #'5))
(define-syntax-rule (define-transformers names ...)
(begin (define-transformer names) ...))
(define-transformers thing1 thing2 thing3)
thing1

hah, I had a vague feeling it would go in this direction — thanks a lot

Hi. How are you? I have the following question. I am working with web-server and send/suspend/dispatch. A case came up where I need to use continuations. So inside lambda make-response I use call/cc and save it. But when I call the saved continuation it fails. continuation application: attempt to cross a continuation barrier. Can I get the barrier out? According to what I saw in the code of send/suspend/dispatch
(let ([thunk
(call-with-current-continuation
(lambda (k0)
...
(let/ec k1
(call-with-continuation-prompt
(lambda () ...)))
Is it OK what I want to do or do I have to change my approach? It says to use a continue inside send/suspend/dispatch, Which approach should I use? Capture the current prompt? Don’t use continuations. On the other hand I can’t use send/suspend/dispatch inside another send/suspend/dispatch, It’s a conceptual doubt, I hope I understood. Thanks for your time.

Using your own prompt is one option

But maybe you can explain why you need to use continuations between responses?

I have several common procedures for console and web. I want to be able to re-compute them from continuations. Independent of web or console. I will try to simplify the code to add an example. In the case of creating my own prompt, how would be the correct way to do it?

It really depends on what you’re trying to do. If what you want is to capture a continuation in one request and then use it again in a different request, I don’t think that will work. If you just want to use continuations inside a single request, then just putting a prompt around the whole request should be enough.

I am capturing the continuation inside a common procedure, but that is not exclusive to web-server, but it is applied in the request and then used in another request. In the console app it works, but not in the web. I understand that the first case you describe is happening. I’m going to have to change my approach in order to reuse my procedures. So I could not capture inside a request and be able to reuse it in another one. Is that so?

I don’t think you can do that, but it’s possible that if you delimit the continuation with a prompt that it will work

The prompt is there so that you don’t capture part of the web server machinery

I understand. It was a conceptual doubt. It is the first time that I am working with continuations and I wanted to understand how it works in webserver. I will try to capture with a prompt so that it does not capture part of the request. Thanks for clearing my doubts!!

Very similar to the mplusi in minikanren. So it is interleave (or appendi).

I’ve just made the repo to support a slack-archive site public: https://github.com/benknoble/racket-slack-archive You can find the archive at https://benknoble.github.io/racket-slack-archive/
There’s a lot of work to do to improve it; anyone with jekyll or slack data experience is especially welcome!

It looks like clicking on the “general” link fetches a lot of data.

Sorry, that was the wrong first response. First thought: this is awesome!

Thanks so much for doing this.

Yeah, the “pages” are, well, long… I’d be open to breaking them down by year or month or day, but I don’t have the knowledge to do that just yet

@kyp0717 has joined the channel

Hi. I am new to racket. Wanted to ask if I could use 2 DSLs in my code?

That is could I do something like this … #lang reposte
#lang net/http-client

you can’t use two language at the same time. And it looks like net/http-client is a library

It’s up to 73% — taking twice as long as expected, because something went wrong with using two Docker instances concurrently, so I disabled that (and I’ll investigate later).

As all #langs typically have their own parser, and using more than one concrete syntax convention per file could prove to be very complex, you can’t use more than one #lang at once
To use the functionality of both, I’d recommend using the base racket language and (require …) ing utility functions from both #langs