# Questions & Answers

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

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

**Page:** 19

---

## [Getting (say) the month from a gregor datetime](https://racket.discourse.group/t/getting-say-the-month-from-a-gregor-datetime/2355)

<div class="topic-metadata">

**Author:** [@jbclements](https://racket.discourse.group/u/jbclements)\
**Replies:** 4\
**Last updated:** [October 2, 2023, 2:08pm UTC](https://racket.discourse.group/t/getting-say-the-month-from-a-gregor-datetime/2355 "2023-10-02T14:08:23Z")

</div>

I like the work and thought that went into gregor. However, I can't figure out how to extract (say) the month from a datetime without doing something crazy like comparing the date to the first of each month. Even that se…

---

## [Parallel activity in the web-server for a game](https://racket.discourse.group/t/parallel-activity-in-the-web-server-for-a-game/2308)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 5\
**Last updated:** [October 2, 2023, 1:59am UTC](https://racket.discourse.group/t/parallel-activity-in-the-web-server-for-a-game/2308 "2023-10-02T01:59:03Z")

</div>

I'm still working on the minimal multiplayer game to be run from the Racket web-server. I have a few questions in the following big post, most of which is to establish context. I'm hung up on the various forms of paral…

---

## [\`ffi-lib\` fails to load an existing library](https://racket.discourse.group/t/ffi-lib-fails-to-load-an-existing-library/2353)

<div class="topic-metadata">

**Author:** [@Antigen-11](https://racket.discourse.group/u/Antigen-11)\
**Replies:** 7\
**Last updated:** [October 1, 2023, 4:19pm UTC](https://racket.discourse.group/t/ffi-lib-fails-to-load-an-existing-library/2353 "2023-10-01T16:19:40Z")

</div>

Hello, everyone! I create an application and use The Racket Foreign Interface to load foreign libraries. Here's part of the project after compiling c codes. ./gsl-fork/build/lib/ ├── libgsl.a ├── libgslcblas.a ├── lib…

---

## ["Filter" Match-Expander: Better Way to Achieve This?](https://racket.discourse.group/t/filter-match-expander-better-way-to-achieve-this/2352)

<div class="topic-metadata">

**Author:** [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Replies:** 4\
**Last updated:** [September 30, 2023, 6:25pm UTC](https://racket.discourse.group/t/filter-match-expander-better-way-to-achieve-this/2352 "2023-09-30T18:25:41Z")

</div>

Hi, Racket Discourse. I've been looking for a way to "filter" on certain patterns in lists in match-forms, somewhat like list-no-order, but more general in the sense that one can specify "indeterminate" arbitrarily dist…

---

## [How to make small executables?](https://racket.discourse.group/t/how-to-make-small-executables/2244)

<div class="topic-metadata">

**Author:** [@lewisl](https://racket.discourse.group/u/lewisl)\
**Replies:** 22\
**Last updated:** [September 28, 2023, 11:45pm UTC](https://racket.discourse.group/t/how-to-make-small-executables/2244 "2023-09-28T23:45:18Z")

</div>

The smallest executable I can get is about 49mb from nearly 60mb. it's clear that there is no pruning of unused packages, libraries, etc. I have used the two "old" tricks: use #lang racket/base and the demod trick for …

---

## [Difference between for and for\*](https://racket.discourse.group/t/difference-between-for-and-for/2343)

<div class="topic-metadata">

**Author:** [@matteo-daddio](https://racket.discourse.group/u/matteo-daddio)\
**Replies:** 6\
**Last updated:** [September 27, 2023, 5:19pm UTC](https://racket.discourse.group/t/difference-between-for-and-for/2343 "2023-09-27T17:19:08Z")

</div>

Hello, I’m working with for expressions. In these examples in the racket guide sometimes it is used for and sometimes for\* and I can’t understand why. Matteo

---

## [Using Hash-Tables as Multisets](https://racket.discourse.group/t/using-hash-tables-as-multisets/2333)

<div class="topic-metadata">

**Author:** [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Replies:** 1\
**Last updated:** [September 23, 2023, 9:15am UTC](https://racket.discourse.group/t/using-hash-tables-as-multisets/2333 "2023-09-23T09:15:32Z")

</div>

Hi, Racket Discourse. I have been thinking a lot about multisets recently, because I want to implement a particular "computer algebra" system which codifies arithmetic/algebra in terms of "closed-form numbers", to a deg…

---

## [Basic recursion: How to eliminate the \`reverse\` without relying on \`append\`?](https://racket.discourse.group/t/basic-recursion-how-to-eliminate-the-reverse-without-relying-on-append/2318)

<div class="topic-metadata">

**Author:** [@JohnSnow](https://racket.discourse.group/u/JohnSnow)\
**Replies:** 10\
**Last updated:** [September 23, 2023, 5:04pm UTC](https://racket.discourse.group/t/basic-recursion-how-to-eliminate-the-reverse-without-relying-on-append/2318 "2023-09-23T17:04:45Z")

</div>

I am processing some data and need to do a simple transformation, which can be simplified into a basic recursion problem. I have come up with a solution but I want to eliminate the 2 reverse, which are used to keep the …

---

## [Splicing in syntax](https://racket.discourse.group/t/splicing-in-syntax/2336)

<div class="topic-metadata">

**Author:** [@mem](https://racket.discourse.group/u/mem)\
**Replies:** 4\
**Last updated:** [September 23, 2023, 12:55pm UTC](https://racket.discourse.group/t/splicing-in-syntax/2336 "2023-09-23T12:55:19Z")

</div>

Be gentle, folks—first time posting here. I've been interested in DSLs for a long time, and when I get the itch I come back to Racket to fool around a bit and inevitably find myself tangled up in some issue or another. …

---

## [Racket Web Scraping](https://racket.discourse.group/t/racket-web-scraping/2326)

<div class="topic-metadata">

**Author:** [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Replies:** 6\
**Last updated:** [September 22, 2023, 6:09pm UTC](https://racket.discourse.group/t/racket-web-scraping/2326 "2023-09-22T18:09:25Z")

</div>

Hi, Racket Discourse. I would like to ask what the current state is of web scraping libraries in Racket, and whether it would be better to just roll my own. I am thinking about building some functionality to help my te…

---

## [Plot library very slow with sqrt](https://racket.discourse.group/t/plot-library-very-slow-with-sqrt/2330)

<div class="topic-metadata">

**Author:** [@matteo-daddio](https://racket.discourse.group/u/matteo-daddio)\
**Replies:** 7\
**Last updated:** [September 21, 2023, 10:51pm UTC](https://racket.discourse.group/t/plot-library-very-slow-with-sqrt/2330 "2023-09-21T22:51:32Z")

</div>

Hello, I'm working with the Plot library and I have a problem. When I try to plot, for example, the square root, this function i really fast: (time (plot (function sqrt (- 0) 20))) \> cpu time: 359 real time: 358 …

---

## [Check-eq? not behaving properly in Typed Racket](https://racket.discourse.group/t/check-eq-not-behaving-properly-in-typed-racket/2327)

<div class="topic-metadata">

**Author:** [@shawnw](https://racket.discourse.group/u/shawnw)\
**Replies:** 3\
**Last updated:** [September 20, 2023, 6:52pm UTC](https://racket.discourse.group/t/check-eq-not-behaving-properly-in-typed-racket/2327 "2023-09-20T18:52:12Z")

</div>

Consider: #lang typed/racket/base (require typed/rackunit) (: hash-\>immutable-hash (All (k v) (-\> (HashTable k v) (Immutable-HashTable k v)))) (define (hash-\>immutable-hash htab) (if (immutable? htab) htab …

---

## [How do you specify student languages from VSCode/Vim/Emacs/etc?](https://racket.discourse.group/t/how-do-you-specify-student-languages-from-vscode-vim-emacs-etc/2324)

<div class="topic-metadata">

**Author:** [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Replies:** 8\
**Last updated:** [September 20, 2023, 4:01pm UTC](https://racket.discourse.group/t/how-do-you-specify-student-languages-from-vscode-vim-emacs-etc/2324 "2023-09-20T16:01:57Z")

</div>

Hi, How do you specify student languages from VSCode/Vim/Emacs/etc? Is #lang htdp/bsl correct for beginners student language? What #lang preamble specifies the other teaching languages you would normally specify via …

---

## [Macro Expressiveness and Nesting](https://racket.discourse.group/t/macro-expressiveness-and-nesting/2313)

<div class="topic-metadata">

**Author:** [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Replies:** 0\
**Last updated:** [September 15, 2023, 3:27pm UTC](https://racket.discourse.group/t/macro-expressiveness-and-nesting/2313 "2023-09-15T15:27:17Z")

</div>

Hi, Racket Discourse. Might be I'm overthinking the situation, but I thought I would ask anyway. Is there a known theorem/result/conjecture about the expressiveness of macros, in terms of how many layers of nesting you…

---

## [Macro Monstrosity: Some Questions](https://racket.discourse.group/t/macro-monstrosity-some-questions/2311)

<div class="topic-metadata">

**Author:** [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Replies:** 5\
**Last updated:** [September 15, 2023, 2:45pm UTC](https://racket.discourse.group/t/macro-monstrosity-some-questions/2311 "2023-09-15T14:45:09Z")

</div>

Hi, Racket Discourse. I am busy writing an "interface" which allows me to use a macro-defined template to access the content of the equivalents of JSON objects, i.e., hasheq tables, returned by http-easy's response-json …

---

## [Implementing "splicing" syntax](https://racket.discourse.group/t/implementing-splicing-syntax/2300)

<div class="topic-metadata">

**Author:** [@dominik.pantucek](https://racket.discourse.group/u/dominik.pantucek)\
**Replies:** 3\
**Last updated:** [September 11, 2023, 3:52pm UTC](https://racket.discourse.group/t/implementing-splicing-syntax/2300 "2023-09-11T15:52:58Z")

</div>

Hello Racketeers, I am working on a flow language (like a poor sibling of Qi) and realized that one of the things that would allow me to write a better structured code is some kind of "splicing" syntax macros. That is m…

---

## [Macro to Make Identifiers from String Diagram](https://racket.discourse.group/t/macro-to-make-identifiers-from-string-diagram/2296)

<div class="topic-metadata">

**Author:** [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Replies:** 11\
**Last updated:** [September 10, 2023, 3:27pm UTC](https://racket.discourse.group/t/macro-to-make-identifiers-from-string-diagram/2296 "2023-09-10T15:27:29Z")

</div>

Hi, Racket Discourse. I am trying to write a macro using some bits of beautiful-racket so that I can provide a string encoding of a diagram and convert the letter names in the diagram to identifiers which are used to de…

---

## [Is there a way to get DrRacket to indent all on save?](https://racket.discourse.group/t/is-there-a-way-to-get-drracket-to-indent-all-on-save/2009)

<div class="topic-metadata">

**Author:** [@madkins23](https://racket.discourse.group/u/madkins23)\
**Replies:** 8\
**Last updated:** [September 10, 2023, 3:25pm UTC](https://racket.discourse.group/t/is-there-a-way-to-get-drracket-to-indent-all-on-save/2009 "2023-09-10T15:25:08Z")

</div>

That's about it. I would like formatting to be done automagically when a definition file is saved. I figure it must be possible, but may be require a script or plugin. I can't find a preference or setting that would do …

---

## [Any way to hook running a quickscript script on events in Dr. Racket?](https://racket.discourse.group/t/any-way-to-hook-running-a-quickscript-script-on-events-in-dr-racket/1887)

<div class="topic-metadata">

**Author:** [@shawnw](https://racket.discourse.group/u/shawnw)\
**Replies:** 5\
**Last updated:** [September 10, 2023, 3:08pm UTC](https://racket.discourse.group/t/any-way-to-hook-running-a-quickscript-script-on-events-in-dr-racket/1887 "2023-09-10T15:08:34Z")

</div>

For example, I have a script to remove trailing whitespace from lines; I'd like to have it automatically run before saving a file.

---

## [Racket crashes with "invalid memory reference"](https://racket.discourse.group/t/racket-crashes-with-invalid-memory-reference/2206)

<div class="topic-metadata">

**Author:** [@wurmli](https://racket.discourse.group/u/wurmli)\
**Replies:** 14\
**Last updated:** [September 10, 2023, 1:42pm UTC](https://racket.discourse.group/t/racket-crashes-with-invalid-memory-reference/2206 "2023-09-10T13:42:22Z")

</div>

Does somebody know how to revert to expeditor with racket? I had found on Racket Blog to v8.4 how to change from expeditor to readline. The result looks like this: wurmli@cirrus7:~$ racket Welcome to Racket v8.9 \[cs\]. \>…

---

## [Lisp and hash tables](https://racket.discourse.group/t/lisp-and-hash-tables/2295)

<div class="topic-metadata">

**Author:** [@matteo-daddio](https://racket.discourse.group/u/matteo-daddio)\
**Replies:** 5\
**Last updated:** [September 9, 2023, 12:03pm UTC](https://racket.discourse.group/t/lisp-and-hash-tables/2295 "2023-09-09T12:03:41Z")

</div>

Hello, I don't know if this has already been said by anyone else, but: It’s well known that lisp is based on lists, but lists are based on pairs, so lisp is based on pairs, but pairs are actually vectors of length two,…

---

## [How do I rebuild the Racket repository with changes to the Rumble layer?](https://racket.discourse.group/t/how-do-i-rebuild-the-racket-repository-with-changes-to-the-rumble-layer/2297)

<div class="topic-metadata">

**Author:** [@MartianMoorGrove](https://racket.discourse.group/u/MartianMoorGrove)\
**Replies:** 0\
**Last updated:** [September 8, 2023, 6:49pm UTC](https://racket.discourse.group/t/how-do-i-rebuild-the-racket-repository-with-changes-to-the-rumble-layer/2297 "2023-09-08T18:49:04Z")

</div>

Running make at the top-level directory isn't enough, and I'm not finding much Rumble-specific guidance in the README files. My change is a potential performance improvement in hash.ss that I'd like to try.

---

## [Using client-side javascript in the Racket webserver?](https://racket.discourse.group/t/using-client-side-javascript-in-the-racket-webserver/2292)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 1\
**Last updated:** [September 6, 2023, 11:15pm UTC](https://racket.discourse.group/t/using-client-side-javascript-in-the-racket-webserver/2292 "2023-09-06T23:15:27Z")

</div>

I'm using the Racket webserver. I've discovered I have to use javascript on the client side. How do I generate a web page that contains javascript? I'm not asking how to write javascript. I've done that before. I'm …

---

## [Trouble with net/cookies](https://racket.discourse.group/t/trouble-with-net-cookies/2278)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 2\
**Last updated:** [September 6, 2023, 10:39pm UTC](https://racket.discourse.group/t/trouble-with-net-cookies/2278 "2023-09-06T22:39:11Z")

</div>

I seem to be unable to use the net/cookies package together with the web-server/servlet. With (require web-server/servlet web-server/servlet-env) (require net/cookies) I am told module: identifier already r…

---

## [Why is this \`unsafe-set-car!\` so much slower than \`unsafe-set-immutable-car!\`?](https://racket.discourse.group/t/why-is-this-unsafe-set-car-so-much-slower-than-unsafe-set-immutable-car/2282)

<div class="topic-metadata">

**Author:** [@MartianMoorGrove](https://racket.discourse.group/u/MartianMoorGrove)\
**Replies:** 2\
**Last updated:** [September 5, 2023, 7:27pm UTC](https://racket.discourse.group/t/why-is-this-unsafe-set-car-so-much-slower-than-unsafe-set-immutable-car/2282 "2023-09-05T19:27:56Z")

</div>

Here in Racket v8.10 CS I have implemented unsafe-set-car! in a way that is equivalent (I think) to unsafe-set-immutable-car! which is provided by racket/unsafe/ops: #lang racket/base (module prim racket/base (requi…

---

## [Traits and interfaces](https://racket.discourse.group/t/traits-and-interfaces/2267)

<div class="topic-metadata">

**Author:** [@matteo-daddio](https://racket.discourse.group/u/matteo-daddio)\
**Replies:** 1\
**Last updated:** [September 5, 2023, 4:19pm UTC](https://racket.discourse.group/t/traits-and-interfaces/2267 "2023-09-05T16:19:50Z")

</div>

Hello, I’m tying to work with traits and I discovered that traits can’t implement interfaces, so I can’t use the is-a? predicate. There’s a solution to this problem: create an empty mixin that adds only the interface d…

---

## [RSVG Package: Missing librsvg-2-2.dll](https://racket.discourse.group/t/rsvg-package-missing-librsvg-2-2-dll/2285)

<div class="topic-metadata">

**Author:** [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Replies:** 2\
**Last updated:** [September 4, 2023, 3:03pm UTC](https://racket.discourse.group/t/rsvg-package-missing-librsvg-2-2-dll/2285 "2023-09-04T15:03:59Z")

</div>

Hi, Racket Discourse. I am trying to import .svg files to use in concert with the metapict library. I want to make use of the rsvg package to import the pertinent files, but I receive the following error: ..\\..\\..\\..\\…

---

## [Running racket/gui at 60fps](https://racket.discourse.group/t/running-racket-gui-at-60fps/2276)

<div class="topic-metadata">

**Author:** [@PastAghast](https://racket.discourse.group/u/PastAghast)\
**Replies:** 6\
**Last updated:** [September 3, 2023, 6:13pm UTC](https://racket.discourse.group/t/running-racket-gui-at-60fps/2276 "2023-09-03T18:13:15Z")

</div>

I'm working on my first project in Racket. I think it's awesome that the language includes a cross platform GUI toolkit, and I'l like to wrap my head around how to make it perform well. I tried making a small canvas tha…

---

## [How to flush-output through make-output-port?](https://racket.discourse.group/t/how-to-flush-output-through-make-output-port/2280)

<div class="topic-metadata">

**Author:** [@Kalimehtar](https://racket.discourse.group/u/Kalimehtar)\
**Replies:** 1\
**Last updated:** [September 3, 2023, 3:16pm UTC](https://racket.discourse.group/t/how-to-flush-output-through-make-output-port/2280 "2023-09-03T15:16:48Z")

</div>

I have made a wrapper around some port via (define my-port (make-output-port 'my-port ; This port is ready when the original is ready: inner-port ; Writing procedure: (lambda (s start end non-bl…

---

## [Equality of namespaces](https://racket.discourse.group/t/equality-of-namespaces/2279)

<div class="topic-metadata">

**Author:** [@joskoot](https://racket.discourse.group/u/joskoot)\
**Replies:** 0\
**Last updated:** [September 2, 2023, 7:13pm UTC](https://racket.discourse.group/t/equality-of-namespaces/2279 "2023-09-02T19:13:39Z")

</div>

\#lang racket/base (eq? (make-base-namespace) (make-base-namespace)) ; --\> #f ; ok, understandable. ; Nevertheless: (let ((ns1 (make-base-namespace)) (ns2 (make-base-namespace))) (for/and ((x (in-list (namespace-mapp…

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

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