# Questions & Answers

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

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

**Page:** 6

---

## [How to provide nested command usage message with \`command-line\`](https://racket.discourse.group/t/how-to-provide-nested-command-usage-message-with-command-line/3825)

<div class="topic-metadata">

**Author:** [@dannypsnl](https://racket.discourse.group/u/dannypsnl)\
**Replies:** 2\
**Last updated:** [July 7, 2025, 5:08pm UTC](https://racket.discourse.group/t/how-to-provide-nested-command-usage-message-with-command-line/3825 "2025-07-07T17:08:12Z")

</div>

In Racket, we can use command-line to create single command with some flags. I use (define args (command-line ...)) (match args \[(list "command1") ...\] \[(list "command2") ...\] \[(list "command3") ...\]) to create …

---

## [Performance difference - why?](https://racket.discourse.group/t/performance-difference-why/3839)

<div class="topic-metadata">

**Author:** [@hnmdijkema](https://racket.discourse.group/u/hnmdijkema)\
**Replies:** 4\
**Last updated:** [July 7, 2025, 2:30pm UTC](https://racket.discourse.group/t/performance-difference-why/3839 "2025-07-07T14:30:05Z")

</div>

I'm testing with an OO framework, and try to understand the performance difference between two implementations of a caller construct. I've narrowed the problem down to two simple tests: Test1 where I create some simple …

---

## [Is rackunit not supposed to work with typed Racket?](https://racket.discourse.group/t/is-rackunit-not-supposed-to-work-with-typed-racket/3836)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 2\
**Last updated:** [July 5, 2025, 1:48am UTC](https://racket.discourse.group/t/is-rackunit-not-supposed-to-work-with-typed-racket/3836 "2025-07-05T01:48:38Z")

</div>

I tried using rackunit with typed/racket: #lang typed/racket (require rackunit) (module+ test (check-true #t) ) I was granted the following obscure error message: ../../usr/local/racket/share/pkgs/rackunit-lib…

---

## [Returning defined syntax from a lambda expression](https://racket.discourse.group/t/returning-defined-syntax-from-a-lambda-expression/3835)

<div class="topic-metadata">

**Author:** [@hnmdijkema](https://racket.discourse.group/u/hnmdijkema)\
**Replies:** 2\
**Last updated:** [July 4, 2025, 10:40pm UTC](https://racket.discourse.group/t/returning-defined-syntax-from-a-lambda-expression/3835 "2025-07-04T22:40:54Z")

</div>

Suppose I want to return lexically scoped syntax from a defined function, e.g. like this: (define (a x) (define (b y) (\* y x)) (define h (make-hash)) (set! h 'b b) (define-syntax caller (syntax-rul…

---

## [Default non-keyword paraeters in type Racket](https://racket.discourse.group/t/default-non-keyword-paraeters-in-type-racket/3833)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 1\
**Last updated:** [July 4, 2025, 9:14am UTC](https://racket.discourse.group/t/default-non-keyword-paraeters-in-type-racket/3833 "2025-07-04T09:14:21Z")

</div>

How do you do an optional function parameter in Typed Racket? I want the paraneter NOT to be keyword parameter. I'm used to writing things like (define (foo a \[b d\]) ( ... and when i ask for the value of b, and I'v…

---

## [How to have macro use result of another macros expansion](https://racket.discourse.group/t/how-to-have-macro-use-result-of-another-macros-expansion/3830)

<div class="topic-metadata">

**Author:** [@sora22](https://racket.discourse.group/u/sora22)\
**Replies:** 0\
**Last updated:** [July 3, 2025, 5:10pm UTC](https://racket.discourse.group/t/how-to-have-macro-use-result-of-another-macros-expansion/3830 "2025-07-03T17:10:29Z")

</div>

I am currently trying to work with something I need to keep backwards compatible, and find myself wanting to write macros that depend on the output of another macros expansion. Is there any way to do that besides local-e…

---

## [When is a part collected-info-number set to '(#f)?](https://racket.discourse.group/t/when-is-a-part-collected-info-number-set-to-f/3823)

<div class="topic-metadata">

**Author:** [@stevebyan](https://racket.discourse.group/u/stevebyan)\
**Replies:** 1\
**Last updated:** [June 29, 2025, 2:42pm UTC](https://racket.discourse.group/t/when-is-a-part-collected-info-number-set-to-f/3823 "2025-06-29T14:42:39Z")

</div>

Under some circumstances, the collected-info-number for a Scribble part is set to '(#f). Does anyone happen to know what causes it to be set to that value?

---

## [Should the html section tag include section pretitle content?](https://racket.discourse.group/t/should-the-html-section-tag-include-section-pretitle-content/3808)

<div class="topic-metadata">

**Author:** [@stevebyan](https://racket.discourse.group/u/stevebyan)\
**Replies:** 1\
**Last updated:** [June 27, 2025, 2:49pm UTC](https://racket.discourse.group/t/should-the-html-section-tag-include-section-pretitle-content/3808 "2025-06-27T14:49:08Z")

</div>

I'm adding the html section tag to the Scribble html renderer. Should the scope of the section tag include pretitle content, or should it only include content starting at the Scribble section command?

---

## [Getting started with typed Racket and path-related types](https://racket.discourse.group/t/getting-started-with-typed-racket-and-path-related-types/3804)

<div class="topic-metadata">

**Author:** [@ddrake](https://racket.discourse.group/u/ddrake)\
**Replies:** 11\
**Last updated:** [June 24, 2025, 9:33pm UTC](https://racket.discourse.group/t/getting-started-with-typed-racket-and-path-related-types/3804 "2025-06-24T21:33:59Z")

</div>

I'm having trouble with typed Racket. I have code that works perfectly as "#lang racket", but when I swap that to typed/racket, I get a couple errors, and I haven't been able to convince the typechecker that things will …

---

## [Chaining together functions with multiple return values](https://racket.discourse.group/t/chaining-together-functions-with-multiple-return-values/3803)

<div class="topic-metadata">

**Author:** [@sora22](https://racket.discourse.group/u/sora22)\
**Replies:** 4\
**Last updated:** [June 22, 2025, 5:39pm UTC](https://racket.discourse.group/t/chaining-together-functions-with-multiple-return-values/3803 "2025-06-22T17:39:01Z")

</div>

I've recently tried writing functions that return multiple values for some calculations that chain together, and I feel that I am likely doing something incorrectly. When I attempt to chain them I can't find a way to get…

---

## [What tests exist for the xml library?](https://racket.discourse.group/t/what-tests-exist-for-the-xml-library/3798)

<div class="topic-metadata">

**Author:** [@stevebyan](https://racket.discourse.group/u/stevebyan)\
**Replies:** 6\
**Last updated:** [June 20, 2025, 8:42pm UTC](https://racket.discourse.group/t/what-tests-exist-for-the-xml-library/3798 "2025-06-20T20:42:33Z")

</div>

I'm making changes to the xml library to make xexprs serializable. What tests can I run to ensure I didn't break anything?

---

## [Raco setup error on macOS](https://racket.discourse.group/t/raco-setup-error-on-macos/3799)

<div class="topic-metadata">

**Author:** [@stevebyan](https://racket.discourse.group/u/stevebyan)\
**Replies:** 0\
**Last updated:** [June 20, 2025, 6:39pm UTC](https://racket.discourse.group/t/raco-setup-error-on-macos/3799 "2025-06-20T18:39:36Z")

</div>

I've forked racket/main at commit b9b01726. I get the following error when running raco setup on macOS 15.5 with an M1 processor: raco setup: running: /Users/smb/GitHub/racket/pkgs/racket-doc/scribblings/reference/refer…

---

## [Question about unconstrained-domain-\> in the Racket guide](https://racket.discourse.group/t/question-about-unconstrained-domain-in-the-racket-guide/3786)

<div class="topic-metadata">

**Author:** [@chiroptical](https://racket.discourse.group/u/chiroptical)\
**Replies:** 10\
**Last updated:** [June 16, 2025, 7:58pm UTC](https://racket.discourse.group/t/question-about-unconstrained-domain-in-the-racket-guide/3786 "2025-06-16T19:58:52Z")

</div>

Hey! I am currently working my way through the Racket guide and I am struggling a bit to grok unconstrained-domain-\> in the example 7.3 Contracts on Functions in General. I'll paste the example here and work through my …

---

## [Guessing Game Error](https://racket.discourse.group/t/guessing-game-error/3784)

<div class="topic-metadata">

**Author:** [@avrame](https://racket.discourse.group/u/avrame)\
**Replies:** 2\
**Last updated:** [June 10, 2025, 10:32pm UTC](https://racket.discourse.group/t/guessing-game-error/3784 "2025-06-10T22:32:55Z")

</div>

I read through most of the Racket Guide and decided to write a simple guessing game to test my understanding of Racket. It works for the most part, but once the user guesses the correct answer, I get this error message: a…

---

## [When use suffixes "?" and "!"?](https://racket.discourse.group/t/when-use-suffixes-and/3781)

<div class="topic-metadata">

**Author:** [@Kalimehtar](https://racket.discourse.group/u/Kalimehtar)\
**Replies:** 2\
**Last updated:** [June 8, 2025, 7:43pm UTC](https://racket.discourse.group/t/when-use-suffixes-and/3781 "2025-06-08T19:43:32Z")

</div>

I see in 6 Textual Matters that "?" should be used in "predicates and boolean-valued functions" and "!" for "setters and field mutators". But in racket/gui I see accept-drop-files without "?" and setter enable without "…

---

## [Fix source module of a variable created with syntax](https://racket.discourse.group/t/fix-source-module-of-a-variable-created-with-syntax/3770)

<div class="topic-metadata">

**Author:** [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Replies:** 0\
**Last updated:** [June 3, 2025, 4:01pm UTC](https://racket.discourse.group/t/fix-source-module-of-a-variable-created-with-syntax/3770 "2025-06-03T16:01:01Z")

</div>

hello, i have a hard question , not even sure it can be done, i parse some superscript character and create variable from the token i get with this code: (datum-\>syntax #'superscript-parser (string-\>symbol p-tok)) all…

---

## [Accessing stdout when current-output-port parameter is overridden](https://racket.discourse.group/t/accessing-stdout-when-current-output-port-parameter-is-overridden/3765)

<div class="topic-metadata">

**Author:** [@stevebyan](https://racket.discourse.group/u/stevebyan)\
**Replies:** 2\
**Last updated:** [May 28, 2025, 10:40pm UTC](https://racket.discourse.group/t/accessing-stdout-when-current-output-port-parameter-is-overridden/3765 "2025-05-28T22:40:52Z")

</div>

How do I access stdout when I'm in a parameterize context where current-output-port is set to something other than stdout?

---

## [Where to find the correct syntax for #lang racklog?](https://racket.discourse.group/t/where-to-find-the-correct-syntax-for-lang-racklog/3759)

<div class="topic-metadata">

**Author:** [@UserX](https://racket.discourse.group/u/UserX)\
**Replies:** 3\
**Last updated:** [May 26, 2025, 9:44am UTC](https://racket.discourse.group/t/where-to-find-the-correct-syntax-for-lang-racklog/3759 "2025-05-26T09:44:27Z")

</div>

It appears that either I'm doing something blatantly stupid or #lang racklog documentation misses some points. Here the question. According to the documentation This module language accepts the syntax of Datalog (exc…

---

## [Why is contract-out struct immutable?](https://racket.discourse.group/t/why-is-contract-out-struct-immutable/3755)

<div class="topic-metadata">

**Author:** [@mike](https://racket.discourse.group/u/mike)\
**Replies:** 2\
**Last updated:** [May 22, 2025, 6:18am UTC](https://racket.discourse.group/t/why-is-contract-out-struct-immutable/3755 "2025-05-22T06:18:29Z")

</div>

It seems struct in contract-out does not support the #:mutable option. Why is that? This is especially strange as struct/contract does support it. This is regrettable, as changing one into the other is super-tedious. I…

---

## [USB and console-mode support](https://racket.discourse.group/t/usb-and-console-mode-support/3700)

<div class="topic-metadata">

**Author:** [@HughAguilar](https://racket.discourse.group/u/HughAguilar)\
**Replies:** 26\
**Last updated:** [May 22, 2025, 5:15am UTC](https://racket.discourse.group/t/usb-and-console-mode-support/3700 "2025-05-22T05:15:39Z")

</div>

I need to write a terminal program. I already have a program written in Python (not by me) but it would need significant upgrading and I don't want to learn enough Python to do this (Python is really not my kind of langu…

---

## [Scramble/regexp question](https://racket.discourse.group/t/scramble-regexp-question/3319)

<div class="topic-metadata">

**Author:** [@jbclements](https://racket.discourse.group/u/jbclements)\
**Replies:** 9\
**Last updated:** [May 21, 2025, 4:28pm UTC](https://racket.discourse.group/t/scramble-regexp-question/3319 "2025-05-21T16:28:04Z")

</div>

I've just started using Ryan Culpepper's scramble/regexp library for constructing regular expressions in a structured way (a la "SRE"s), and I'm liking it a lot. One thing I haven't figured out yet is a nice way to write…

---

## [Racket upgrade (8.17) with Emacs racket-mode - the curse of racket-mode-start-faster](https://racket.discourse.group/t/racket-upgrade-8-17-with-emacs-racket-mode-the-curse-of-racket-mode-start-faster/3750)

<div class="topic-metadata">

**Author:** [@maueroats](https://racket.discourse.group/u/maueroats)\
**Replies:** 1\
**Last updated:** [May 19, 2025, 8:42pm UTC](https://racket.discourse.group/t/racket-upgrade-8-17-with-emacs-racket-mode-the-curse-of-racket-mode-start-faster/3750 "2025-05-19T20:42:20Z")

</div>

Install Racket 8.17 and now emacs won't start my Racket REPL. I did migrate everything from my previous version and did not touch the emacs config. Suggestions?

---

## [Structure constructor](https://racket.discourse.group/t/structure-constructor/3748)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 1\
**Last updated:** [May 19, 2025, 12:27am UTC](https://racket.discourse.group/t/structure-constructor/3748 "2025-05-19T00:27:02Z")

</div>

Let's define a structure type (struct onion (leek cut tears)) Now I'd like to construct a value of this type. I can say (onion 1 2 4) but if there are a lot of components it can become obscure which value goes with…

---

## [What're Differences Between \`typed/racket/unsafe\` and \`typed/racket/optional\`?](https://racket.discourse.group/t/whatre-differences-between-typed-racket-unsafe-and-typed-racket-optional/3746)

<div class="topic-metadata">

**Author:** [@NoahStoryM](https://racket.discourse.group/u/NoahStoryM)\
**Replies:** 1\
**Last updated:** [May 16, 2025, 12:50pm UTC](https://racket.discourse.group/t/whatre-differences-between-typed-racket-unsafe-and-typed-racket-optional/3746 "2025-05-16T12:50:39Z")

</div>

I'm writing a module that adds types to identifiers imported from untyped code, and I want to avoid contract generation. I see two approaches: Using typed/racket/unsafe: (require typed/racket/unsafe) Using typed/rack…

---

## [Vulcan examples?](https://racket.discourse.group/t/vulcan-examples/3743)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 1\
**Last updated:** [May 15, 2025, 11:38pm UTC](https://racket.discourse.group/t/vulcan-examples/3743 "2025-05-15T23:38:48Z")

</div>

There is a Vulcan binding for Racket, documented here. In section 5.1 it explains that Right now the project has a strong need for example Vulkan applications. Has anyone written such examples? I've tried using the bi…

---

## [Previous value of a syntax parameter? / block with non-local exits](https://racket.discourse.group/t/previous-value-of-a-syntax-parameter-block-with-non-local-exits/3741)

<div class="topic-metadata">

**Author:** [@soegaard](https://racket.discourse.group/u/soegaard)\
**Replies:** 10\
**Last updated:** [May 14, 2025, 1:24pm UTC](https://racket.discourse.group/t/previous-value-of-a-syntax-parameter-block-with-non-local-exits/3741 "2025-05-14T13:24:04Z")

</div>

Previous value a syntax parameter The block form from ISLisp Recently I came across the specification of ISLisp. What Scheme is to Racket, ISLisp is to Common Lisp. That is, the ISLisp specification is closer in style …

---

## [Operator (from racket/base) not known](https://racket.discourse.group/t/operator-from-racket-base-not-known/3733)

<div class="topic-metadata">

**Author:** [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Replies:** 2\
**Last updated:** [May 12, 2025, 10:04pm UTC](https://racket.discourse.group/t/operator-from-racket-base-not-known/3733 "2025-05-12T22:04:39Z")

</div>

Hi, i'm writing a parser to evaluate super-scripted expression (not sure it is a good idea in real life but i like the display) used in exponentiation expressions, here is a working example : Welcome to DrRacket, versi…

---

## [Why are contracts not procedures?](https://racket.discourse.group/t/why-are-contracts-not-procedures/3727)

<div class="topic-metadata">

**Author:** [@joskoot](https://racket.discourse.group/u/joskoot)\
**Replies:** 2\
**Last updated:** [May 7, 2025, 7:13am UTC](https://racket.discourse.group/t/why-are-contracts-not-procedures/3727 "2025-05-07T07:13:14Z")

</div>

We have: (procedure? (-\> any/c any/c)) ; -\> #f (contract? (-\> any/c any/c)) ; -\> #t (contract? (λ (x) #t)) ; -\> #t Every procedure satisfying contract (-\> any/c any(c) is accepted as a contract, but the reverse is not …

---

## [Syntax Colours for Custom Dispatch Macros](https://racket.discourse.group/t/syntax-colours-for-custom-dispatch-macros/3714)

<div class="topic-metadata">

**Author:** [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Replies:** 0\
**Last updated:** [May 3, 2025, 9:22am UTC](https://racket.discourse.group/t/syntax-colours-for-custom-dispatch-macros/3714 "2025-05-03T09:22:58Z")

</div>

Hi, Racket Discourse. I wanted to try my hand at writing a reader macro extension, which was less intimidating than I thought it would be. The result works, but I am curious where I would implement custom syntax colour…

---

## [Is defining a function inside a loop without time penalty?](https://racket.discourse.group/t/is-defining-a-function-inside-a-loop-without-time-penalty/3392)

<div class="topic-metadata">

**Author:** [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Replies:** 16\
**Last updated:** [April 29, 2025, 3:15pm UTC](https://racket.discourse.group/t/is-defining-a-function-inside-a-loop-without-time-penalty/3392 "2025-04-29T15:15:37Z")

</div>

hello, i have a for/list that contains some computation, a simple mathematic expression, that should only be used in the for/lisp loop , so i can define it in the for/lisp body but i'm asking if the defined function wil…

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

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