# Questions & Answers

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

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

**Page:** 28

---

## [Syntax of \`id\` in grammar for FEP](https://racket.discourse.group/t/syntax-of-id-in-grammar-for-fep/1109)

<div class="topic-metadata">

**Author:** [@pmatos](https://racket.discourse.group/u/pmatos)\
**Replies:** 13\
**Last updated:** [July 7, 2022, 7:22am UTC](https://racket.discourse.group/t/syntax-of-id-in-grammar-for-fep/1109 "2022-07-07T07:22:19Z")

</div>

If I look at the documentation for a linklet grammar here: 14.14 Linklets and the Core Compiler it says: The grammar of an defn-or-expr is similar to the expander’s grammar of fully expanded expressions (see Fully Exp…

---

## [Noob with noob questions](https://racket.discourse.group/t/noob-with-noob-questions/1124)

<div class="topic-metadata">

**Author:** [@Alex](https://racket.discourse.group/u/Alex)\
**Replies:** 9\
**Last updated:** [July 6, 2022, 6:35pm UTC](https://racket.discourse.group/t/noob-with-noob-questions/1124 "2022-07-06T18:35:58Z")

</div>

Hi, I'm currently planning to write a DSL for a project, and am evaluating different ways to do this. Racket came up as a good language for writing languages, and I have some questions I couldn't find answers to from si…

---

## [Intervals: Trivial questions from an absolute beginner](https://racket.discourse.group/t/intervals-trivial-questions-from-an-absolute-beginner/1099)

<div class="topic-metadata">

**Author:** [@late\_bloomer](https://racket.discourse.group/u/late_bloomer)\
**Replies:** 12\
**Last updated:** [July 6, 2022, 5:33pm UTC](https://racket.discourse.group/t/intervals-trivial-questions-from-an-absolute-beginner/1099 "2022-07-06T17:33:01Z")

</div>

Hi there. I bought the HTDP book over a year ago as a newbie with no background in programming, gave it a little try, but then had to stop for a while... Now I'm back at it with plenty of motivation, and I'm over the 1…

---

## [Zero clause in a \`match\` expression](https://racket.discourse.group/t/zero-clause-in-a-match-expression/1120)

<div class="topic-metadata">

**Author:** [@capfredf](https://racket.discourse.group/u/capfredf)\
**Replies:** 6\
**Last updated:** [July 5, 2022, 5:41pm UTC](https://racket.discourse.group/t/zero-clause-in-a-match-expression/1120 "2022-07-05T17:41:29Z")

</div>

according to the documentation for the match form, we don't need to supply a clause to a match expression. For example: (define (g x) (match x)) However, this does not seem very useful to me, because calling g with…

---

## [Scribble to PDF pain](https://racket.discourse.group/t/scribble-to-pdf-pain/1076)

<div class="topic-metadata">

**Author:** [@danprager](https://racket.discourse.group/u/danprager)\
**Replies:** 15\
**Last updated:** [July 5, 2022, 4:45pm UTC](https://racket.discourse.group/t/scribble-to-pdf-pain/1076 "2022-07-05T16:45:34Z")

</div>

I'm struggling to get my scribble setup working to produce pdfs. System: Mac M1 Racket: 8.3 CS LaTex: MacTex 2022 With the mouse example from the docs #lang scribble/base @title{On the Cookie-Eating Habits of Mice…

---

## [Extends existed module?](https://racket.discourse.group/t/extends-existed-module/1117)

<div class="topic-metadata">

**Author:** [@dannypsnl](https://racket.discourse.group/u/dannypsnl)\
**Replies:** 7\
**Last updated:** [July 2, 2022, 9:53pm UTC](https://racket.discourse.group/t/extends-existed-module/1117 "2022-07-02T21:53:09Z")

</div>

I'm unsure how to express this problem precisely. Thus, I give some examples. In Racket, a stx module in syntax module can be imported like (require syntax/stx) If I make something related to syntax, and named it a, c…

---

## [For/first, for\*/first, for/and, for\*/and, for/last in Typed Racket](https://racket.discourse.group/t/for-first-for-first-for-and-for-and-for-last-in-typed-racket/1002)

<div class="topic-metadata">

**Author:** [@scolobb](https://racket.discourse.group/u/scolobb)\
**Replies:** 3\
**Last updated:** [July 1, 2022, 11:36pm UTC](https://racket.discourse.group/t/for-first-for-first-for-and-for-and-for-last-in-typed-racket/1002 "2022-07-01T23:36:14Z")

</div>

Hi, I tried using for/first in Typed Racket in many different ways, in particular like this: (for/first : Integer (\[i : Integer '(1 2 3)\]) (ann i Integer)) As you can see, I put in all type annotations I could think o…

---

## [Setting the koyo port](https://racket.discourse.group/t/setting-the-koyo-port/1103)

<div class="topic-metadata">

**Author:** [@robertpostill](https://racket.discourse.group/u/robertpostill)\
**Replies:** 4\
**Last updated:** [July 1, 2022, 6:14am UTC](https://racket.discourse.group/t/setting-the-koyo-port/1103 "2022-07-01T06:14:31Z")

</div>

I have a couple of forms in my config.rkt that I believe set the IP and port of the racket web server: (define-option http-host #:default "127.0.0.1") (define-option http-port #:default (or (getenv "PORT") "8000") (st…

---

## [Writing the Zuo version number](https://racket.discourse.group/t/writing-the-zuo-version-number/1105)

<div class="topic-metadata">

**Author:** [@LiberalArtist](https://racket.discourse.group/u/LiberalArtist)\
**Replies:** 1\
**Last updated:** [June 30, 2022, 12:13am UTC](https://racket.discourse.group/t/writing-the-zuo-version-number/1105 "2022-06-30T00:13:03Z")

</div>

How should Zuo's version number be written? I know that, in Zuo, (hash-ref (runtime-env) 'version) produces 1, but 1 is not a valid-version? in the sense of version/utils. I also know that Racket and Chez Scheme pack th…

---

## [FFI cannot find symbol in shared library despite nm utility saying otherwise](https://racket.discourse.group/t/ffi-cannot-find-symbol-in-shared-library-despite-nm-utility-saying-otherwise/1098)

<div class="topic-metadata">

**Author:** [@kurinoku](https://racket.discourse.group/u/kurinoku)\
**Replies:** 2\
**Last updated:** [June 27, 2022, 3:16pm UTC](https://racket.discourse.group/t/ffi-cannot-find-symbol-in-shared-library-despite-nm-utility-saying-otherwise/1098 "2022-06-27T15:16:39Z")

</div>

I'm trying to create a dynamic library out of sxiv since I need to have a programmatically controllable image viewer, I don't really have much experience with shared libraries so it might be an error outside of Racket, b…

---

## [Enable syntax highlighting for REPL in terminal](https://racket.discourse.group/t/enable-syntax-highlighting-for-repl-in-terminal/1096)

<div class="topic-metadata">

**Author:** [@kurinoku](https://racket.discourse.group/u/kurinoku)\
**Replies:** 3\
**Last updated:** [June 24, 2022, 11:22pm UTC](https://racket.discourse.group/t/enable-syntax-highlighting-for-repl-in-terminal/1096 "2022-06-24T23:22:20Z")

</div>

Recently my university lends us a VM for a course, I installed racket there and the REPL has colors, I know this is a bit off-topic and has to do with my configuration, but I didn't find any dot file or installation file…

---

## [Nightly builds size of download](https://racket.discourse.group/t/nightly-builds-size-of-download/1095)

<div class="topic-metadata">

**Author:** [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Replies:** 1\
**Last updated:** [June 24, 2022, 7:19pm UTC](https://racket.discourse.group/t/nightly-builds-size-of-download/1095 "2022-06-24T19:19:46Z")

</div>

Why do the nightly Snapshot Builds from University of Utah and Northwestern University vary so much in size? I tend to use the University of Utah snapshots because they are usually smaller. best wishes Stephen

---

## [Can I create .eps (or tiff) images directly in Racket?](https://racket.discourse.group/t/can-i-create-eps-or-tiff-images-directly-in-racket/1084)

<div class="topic-metadata">

**Author:** [@marc](https://racket.discourse.group/u/marc)\
**Replies:** 8\
**Last updated:** [June 21, 2022, 9:25am UTC](https://racket.discourse.group/t/can-i-create-eps-or-tiff-images-directly-in-racket/1084 "2022-06-21T09:25:50Z")

</div>

I am using plot to save plots as .svg and .png, but need to get .eps or .tiff formats. I haven't found a function that exports to either of these in Racket -- only Neil's mediafiles deals with .tiff for metadata purpose…

---

## [Koyo - getting started](https://racket.discourse.group/t/koyo-getting-started/1088)

<div class="topic-metadata">

**Author:** [@robertpostill](https://racket.discourse.group/u/robertpostill)\
**Replies:** 4\
**Last updated:** [June 21, 2022, 6:21am UTC](https://racket.discourse.group/t/koyo-getting-started/1088 "2022-06-21T06:21:17Z")

</div>

I'm having a go at my first koyo project. So far I've got an app up and running with a raco koyo console using the default credentials. I'm now attempting to get koyo to use the .env file for configuration. In the doc…

---

## [Custom equality predicate - in struct/gen:equal+hash or extra function?](https://racket.discourse.group/t/custom-equality-predicate-in-struct-gen-equal-hash-or-extra-function/1086)

<div class="topic-metadata">

**Author:** [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Replies:** 1\
**Last updated:** [June 19, 2022, 1:58am UTC](https://racket.discourse.group/t/custom-equality-predicate-in-struct-gen-equal-hash-or-extra-function/1086 "2022-06-19T01:58:12Z")

</div>

Assuming you have a struct (struct foo (a b c) #:transparent) and you want a custom equality predicate. For example, two foo instances should be equal? if their corresponding a and b fields are equal?, regardless of …

---

## [How exactly do semaphores work, especially when combined with sync/timeout?](https://racket.discourse.group/t/how-exactly-do-semaphores-work-especially-when-combined-with-sync-timeout/1087)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 3\
**Last updated:** [June 17, 2022, 5:21pm UTC](https://racket.discourse.group/t/how-exactly-do-semaphores-work-especially-when-combined-with-sync-timeout/1087 "2022-06-17T17:21:37Z")

</div>

I was writing some code using semaphores and realized that I wasn't sure I completely understand them. Suppose I have something like this: (define sema (make-semaphore 1)) (define user-\>id (make-hash (list (cons 'alice…

---

## [Scribble-compatible image drawing libraries](https://racket.discourse.group/t/scribble-compatible-image-drawing-libraries/1081)

<div class="topic-metadata">

**Author:** [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Replies:** 5\
**Last updated:** [June 14, 2022, 5:39pm UTC](https://racket.discourse.group/t/scribble-compatible-image-drawing-libraries/1081 "2022-06-14T17:39:50Z")

</div>

I'd like to create images similar to the ones on this page (not the one on the top though :wink: ) and include them in a Scribble document. So these images would consist mostly of text, boxes, lines and arrows. The Scri…

---

## [How can I export the struct definition but not the constructor?](https://racket.discourse.group/t/how-can-i-export-the-struct-definition-but-not-the-constructor/1069)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 3\
**Last updated:** [June 14, 2022, 4:13pm UTC](https://racket.discourse.group/t/how-can-i-export-the-struct-definition-but-not-the-constructor/1069 "2022-06-14T16:13:22Z")

</div>

The goal is to have a struct type defined in one file and other files can use the struct (via accessors and match) but cannot create instances of the struct. Is there a way to do this aside from using #:constructor-name …

---

## [Managing \`cast\` performance penalty](https://racket.discourse.group/t/managing-cast-performance-penalty/905)

<div class="topic-metadata">

**Author:** [@scolobb](https://racket.discourse.group/u/scolobb)\
**Replies:** 26\
**Last updated:** [June 14, 2022, 12:04am UTC](https://racket.discourse.group/t/managing-cast-performance-penalty/905 "2022-06-14T00:04:23Z")

</div>

Hi, After putting cast here and there in my Typed Racket code, I got curious to know how much it cost me in terms of runtime performance: #lang typed/racket (time (for (\[i (in-range 10000)\]) (+ 1 i))) (time (…

---

## [Question about syntax-local-lift-require](https://racket.discourse.group/t/question-about-syntax-local-lift-require/1073)

<div class="topic-metadata">

**Author:** [@symingz](https://racket.discourse.group/u/symingz)\
**Replies:** 6\
**Last updated:** [June 12, 2022, 7:56pm UTC](https://racket.discourse.group/t/question-about-syntax-local-lift-require/1073 "2022-06-12T19:56:29Z")

</div>

Hi, The documentation of syntax-local-lift-require says If raw-require-spec and stx are part of the input to a transformer, then typically syntax-local-introduce should be applied to each before passing them to syntax…

---

## [What is direct parameter assignment useful for?](https://racket.discourse.group/t/what-is-direct-parameter-assignment-useful-for/1047)

<div class="topic-metadata">

**Author:** [@notjack](https://racket.discourse.group/u/notjack)\
**Replies:** 20\
**Last updated:** [June 8, 2022, 3:42pm UTC](https://racket.discourse.group/t/what-is-direct-parameter-assignment-useful-for/1047 "2022-06-08T15:42:08Z")

</div>

Parameters can be either parameterized or directly assigned to. The latter mutates a thread cell, while the former attaches a continuation mark. When is it useful to actually assign a parameter instead of using paramete…

---

## [Typed Racket and Flonums](https://racket.discourse.group/t/typed-racket-and-flonums/1067)

<div class="topic-metadata">

**Author:** [@alexh](https://racket.discourse.group/u/alexh)\
**Replies:** 1\
**Last updated:** [June 7, 2022, 11:13pm UTC](https://racket.discourse.group/t/typed-racket-and-flonums/1067 "2022-06-07T23:13:43Z")

</div>

Is Typed Racket able to replace functions such as +, sqrt and sin with their fl equivalents when all the arguments are Flonums? For example, is TR able to transform the code below: (: radians-\>chlen (-\> Flonum Flonum))…

---

## [Which is the best site to post a feature request for DrRacket?](https://racket.discourse.group/t/which-is-the-best-site-to-post-a-feature-request-for-drracket/1022)

<div class="topic-metadata">

**Author:** [@joskoot](https://racket.discourse.group/u/joskoot)\
**Replies:** 9\
**Last updated:** [June 6, 2022, 10:13pm UTC](https://racket.discourse.group/t/which-is-the-best-site-to-post-a-feature-request-for-drracket/1022 "2022-06-06T22:13:38Z")

</div>

The title says it all.

---

## [Info.rkt: whitelisting test files for raco test](https://racket.discourse.group/t/info-rkt-whitelisting-test-files-for-raco-test/1059)

<div class="topic-metadata">

**Author:** [@undltd](https://racket.discourse.group/u/undltd)\
**Replies:** 6\
**Last updated:** [June 5, 2022, 4:39pm UTC](https://racket.discourse.group/t/info-rkt-whitelisting-test-files-for-raco-test/1059 "2022-06-05T16:39:18Z")

</div>

I'd like to have raco test . only test specific file(s) in my package. Listing the files in test-include-paths in info.rkt doesn't seem to have the desired effect: raco test . runs all .rkt in the current directory (inc…

---

## [Info.rkt and multiple (custom?) licenses](https://racket.discourse.group/t/info-rkt-and-multiple-custom-licenses/1052)

<div class="topic-metadata">

**Author:** [@undltd](https://racket.discourse.group/u/undltd)\
**Replies:** 2\
**Last updated:** [June 3, 2022, 2:36pm UTC](https://racket.discourse.group/t/info-rkt-and-multiple-custom-licenses/1052 "2022-06-03T14:36:55Z")

</div>

I'm working on a very simple emoji lookup utility in Racket, and it looks like I'm going to include unicode.org's emoji-test.txt, which has its own license, distinct from the license of my code. I have two questions: H…

---

## [Type checking class instances](https://racket.discourse.group/t/type-checking-class-instances/1044)

<div class="topic-metadata">

**Author:** [@alexh](https://racket.discourse.group/u/alexh)\
**Replies:** 6\
**Last updated:** [June 3, 2022, 6:33am UTC](https://racket.discourse.group/t/type-checking-class-instances/1044 "2022-06-03T06:33:01Z")

</div>

I am trying to use Typed Racket with objects (class instances) and I am unable to get to type check a program where an object instance is created on demand. The program below illustrates what I am trying to do: #lang t…

---

## [Is this macros pair possible?](https://racket.discourse.group/t/is-this-macros-pair-possible/1048)

<div class="topic-metadata">

**Author:** [@Kalimehtar](https://racket.discourse.group/u/Kalimehtar)\
**Replies:** 2\
**Last updated:** [June 2, 2022, 3:45pm UTC](https://racket.discourse.group/t/is-this-macros-pair-possible/1048 "2022-06-02T15:45:18Z")

</div>

I would like to make something like (my-if cond1 act1 ...) (my-else act2 ...) that should expand to (if cond1 (begin act1 ...) (begin act2 ...)) Is it possible?

---

## [Emacs support for Racket programming](https://racket.discourse.group/t/emacs-support-for-racket-programming/420)

<div class="topic-metadata">

**Author:** [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Replies:** 16\
**Last updated:** [June 1, 2022, 2:27pm UTC](https://racket.discourse.group/t/emacs-support-for-racket-programming/420 "2022-06-01T14:27:29Z")

</div>

Say I was going to try Racket with Emacs. There are quite a few options in the Racket Guide: 24.2 Emacs I'd appreciate it if you could tell me what you use and why it suits you? (I'm drafting a PR to update that page …

---

## [How do ephermerons and weak hashes work?](https://racket.discourse.group/t/how-do-ephermerons-and-weak-hashes-work/1036)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 11\
**Last updated:** [May 31, 2022, 10:26pm UTC](https://racket.discourse.group/t/how-do-ephermerons-and-weak-hashes-work/1036 "2022-05-31T22:26:37Z")

</div>

I apparently don't understand the concept of unreachability as it applies to the garbage collector. (define h1 (make-ephemeron-hash)) (define h2 (make-weak-hash)) (struct thing (val) #:transparent) (let () (hash-set…

---

## [Futures and garbage collection](https://racket.discourse.group/t/futures-and-garbage-collection/1045)

<div class="topic-metadata">

**Author:** [@Laurent.O](https://racket.discourse.group/u/Laurent.O)\
**Replies:** 6\
**Last updated:** [May 31, 2022, 4:45pm UTC](https://racket.discourse.group/t/futures-and-garbage-collection/1045 "2022-05-31T16:45:06Z")

</div>

Using futures (via the wonderfully simple for/async), I'm seeing a long sequence of numbers like these: cpu: 256599 real: 4585 gc: 3065 I'm quite happy with the speedup I already get, but it appears that the GC is tak…

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

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