# Questions & Answers

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

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

**Page:** 23

---

## [Macro that checks string value at compile time](https://racket.discourse.group/t/macro-that-checks-string-value-at-compile-time/1826)

<div class="topic-metadata">

**Author:** [@ryanslade](https://racket.discourse.group/u/ryanslade)\
**Replies:** 4\
**Last updated:** [March 20, 2023, 3:17pm UTC](https://racket.discourse.group/t/macro-that-checks-string-value-at-compile-time/1826 "2023-03-20T15:17:29Z")

</div>

I'm playing around with the idea of a macro that can, at compile time, find syntax errors in SQL queries. I'm very new to Racket in general and so for now I'm simply trying to write a macro that won't compile if I provid…

---

## [Adjusting bounding boxes and aligning hexagonal picts](https://racket.discourse.group/t/adjusting-bounding-boxes-and-aligning-hexagonal-picts/1810)

<div class="topic-metadata">

**Author:** [@benknoble](https://racket.discourse.group/u/benknoble)\
**Replies:** 7\
**Last updated:** [March 18, 2023, 3:15pm UTC](https://racket.discourse.group/t/adjusting-bounding-boxes-and-aligning-hexagonal-picts/1810 "2023-03-18T15:15:25Z")

</div>

First, all the pict-related stuff is awesome. I've been using it a lot lately, and I probably haven't said thank you. So thank you, Racketeers. I need to build pictures out of hexagons for a project I'm working on. (If…

---

## [How do I use a "condensed" font?](https://racket.discourse.group/t/how-do-i-use-a-condensed-font/1804)

<div class="topic-metadata">

**Author:** [@soegaard](https://racket.discourse.group/u/soegaard)\
**Replies:** 4\
**Last updated:** [March 13, 2023, 5:11pm UTC](https://racket.discourse.group/t/how-do-i-use-a-condensed-font/1804 "2023-03-13T17:11:41Z")

</div>

Hi All, Due to space constraints I'd like to use the "condensed" version of "DejaVu Sans". In the macOS FontBook it has "condensed" listed as one of its styles. I can't figure out how to load it with (make-object f…

---

## [How raise-argument-error call gather more stacktrace?](https://racket.discourse.group/t/how-raise-argument-error-call-gather-more-stacktrace/1795)

<div class="topic-metadata">

**Author:** [@Kalimehtar](https://racket.discourse.group/u/Kalimehtar)\
**Replies:** 12\
**Last updated:** [March 13, 2023, 4:03am UTC](https://racket.discourse.group/t/how-raise-argument-error-call-gather-more-stacktrace/1795 "2023-03-13T04:03:16Z")

</div>

I try to make may own version of raise-argument-error: (define (raise-argument-error\* a b c) (raise (exn:fail:contract (format "~a: contract violation\\n expected: ~a\\n given: ~a" a b c) (current-cont…

---

## [Identifiers in \`\_fun\`](https://racket.discourse.group/t/identifiers-in-fun/1769)

<div class="topic-metadata">

**Author:** [@Antigen-11](https://racket.discourse.group/u/Antigen-11)\
**Replies:** 2\
**Last updated:** [March 9, 2023, 6:56pm UTC](https://racket.discourse.group/t/identifiers-in-fun/1769 "2023-03-09T18:56:58Z")

</div>

I typed this in the repl and an error was raised: \> (require ffi/unsafe) \> (\_fun (f) :: ((\_array/list \_int (length f)) = f) -\> \_int) f: undefined; cannot reference an identifier before its definition in module: top-l…

---

## [How to parameterize in created language?](https://racket.discourse.group/t/how-to-parameterize-in-created-language/1764)

<div class="topic-metadata">

**Author:** [@Kalimehtar](https://racket.discourse.group/u/Kalimehtar)\
**Replies:** 1\
**Last updated:** [March 8, 2023, 7:47pm UTC](https://racket.discourse.group/t/how-to-parameterize-in-created-language/1764 "2023-03-08T19:47:35Z")

</div>

How to set parameters in own language? If I use in #%module-begin (parameter-name new-value), then it retains new-value even in modules, that requires my language module. If I try to set parameterize around the module …

---

## [Racket handin with structures types](https://racket.discourse.group/t/racket-handin-with-structures-types/1762)

<div class="topic-metadata">

**Author:** [@jestarray](https://racket.discourse.group/u/jestarray)\
**Replies:** 1\
**Last updated:** [March 7, 2023, 3:33am UTC](https://racket.discourse.group/t/racket-handin-with-structures-types/1762 "2023-03-07T03:33:44Z")

</div>

anyone here work with racket handin-server? (define-struct box \[size angle\]) (@test "tock#1" "err: our speeds are: GROWTH: 1, ROTATION-SPEED: 4" (tock (make-box 4 6)) (make-box 5 10) 1) so for checking structure def p…

---

## [The type of ind-Nat in the pie language?](https://racket.discourse.group/t/the-type-of-ind-nat-in-the-pie-language/1733)

<div class="topic-metadata">

**Author:** [@rebcabin](https://racket.discourse.group/u/rebcabin)\
**Replies:** 4\
**Last updated:** [March 1, 2023, 10:03am UTC](https://racket.discourse.group/t/the-type-of-ind-nat-in-the-pie-language/1733 "2023-03-01T10:03:07Z")

</div>

Hello -- I am trying to write a type for my own copy of ind-Nat in pie, following the example from the original pie documentation. Which states: (ind-Nat target motive base step) → (motive target) target : Nat motive : …

---

## [Pattern matching in TypedRacket that uses types to rule out impossible branches?](https://racket.discourse.group/t/pattern-matching-in-typedracket-that-uses-types-to-rule-out-impossible-branches/1743)

<div class="topic-metadata">

**Author:** [@AssertionError](https://racket.discourse.group/u/AssertionError)\
**Replies:** 5\
**Last updated:** [February 28, 2023, 6:53pm UTC](https://racket.discourse.group/t/pattern-matching-in-typedracket-that-uses-types-to-rule-out-impossible-branches/1743 "2023-02-28T18:53:46Z")

</div>

Hi everyone, I was wondering if anyone is aware of any pattern-matching-like macro for TypedRacket that supports types. For instance, consider the following thunk that holds a list. Type-wise there are two problems: …

---

## [How to write \`length\` in TypedRacket with inlined types?](https://racket.discourse.group/t/how-to-write-length-in-typedracket-with-inlined-types/1742)

<div class="topic-metadata">

**Author:** [@AssertionError](https://racket.discourse.group/u/AssertionError)\
**Replies:** 1\
**Last updated:** [February 27, 2023, 10:20pm UTC](https://racket.discourse.group/t/how-to-write-length-in-typedracket-with-inlined-types/1742 "2023-02-27T22:20:30Z")

</div>

Hi everyone, I am sorry for the newbie question. I'm wondering why TypedRacket complains about the following implementation of length #lang typed/racket (define #:forall \[T\] (len \[ l : (Listof T)\] ) : Number (match …

---

## [What are some reasons for choosing Racket over Common Lisp?](https://racket.discourse.group/t/what-are-some-reasons-for-choosing-racket-over-common-lisp/1731)

<div class="topic-metadata">

**Author:** [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Replies:** 4\
**Last updated:** [February 24, 2023, 2:59pm UTC](https://racket.discourse.group/t/what-are-some-reasons-for-choosing-racket-over-common-lisp/1731 "2023-02-24T14:59:10Z")

</div>

The question above was asked in #general on the Racket Discord today. While my initial response was ‘Depends. What you want to do?’, there were a number of insightful responses. I’ll invite them to be repeated here.

---

## [A for/fold #:break question, I think](https://racket.discourse.group/t/a-for-fold-break-question-i-think/1553)

<div class="topic-metadata">

**Author:** [@tbhanson](https://racket.discourse.group/u/tbhanson)\
**Replies:** 3\
**Last updated:** [February 21, 2023, 12:11pm UTC](https://racket.discourse.group/t/a-for-fold-break-question-i-think/1553 "2023-02-21T12:11:35Z")

</div>

hi, folks, I posted this question here: https://groups.google.com/g/racket-users/c/LblfrTvKVx4 yestereve, but just discovered this discourse group. I hope it's OK to cross-post here, so to speak. --tbh hi, I'm trying …

---

## [Stream-filter not in constant space?](https://racket.discourse.group/t/stream-filter-not-in-constant-space/1643)

<div class="topic-metadata">

**Author:** [@joskoot](https://racket.discourse.group/u/joskoot)\
**Replies:** 22\
**Last updated:** [February 17, 2023, 3:05am UTC](https://racket.discourse.group/t/stream-filter-not-in-constant-space/1643 "2023-02-17T03:05:28Z")

</div>

The following runs in constant space: (letrec ((make-nats (λ (n) (stream-cons n (make-nats (add1 n))))) (m (λ (x) (zero? (remainder x 10000)))) (stream-filter (λ (f strm) (let ((kar (stream-first str…

---

## [How to use the binding space?](https://racket.discourse.group/t/how-to-use-the-binding-space/1717)

<div class="topic-metadata">

**Author:** [@Antigen-11](https://racket.discourse.group/u/Antigen-11)\
**Replies:** 3\
**Last updated:** [February 17, 2023, 1:18am UTC](https://racket.discourse.group/t/how-to-use-the-binding-space/1717 "2023-02-17T01:18:08Z")

</div>

According to the racket reference, A space’s scope is accessed indirectly by using make-interned-syntax-introducer...... The require and provide forms include support for bindings spaces through subforms like for-space …

---

## [\`for-space\` in the \`provide\` form?](https://racket.discourse.group/t/for-space-in-the-provide-form/1715)

<div class="topic-metadata">

**Author:** [@Antigen-11](https://racket.discourse.group/u/Antigen-11)\
**Replies:** 10\
**Last updated:** [February 16, 2023, 11:18pm UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715 "2023-02-16T23:18:27Z")

</div>

According to the for-space, Like the union of the provide-specs, but adjusted to apply to the binding space specified by space—where space is either an identifier or #f for the default binding space. But I got an err…

---

## [Making epub files](https://racket.discourse.group/t/making-epub-files/1714)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 2\
**Last updated:** [February 15, 2023, 2:44pm UTC](https://racket.discourse.group/t/making-epub-files/1714 "2023-02-15T14:44:49Z")

</div>

Does anyone have Racket code that makes epub files?

---

## [Typed Racket: map list items while remembering individual types?](https://racket.discourse.group/t/typed-racket-map-list-items-while-remembering-individual-types/1701)

<div class="topic-metadata">

**Author:** [@cadence](https://racket.discourse.group/u/cadence)\
**Replies:** 3\
**Last updated:** [February 15, 2023, 10:28am UTC](https://racket.discourse.group/t/typed-racket-map-list-items-while-remembering-individual-types/1701 "2023-02-15T10:28:32Z")

</div>

First, consider lists where all list items are the same time. I already know that this isn't possible the easy way due to nested polymorphic functions: (map values '(5 6 7)) /!\\ Type Checker: Polymorphic function \`map' …

---

## [Macro in Racket language?](https://racket.discourse.group/t/macro-in-racket-language/1709)

<div class="topic-metadata">

**Author:** [@Antigen-11](https://racket.discourse.group/u/Antigen-11)\
**Replies:** 7\
**Last updated:** [February 13, 2023, 3:09pm UTC](https://racket.discourse.group/t/macro-in-racket-language/1709 "2023-02-13T15:09:37Z")

</div>

\> (version) "8.8" \> (require (for-syntax racket/base)) \> (define-syntax-rule (make-module n (l ...) i b) (module n racket/base (require l ...) (provide i) (define i b))) \> (make-module t () x 1) str…

---

## [Expressing contract conditions related to underlying data structures](https://racket.discourse.group/t/expressing-contract-conditions-related-to-underlying-data-structures/1707)

<div class="topic-metadata">

**Author:** [@Balrrach](https://racket.discourse.group/u/Balrrach)\
**Replies:** 0\
**Last updated:** [February 12, 2023, 5:41pm UTC](https://racket.discourse.group/t/expressing-contract-conditions-related-to-underlying-data-structures/1707 "2023-02-12T17:41:55Z")

</div>

Hello. I'm new to DbC and I'm trying to understand some of its fundamental concepts and how they could be applied to racket specifically. My questions is this: Suppose I want to define an interface. In order for the inte…

---

## [Unexpected behaviour of quasiquote when binding unquote and unquote-splicing](https://racket.discourse.group/t/unexpected-behaviour-of-quasiquote-when-binding-unquote-and-unquote-splicing/1700)

<div class="topic-metadata">

**Author:** [@joskoot](https://racket.discourse.group/u/joskoot)\
**Replies:** 2\
**Last updated:** [February 12, 2023, 10:56am UTC](https://racket.discourse.group/t/unexpected-behaviour-of-quasiquote-when-binding-unquote-and-unquote-splicing/1700 "2023-02-12T10:56:13Z")

</div>

\#lang racket/base (let ((unquote-splicing 4) (unquote add1)) \`(a b unquote ,(map unquote '(0 1 2 3)) ,(unquote unquote-splicing))) --\> (a b unquote ,(map . ,'(0 1 2 3)) ,,unquote-splicing) but should it not produ…

---

## [Resources for continuations / delimited continuations / racket continuation functionality from a beginner perspective?](https://racket.discourse.group/t/resources-for-continuations-delimited-continuations-racket-continuation-functionality-from-a-beginner-perspective/1690)

<div class="topic-metadata">

**Author:** [@dr-neptune](https://racket.discourse.group/u/dr-neptune)\
**Replies:** 3\
**Last updated:** [February 7, 2023, 11:55pm UTC](https://racket.discourse.group/t/resources-for-continuations-delimited-continuations-racket-continuation-functionality-from-a-beginner-perspective/1690 "2023-02-07T23:55:45Z")

</div>

Hi folks, beginner here on the path of learning continuations. I'm seeking resources for learning more about them. They seem very general, so anything would be appreciated -- however I would like them to be from the per…

---

## [Tab font in a tab-panel% doesn't want to change](https://racket.discourse.group/t/tab-font-in-a-tab-panel-doesnt-want-to-change/1692)

<div class="topic-metadata">

**Author:** [@lannydpittman](https://racket.discourse.group/u/lannydpittman)\
**Replies:** 1\
**Last updated:** [February 7, 2023, 10:38pm UTC](https://racket.discourse.group/t/tab-font-in-a-tab-panel-doesnt-want-to-change/1692 "2023-02-07T22:38:50Z")

</div>

Here is the situation: I am trying to make an application in Racket that will be used with a touchscreen. Naturally, I wanted to make lists, multi-selects, tabs, etc. a larger size, so that they can be more easily see…

---

## [Custom scribble site design](https://racket.discourse.group/t/custom-scribble-site-design/1674)

<div class="topic-metadata">

**Author:** [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Replies:** 1\
**Last updated:** [February 6, 2023, 8:31am UTC](https://racket.discourse.group/t/custom-scribble-site-design/1674 "2023-02-06T08:31:22Z")

</div>

Hi I’d like to make a variant of #lang scribble/manual that has keeps the same site structure; table of contents page with individual chapter pages, but has a preamble followers by the table of contents as tiled images …

---

## [(define-type … (Instance X)) breaks when X is a parametric type synonym, since Racket 8.7](https://racket.discourse.group/t/define-type-instance-x-breaks-when-x-is-a-parametric-type-synonym-since-racket-8-7/1682)

<div class="topic-metadata">

**Author:** [@scolobb](https://racket.discourse.group/u/scolobb)\
**Replies:** 1\
**Last updated:** [February 3, 2023, 4:46pm UTC](https://racket.discourse.group/t/define-type-instance-x-breaks-when-x-is-a-parametric-type-synonym-since-racket-8-7/1682 "2023-02-03T16:46:06Z")

</div>

Hi, Suppose I have the following typed class: (define my-class% (class object% #:forall (A) (super-new) (init-field \[x : A\]) (define/public (get-x) x))) I can define a synonym for the type of this cl…

---

## [DrRacket help function not working on MacOS Monterey](https://racket.discourse.group/t/drracket-help-function-not-working-on-macos-monterey/1677)

<div class="topic-metadata">

**Author:** [@TroutStalker](https://racket.discourse.group/u/TroutStalker)\
**Replies:** 2\
**Last updated:** [January 31, 2023, 8:33pm UTC](https://racket.discourse.group/t/drracket-help-function-not-working-on-macos-monterey/1677 "2023-01-31T20:33:17Z")

</div>

I'm new to Racket. On macOS Monterey, I installed Racket, DrRacket etc. by downloading the dmg file and installing it into /Applications. It seems to work but I can't get the help function to work. I put the cursor on a …

---

## [Do I really need a custodian?](https://racket.discourse.group/t/do-i-really-need-a-custodian/1680)

<div class="topic-metadata">

**Author:** [@joskoot](https://racket.discourse.group/u/joskoot)\
**Replies:** 0\
**Last updated:** [January 31, 2023, 8:03pm UTC](https://racket.discourse.group/t/do-i-really-need-a-custodian/1680 "2023-01-31T20:03:35Z")

</div>

\#| I have my toy evaluator. I do not allow my evaluator to change parameters. Therefore I run the evaluator proper in a thread. I tried call-with-parameterization, but to no avail. I want ports opened by expressions pa…

---

## [Web server subprocess logging to stdout sometimes not available until after subprocess terminates](https://racket.discourse.group/t/web-server-subprocess-logging-to-stdout-sometimes-not-available-until-after-subprocess-terminates/1673)

<div class="topic-metadata">

**Author:** [@joeld](https://racket.discourse.group/u/joeld)\
**Replies:** 12\
**Last updated:** [January 30, 2023, 7:41pm UTC](https://racket.discourse.group/t/web-server-subprocess-logging-to-stdout-sometimes-not-available-until-after-subprocess-terminates/1673 "2023-01-30T19:41:35Z")

</div>

I’m running raco static-web from inside another Racket program using subprocess\[1\], and, inside a thread, monitoring the subprocess’s stdout with sync/enable-break. The weird thing is that with raco static-web in particu…

---

## [What exactly is #lang](https://racket.discourse.group/t/what-exactly-is-lang/1675)

<div class="topic-metadata">

**Author:** [@Panadestein](https://racket.discourse.group/u/Panadestein)\
**Replies:** 4\
**Last updated:** [January 30, 2023, 2:38pm UTC](https://racket.discourse.group/t/what-exactly-is-lang/1675 "2023-01-30T14:38:18Z")

</div>

Hi, very basic question here. What is the correct name of "#lang" in Racket ? Is it a "reader form", a "directive", a "reader macro", or something else?

---

## [Using (string-downcase ...) makes (eq? ...) fail](https://racket.discourse.group/t/using-string-downcase-makes-eq-fail/1664)

<div class="topic-metadata">

**Author:** [@Grafcube](https://racket.discourse.group/u/Grafcube)\
**Replies:** 1\
**Last updated:** [January 26, 2023, 2:21pm UTC](https://racket.discourse.group/t/using-string-downcase-makes-eq-fail/1664 "2023-01-26T14:21:58Z")

</div>

I have these functions here (define (greetfmt name) (string-append "Hello " name "!")) (define (auth? name) (or (eq? name "alice") (eq? name "bob"))) (define (greet name) ;;(if (auth? name) (if (auth? (str…

---

## [\[Newbie\] How to improve my terrible calculator?](https://racket.discourse.group/t/newbie-how-to-improve-my-terrible-calculator/1654)

<div class="topic-metadata">

**Author:** [@JohnSnow](https://racket.discourse.group/u/JohnSnow)\
**Replies:** 2\
**Last updated:** [January 23, 2023, 8:48am UTC](https://racket.discourse.group/t/newbie-how-to-improve-my-terrible-calculator/1654 "2023-01-23T08:48:42Z")

</div>

I am slightly past the "beginning student language" and I am trying to implement a simple calculator with what I have learned. However, I feel the code can be shorter and simpler but I don't know how. What's a better way…

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

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