# Questions & Answers

**URL:** https://racket.discourse.group/c/questions/6.md?page=28

[Latest](https://racket.discourse.group/latest.md) · [Categories](https://racket.discourse.group/categories.md) · [Tags](https://racket.discourse.group/tags.md)

**Page:** 29

---

## [Factor out parts of syntax templates](https://racket.discourse.group/t/factor-out-parts-of-syntax-templates/800)

<div class="topic-metadata">

**Author:** [@scolobb](https://racket.discourse.group/u/scolobb)\
**Replies:** 11\
**Last updated:** [May 31, 2022, 1:33pm UTC](https://racket.discourse.group/t/factor-out-parts-of-syntax-templates/800 "2022-05-31T13:33:11Z")

</div>

Hi, I have a couple macros which produce very similar syntaxes, with some changes. I would like to factor out parts of those templates to reduce code duplication. Essentially, I would like to do something like this: (…

---

## [Current-read-interaction returning eof](https://racket.discourse.group/t/current-read-interaction-returning-eof/1032)

<div class="topic-metadata">

**Author:** [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Replies:** 3\
**Last updated:** [May 30, 2022, 1:49am UTC](https://racket.discourse.group/t/current-read-interaction-returning-eof/1032 "2022-05-30T01:49:32Z")

</div>

current-read-interaction is documented as: (current-read-interaction) → (any/c input-port? -\> any) (current-read-interaction proc) → void? proc : (any/c input-port? -\> any) A parameter that determines the current re…

---

## [Is it possible to use channels as input/output ports?](https://racket.discourse.group/t/is-it-possible-to-use-channels-as-input-output-ports/1038)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 12\
**Last updated:** [May 29, 2022, 4:31am UTC](https://racket.discourse.group/t/is-it-possible-to-use-channels-as-input-output-ports/1038 "2022-05-29T04:31:42Z")

</div>

I've been playing around with the idea of having channels that can be used like ports -- for example, (print ch) would become (channel-put ch) and (read ch) would become (channel-get ch). I thought I might be able to ge…

---

## ["Getting It" (or, Making It "Click")](https://racket.discourse.group/t/getting-it-or-making-it-click/1024)

<div class="topic-metadata">

**Author:** [@bsilver](https://racket.discourse.group/u/bsilver)\
**Replies:** 6\
**Last updated:** [May 28, 2022, 11:01pm UTC](https://racket.discourse.group/t/getting-it-or-making-it-click/1024 "2022-05-28T23:01:44Z")

</div>

Does anyone know of a document/blog entry/etc. that compares programming in Racket to programming in a language like Go? I'm still trying to get the hang of how to think of the structure of applications in Racket and it'…

---

## [Events and concurrency](https://racket.discourse.group/t/events-and-concurrency/1021)

<div class="topic-metadata">

**Author:** [@edoput](https://racket.discourse.group/u/edoput)\
**Replies:** 4\
**Last updated:** [May 25, 2022, 5:50pm UTC](https://racket.discourse.group/t/events-and-concurrency/1021 "2022-05-25T17:50:32Z")

</div>

When looking at the events reference page I saw that there are a number of procedures that are very similar. While the difference between wrap-evt and handle-evt is understandable and I can see the use cases for both I'm…

---

## [Local scribble HTML versus package installation from github](https://racket.discourse.group/t/local-scribble-html-versus-package-installation-from-github/998)

<div class="topic-metadata">

**Author:** [@joskoot](https://racket.discourse.group/u/joskoot)\
**Replies:** 8\
**Last updated:** [May 23, 2022, 3:55pm UTC](https://racket.discourse.group/t/local-scribble-html-versus-package-installation-from-github/998 "2022-05-23T15:55:03Z")

</div>

Hi I have a directory without subdirectories. It contains a.scrbl and a.rkt. a.scrbl has: @(defmodule "a.rkt" #:packages ()) @hyperlink\["a.rkt"\]{source-code} I open a.scrbl in DrRacket and click scribble HTML. Works f…

---

## [Generator functions?](https://racket.discourse.group/t/generator-functions/1020)

<div class="topic-metadata">

**Author:** [@jkleiser](https://racket.discourse.group/u/jkleiser)\
**Replies:** 2\
**Last updated:** [May 23, 2022, 8:51pm UTC](https://racket.discourse.group/t/generator-functions/1020 "2022-05-23T20:51:41Z")

</div>

In JavaScript one may create Generator functions by using the function\* syntax, as described here: Iterators and generators - JavaScript | MDN Is it possible to do the same in Racket? What I would like to obtain is, ba…

---

## [How to document functions that aren't defined (yet) but will be by a user?](https://racket.discourse.group/t/how-to-document-functions-that-arent-defined-yet-but-will-be-by-a-user/1017)

<div class="topic-metadata">

**Author:** [@soegaard](https://racket.discourse.group/u/soegaard)\
**Replies:** 4\
**Last updated:** [May 22, 2022, 7:24pm UTC](https://racket.discourse.group/t/how-to-document-functions-that-arent-defined-yet-but-will-be-by-a-user/1017 "2022-05-22T19:24:33Z")

</div>

This image shows a problem I have in the documentation for Scribble in the overview section. The blue links are correct, they link to the documentation entries for mouse-x, mouse-y etc. The problem is the black non-…

---

## [Terminology in documentation](https://racket.discourse.group/t/terminology-in-documentation/1015)

<div class="topic-metadata">

**Author:** [@tyonkman](https://racket.discourse.group/u/tyonkman)\
**Replies:** 1\
**Last updated:** [May 21, 2022, 3:07am UTC](https://racket.discourse.group/t/terminology-in-documentation/1015 "2022-05-21T03:07:39Z")

</div>

The term "CVT" is used in section 3.14 of the reference manual. I cannot find what it means. Using the documentation search tools does not help. Thanks,

---

## [Scribble: What is the right way to document a structure property?](https://racket.discourse.group/t/scribble-what-is-the-right-way-to-document-a-structure-property/1016)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 2\
**Last updated:** [May 21, 2022, 2:49am UTC](https://racket.discourse.group/t/scribble-what-is-the-right-way-to-document-a-structure-property/1016 "2022-05-21T02:49:04Z")

</div>

I'm writing Scribble to document a struct type with an attached property and I'm unsure how to do it. Something like this: (define-values (prop:foo foo-prop? foo-ref) (make-struct-type-property 'foo 'can-impersonate)…

---

## [Problems generating pdf/latex from scribble](https://racket.discourse.group/t/problems-generating-pdf-latex-from-scribble/1010)

<div class="topic-metadata">

**Author:** [@cyberglot](https://racket.discourse.group/u/cyberglot)\
**Replies:** 4\
**Last updated:** [May 20, 2022, 9:32pm UTC](https://racket.discourse.group/t/problems-generating-pdf-latex-from-scribble/1010 "2022-05-20T21:32:47Z")

</div>

I'm trying to get started using scribble to replace regular latex in my toolchain. However, I'm having a hard time generating both pdf and latex. I believe the error in both instances is related to the same error about \\…

---

## [Macro generating definitional macro](https://racket.discourse.group/t/macro-generating-definitional-macro/1004)

<div class="topic-metadata">

**Author:** [@rockn](https://racket.discourse.group/u/rockn)\
**Replies:** 4\
**Last updated:** [May 20, 2022, 10:24am UTC](https://racket.discourse.group/t/macro-generating-definitional-macro/1004 "2022-05-20T10:24:45Z")

</div>

Hi, (define-syntax-rule (define-define-macro m id) (define-syntax-rule (m) (define id (lambda (x) x)))) (define-define-macro m1 id1) (m1) (id1 2) Why is id1 unbound while (define-syntax-rule (m2 id) (define …

---

## [Racket implementations?](https://racket.discourse.group/t/racket-implementations/999)

<div class="topic-metadata">

**Author:** [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Replies:** 2\
**Last updated:** [May 16, 2022, 3:59pm UTC](https://racket.discourse.group/t/racket-implementations/999 "2022-05-16T15:59:22Z")

</div>

Someone on Discord or Slack chat recently mentioned there are now four implementations of Racket. Racket :racket: - with both Chez and BC variants RacketScript :racketscript: - Racket to Javascript compiler Pycket i…

---

## [Language implementation design decisions and trade offs](https://racket.discourse.group/t/language-implementation-design-decisions-and-trade-offs/989)

<div class="topic-metadata">

**Author:** [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Replies:** 11\
**Last updated:** [May 14, 2022, 2:02pm UTC](https://racket.discourse.group/t/language-implementation-design-decisions-and-trade-offs/989 "2022-05-14T14:02:41Z")

</div>

Hi @lexi\_lambda wrote an interesting comment on language implementation trade-off’s: I recently learnt in chat(discord); roughly the racket compiler produces safer executables at the cost of a little (runtime)speed. …

---

## [Debugging memory leaks](https://racket.discourse.group/t/debugging-memory-leaks/982)

<div class="topic-metadata">

**Author:** [@williewillus](https://racket.discourse.group/u/williewillus)\
**Replies:** 4\
**Last updated:** [May 14, 2022, 9:28am UTC](https://racket.discourse.group/t/debugging-memory-leaks/982 "2022-05-14T09:28:05Z")

</div>

Hi all. I run R16, a Discord bot that allows users to evaluate snippets of code using racket/sandbox. However, I see issues with memory usage building up over time while the bot is running. The bot has essentially no sta…

---

## [How to best implement something like "defer"' in Go?](https://racket.discourse.group/t/how-to-best-implement-something-like-defer-in-go/723)

<div class="topic-metadata">

**Author:** [@slaymaker1907](https://racket.discourse.group/u/slaymaker1907)\
**Replies:** 15\
**Last updated:** [May 10, 2022, 9:41pm UTC](https://racket.discourse.group/t/how-to-best-implement-something-like-defer-in-go/723 "2022-05-10T21:41:04Z")

</div>

I was wondering if anyone had any ideas for how to elegantly implement something like defer in Racket which executes either at the end of the current scope and/or the end of the current function? Obviously, this isn't t…

---

## [Speed benefits of submodules?](https://racket.discourse.group/t/speed-benefits-of-submodules/986)

<div class="topic-metadata">

**Author:** [@joeld](https://racket.discourse.group/u/joeld)\
**Replies:** 3\
**Last updated:** [May 9, 2022, 3:12pm UTC](https://racket.discourse.group/t/speed-benefits-of-submodules/986 "2022-05-09T15:12:24Z")

</div>

Suppose I have two Racket files/modules: ;; one.rkt #lang racket (provide a b) (define foo 'simple-value) (define bar (make-bytes 100000 65)) ;; two.rkt #lang racket (module small racket (provide foo) (define f…

---

## [Markdown to Scribble converter](https://racket.discourse.group/t/markdown-to-scribble-converter/917)

<div class="topic-metadata">

**Author:** [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Replies:** 12\
**Last updated:** [May 8, 2022, 9:06pm UTC](https://racket.discourse.group/t/markdown-to-scribble-converter/917 "2022-05-08T21:06:23Z")

</div>

In my opinion, it's often reasonable to start with some documentation in Markdown to get things going, but convert the documentation to Scribble later so it can be included in the Racket or package documentation to look …

---

## [Impersonate syntax transformer: cursed or not?](https://racket.discourse.group/t/impersonate-syntax-transformer-cursed-or-not/971)

<div class="topic-metadata">

**Author:** [@sorawee](https://racket.discourse.group/u/sorawee)\
**Replies:** 12\
**Last updated:** [May 8, 2022, 7:46pm UTC](https://racket.discourse.group/t/impersonate-syntax-transformer-cursed-or-not/971 "2022-05-08T19:46:09Z")

</div>

Problem: I want to create a "smart constructor" for struct (e.g., supporting default values for some fields) without losing the ability to use struct-copy, struct\* in match. In general, I don't want to lose the struct-in…

---

## [Minimal-racket is very slow before installing compiler-lib](https://racket.discourse.group/t/minimal-racket-is-very-slow-before-installing-compiler-lib/967)

<div class="topic-metadata">

**Author:** [@mk12](https://racket.discourse.group/u/mk12)\
**Replies:** 20\
**Last updated:** [May 7, 2022, 11:47pm UTC](https://racket.discourse.group/t/minimal-racket-is-very-slow-before-installing-compiler-lib/967 "2022-05-07T23:47:01Z")

</div>

When I install minimal-racket 8.5 on macOS Monterey on my M1 MacBook Pro, launching the racket REPL takes 15 seconds between printing "Welcome to Racket v8.5 \[cs\]." to displaying the prompt "\>". After raco pkg install co…

---

## [Why can this program not find its own macro call site?](https://racket.discourse.group/t/why-can-this-program-not-find-its-own-macro-call-site/976)

<div class="topic-metadata">

**Author:** [@slg](https://racket.discourse.group/u/slg)\
**Replies:** 1\
**Last updated:** [May 7, 2022, 2:41am UTC](https://racket.discourse.group/t/why-can-this-program-not-find-its-own-macro-call-site/976 "2022-05-07T02:41:51Z")

</div>

EDIT: After reviewing the docs, it seems that syntax-position is one-based with respect to the code read from the file. Not sure why the syntax-position in the macro definition appears to be zero-based. Also: edited this…

---

## [What would it take to write an independent Racket interpreter?](https://racket.discourse.group/t/what-would-it-take-to-write-an-independent-racket-interpreter/951)

<div class="topic-metadata">

**Author:** [@MichaelBurge](https://racket.discourse.group/u/MichaelBurge)\
**Replies:** 9\
**Last updated:** [May 5, 2022, 1:28pm UTC](https://racket.discourse.group/t/what-would-it-take-to-write-an-independent-racket-interpreter/951 "2022-05-05T13:28:37Z")

</div>

Hello all, I was curious what it would take to "reimplement Racket". As a Scheme derivative, it has a small core language\[1\], but this includes only the language and no standard library. I found a nice folder\[2\] of tabl…

---

## [Should failures of "assert" use \`~e\` to control printout length?](https://racket.discourse.group/t/should-failures-of-assert-use-e-to-control-printout-length/958)

<div class="topic-metadata">

**Author:** [@jbclements](https://racket.discourse.group/u/jbclements)\
**Replies:** 3\
**Last updated:** [May 5, 2022, 5:35am UTC](https://racket.discourse.group/t/should-failures-of-assert-use-e-to-control-printout-length/958 "2022-05-05T05:35:01Z")

</div>

Here's a program: #lang typed/racket (assert (make-list 10000 "ouch") integer?) The assertion fails... but then it takes 10 seconds or so to print out the error message. Should this error message be abbreviate…

---

## [How are keywords different from symbols?](https://racket.discourse.group/t/how-are-keywords-different-from-symbols/959)

<div class="topic-metadata">

**Author:** [@MichaelBurge](https://racket.discourse.group/u/MichaelBurge)\
**Replies:** 4\
**Last updated:** [May 3, 2022, 5:44pm UTC](https://racket.discourse.group/t/how-are-keywords-different-from-symbols/959 "2022-05-03T17:44:17Z")

</div>

From a high-level understanding, I tend to think of keywords as being "a closed set of strings determined by your program's source code", while symbols are similar but the domain is at runtime. Neither usage is strict: …

---

## [Scrolling \`racket/gui\` panels with the mouse](https://racket.discourse.group/t/scrolling-racket-gui-panels-with-the-mouse/957)

<div class="topic-metadata">

**Author:** [@benknoble](https://racket.discourse.group/u/benknoble)\
**Replies:** 3\
**Last updated:** [May 2, 2022, 10:46pm UTC](https://racket.discourse.group/t/scrolling-racket-gui-panels-with-the-mouse/957 "2022-05-02T22:46:57Z")

</div>

More context Tagging @bogdan so they can follow the thread. What would it take for racket/gui's panels to be scrollable via the mouse (i.e., without having to click and drag the scrollbar)? Bogdan has suggested racket/…

---

## [Can I get the result of a match?](https://racket.discourse.group/t/can-i-get-the-result-of-a-match/943)

<div class="topic-metadata">

**Author:** [@robertpostill](https://racket.discourse.group/u/robertpostill)\
**Replies:** 2\
**Last updated:** [May 2, 2022, 10:25am UTC](https://racket.discourse.group/t/can-i-get-the-result-of-a-match/943 "2022-05-02T10:25:13Z")

</div>

I've been on a bit of a tear with match lately but I find myself re-running the match operation to take advantage of the match. For instance: define (find-email candidate) (define rule-name "Email Address") (define…

---

## [\[Feature Request\] Improve error message for neglecting to (require (for-syntax racket/base))](https://racket.discourse.group/t/feature-request-improve-error-message-for-neglecting-to-require-for-syntax-racket-base/948)

<div class="topic-metadata">

**Author:** [@joskoot](https://racket.discourse.group/u/joskoot)\
**Replies:** 2\
**Last updated:** [May 1, 2022, 6:39pm UTC](https://racket.discourse.group/t/feature-request-improve-error-message-for-neglecting-to-require-for-syntax-racket-base/948 "2022-05-01T18:39:22Z")

</div>

See \[Feature Request\] Improve error message for neglecting to (require (for-syntax racket/base)) · Issue #3912 · racket/racket · GitHub I do not understand why (require (for-syntax racket/base)) is required. The follow…

---

## [Keep white interactive background when saving pict to png file](https://racket.discourse.group/t/keep-white-interactive-background-when-saving-pict-to-png-file/940)

<div class="topic-metadata">

**Author:** [@albuck](https://racket.discourse.group/u/albuck)\
**Replies:** 3\
**Last updated:** [April 29, 2022, 11:23pm UTC](https://racket.discourse.group/t/keep-white-interactive-background-when-saving-pict-to-png-file/940 "2022-04-29T23:23:44Z")

</div>

I want to format some trees into png files. This code from StackOverflow makes a great diagram in the interactive window. When I follow the suggestion in the comment to save to a file, the png ends up with a solid blac…

---

## [@deftype and @defpolytype for Scribble](https://racket.discourse.group/t/deftype-and-defpolytype-for-scribble/935)

<div class="topic-metadata">

**Author:** [@scolobb](https://racket.discourse.group/u/scolobb)\
**Replies:** 2\
**Last updated:** [April 29, 2022, 10:05pm UTC](https://racket.discourse.group/t/deftype-and-defpolytype-for-scribble/935 "2022-04-29T22:05:49Z")

</div>

Hello, While writing Scribble docs for my Typed Racket code, I ended up with the following macros: @(define-syntax-rule (defpolytype . args) (defform #:kind "polymorphic type" . args)) @(define-syntax-rule (deftype …

---

## [Preventing unnoticed thread death](https://racket.discourse.group/t/preventing-unnoticed-thread-death/931)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 5\
**Last updated:** [April 28, 2022, 2:36pm UTC](https://racket.discourse.group/t/preventing-unnoticed-thread-death/931 "2022-04-28T14:36:51Z")

</div>

I'm expanding the majordomo2 task management module to accept a max-workers parameter such that number of running tasks can be constrained with newly-added tasks being queued until there are workers available. My initia…

[Previous page](https://racket.discourse.group/c/questions/6.md?page=27)

[Next page](https://racket.discourse.group/c/questions/6.md?page=29)
