# Questions & Answers

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

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

**Page:** 9

---

## [Problem accessing docs](https://racket.discourse.group/t/problem-accessing-docs/3308)

<div class="topic-metadata">

**Author:** [@AlexG](https://racket.discourse.group/u/AlexG)\
**Replies:** 17\
**Last updated:** [January 11, 2025, 7:49pm UTC](https://racket.discourse.group/t/problem-accessing-docs/3308 "2025-01-11T19:49:55Z")

</div>

I've had this problem for a while, since about two updates ago, but I've just worked around it. I thought maybe now, with the latest version 8.15 out, might be a good time to fix it. I am also using Racket a lot more t…

---

## [\`for/treelist\` vs \`vector-\>treelist\`](https://racket.discourse.group/t/for-treelist-vs-vector-treelist/3441)

<div class="topic-metadata">

**Author:** [@NoahStoryM](https://racket.discourse.group/u/NoahStoryM)\
**Replies:** 5\
**Last updated:** [January 10, 2025, 3:41pm UTC](https://racket.discourse.group/t/for-treelist-vs-vector-treelist/3441 "2025-01-10T15:41:56Z")

</div>

While working on a package, I encountered a performance issue that I'd like to illustrate with the following example code: (time (define mtl (mutable-treelist 'x)) (define d\* (build-list 10000000 values)) (define f …

---

## [Threads and modules; how do they interact?](https://racket.discourse.group/t/threads-and-modules-how-do-they-interact/3286)

<div class="topic-metadata">

**Author:** [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Replies:** 12\
**Last updated:** [January 6, 2025, 5:59pm UTC](https://racket.discourse.group/t/threads-and-modules-how-do-they-interact/3286 "2025-01-06T17:59:05Z")

</div>

Hi, Racket Discourse. I have a very simple application, with a small set of log-sources (services and schedule), so I have only two loggers provided to the rest of the application, along with the starting-of and shuttin…

---

## [Drracket won't run on NetBSD 10.1 with racket-minimal](https://racket.discourse.group/t/drracket-wont-run-on-netbsd-10-1-with-racket-minimal/3463)

<div class="topic-metadata">

**Author:** [@Roc](https://racket.discourse.group/u/Roc)\
**Replies:** 10\
**Last updated:** [January 6, 2025, 2:25am UTC](https://racket.discourse.group/t/drracket-wont-run-on-netbsd-10-1-with-racket-minimal/3463 "2025-01-06T02:25:26Z")

</div>

Is there a way to get drracket going on NetBSD 10.1? Having racket-mini-8.15 installed and then performing $ raco pkg install --auto drracket there are ffi-lib issues, see as follows racket-minimal-8.15 drracket inst…

---

## [How to write a simple TCP server](https://racket.discourse.group/t/how-to-write-a-simple-tcp-server/3457)

<div class="topic-metadata">

**Author:** [@tinkererthinker](https://racket.discourse.group/u/tinkererthinker)\
**Replies:** 2\
**Last updated:** [January 2, 2025, 2:09pm UTC](https://racket.discourse.group/t/how-to-write-a-simple-tcp-server/3457 "2025-01-02T14:09:57Z")

</div>

I'm interested in network programming. In order to test my understanding of the TCP/IP protocol, I wanted to write a simple TCP client and server. I read the docs but I don't know which procedures I would need to make i…

---

## [Understanding vectorof: Q's on flatness, eager, immutable](https://racket.discourse.group/t/understanding-vectorof-qs-on-flatness-eager-immutable/3455)

<div class="topic-metadata">

**Author:** [@maueroats](https://racket.discourse.group/u/maueroats)\
**Replies:** 2\
**Last updated:** [January 1, 2025, 2:50am UTC](https://racket.discourse.group/t/understanding-vectorof-qs-on-flatness-eager-immutable/3455 "2025-01-01T02:50:47Z")

</div>

When should vectorof be #:flat? There is an option to declare a vectorof contract as flat. I believe this is because a vector might be mutated, but if your code is not supposed to be mutating the vector you can declare t…

---

## [\_fixnum slow? (despite docs)](https://racket.discourse.group/t/fixnum-slow-despite-docs/3409)

<div class="topic-metadata">

**Author:** [@Laurent.O](https://racket.discourse.group/u/Laurent.O)\
**Replies:** 11\
**Last updated:** [December 26, 2024, 1:17pm UTC](https://racket.discourse.group/t/fixnum-slow-despite-docs/3409 "2024-12-26T13:17:21Z")

</div>

I was trying to figure out why my uses of ptr-ref were 10x slower than vector-ref. The main reason appears to be that \_fixnum is (much) slower than the rest, like \_ulong. #lang racket/base (require ffi/unsafe) (define…

---

## [Basic Scheme stream question](https://racket.discourse.group/t/basic-scheme-stream-question/3439)

<div class="topic-metadata">

**Author:** [@AlexG](https://racket.discourse.group/u/AlexG)\
**Replies:** 7\
**Last updated:** [December 24, 2024, 11:27am UTC](https://racket.discourse.group/t/basic-scheme-stream-question/3439 "2024-12-24T11:27:33Z")

</div>

I wonder if any Scheme-whizz can help out with this basically noob question. Implementing the Catalan numbers using streams, why is the 2nd solution so much faster (factor of ~4) than the 1st and the 3rd? Technically t…

---

## [Is there a scheme implementation where the Garbage Collector is built within that Scheme?](https://racket.discourse.group/t/is-there-a-scheme-implementation-where-the-garbage-collector-is-built-within-that-scheme/3432)

<div class="topic-metadata">

**Author:** [@YongaTechnic](https://racket.discourse.group/u/YongaTechnic)\
**Replies:** 4\
**Last updated:** [December 21, 2024, 1:52am UTC](https://racket.discourse.group/t/is-there-a-scheme-implementation-where-the-garbage-collector-is-built-within-that-scheme/3432 "2024-12-21T01:52:40Z")

</div>

I am looking for a scheme implementation where the garbage collector is not built in a low level system programming language like C, but within the scheme itself? Can you point me in the right direction? Thanks

---

## [If I am to implement a continuous memory data structure like arrays or vectors in Scheme](https://racket.discourse.group/t/if-i-am-to-implement-a-continuous-memory-data-structure-like-arrays-or-vectors-in-scheme/3431)

<div class="topic-metadata">

**Author:** [@YongaTechnic](https://racket.discourse.group/u/YongaTechnic)\
**Replies:** 6\
**Last updated:** [December 19, 2024, 5:43pm UTC](https://racket.discourse.group/t/if-i-am-to-implement-a-continuous-memory-data-structure-like-arrays-or-vectors-in-scheme/3431 "2024-12-19T17:43:34Z")

</div>

Hi, How can someone allocate a continuous memory in scheme, and implement a vector like data structure with O(1) access without using lists in Scheme? Thanks

---

## [Installing racket-cas](https://racket.discourse.group/t/installing-racket-cas/3367)

<div class="topic-metadata">

**Author:** [@AlexG](https://racket.discourse.group/u/AlexG)\
**Replies:** 18\
**Last updated:** [December 17, 2024, 5:42pm UTC](https://racket.discourse.group/t/installing-racket-cas/3367 "2024-12-17T17:42:49Z")

</div>

I finally got round to trying @soegaard 's racket-cas and on the whole it seems OK but I'm not sure I've installed it correctly, there are some minor issues and the docs seem unclear. I downloaded the zip from github an…

---

## [Typed Struct Property: Problem with prop:custom-write](https://racket.discourse.group/t/typed-struct-property-problem-with-prop-custom-write/3419)

<div class="topic-metadata">

**Author:** [@wurmli](https://racket.discourse.group/u/wurmli)\
**Replies:** 6\
**Last updated:** [December 16, 2024, 12:01pm UTC](https://racket.discourse.group/t/typed-struct-property-problem-with-prop-custom-write/3419 "2024-12-16T12:01:38Z")

</div>

This is probably a question for Suzanne Soy. I tried her struct type properties, but the result is not exactly what I expected. #lang typed/racket (: display-point (-\> Point Output-Port (U #t #f 0 1) Any)) (define (di…

---

## [Copy-file and upi/cp fail to copy the entire file](https://racket.discourse.group/t/copy-file-and-upi-cp-fail-to-copy-the-entire-file/3406)

<div class="topic-metadata">

**Author:** [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Replies:** 3\
**Last updated:** [December 10, 2024, 11:16am UTC](https://racket.discourse.group/t/copy-file-and-upi-cp-fail-to-copy-the-entire-file/3406 "2024-12-10T11:16:39Z")

</div>

hello, a so weird error i do not expect answers but who knows.... when copying a file with copy-file or upi/cp: https://docs.racket-lang.org/upi/upi-cp.html it is truncated near the end (496kb file): \<TR\> \<TD\> …

---

## [Compile-time dispatch based on 'type'](https://racket.discourse.group/t/compile-time-dispatch-based-on-type/3405)

<div class="topic-metadata">

**Author:** [@Laurent.O](https://racket.discourse.group/u/Laurent.O)\
**Replies:** 8\
**Last updated:** [December 9, 2024, 8:29pm UTC](https://racket.discourse.group/t/compile-time-dispatch-based-on-type/3405 "2024-12-09T20:29:46Z")

</div>

I'm trying to move a runtime dispatch to compile time for efficiency reasons. In the runtime version, I have two 'types', A and B, and a procedure ref-proc that behaves differently depending on the 'type': #lang racket…

---

## [Evil C constructs](https://racket.discourse.group/t/evil-c-constructs/3402)

<div class="topic-metadata">

**Author:** [@matteo-daddio](https://racket.discourse.group/u/matteo-daddio)\
**Replies:** 1\
**Last updated:** [December 8, 2024, 5:27pm UTC](https://racket.discourse.group/t/evil-c-constructs/3402 "2024-12-08T17:27:28Z")

</div>

Many years ago I saw a conversation on Usenet about the so called evil C constructs like, for example, a while loop inside a switch statement. I’m interested in learning more about them. Does somebody know something? M…

---

## [Converting Struct to JSON](https://racket.discourse.group/t/converting-struct-to-json/3399)

<div class="topic-metadata">

**Author:** [@BenRaz123](https://racket.discourse.group/u/BenRaz123)\
**Replies:** 2\
**Last updated:** [December 6, 2024, 7:09pm UTC](https://racket.discourse.group/t/converting-struct-to-json/3399 "2024-12-06T19:09:01Z")

</div>

Hello, and thanks for answering my beginner question! If I have this struct in typed racket: #lang typed/racket (struct Person (\[name : String\] \[age : Number\] \[gender : Boolean\])) What's the easiest method of converti…

---

## [Matching Question](https://racket.discourse.group/t/matching-question/3391)

<div class="topic-metadata">

**Author:** [@Rugged](https://racket.discourse.group/u/Rugged)\
**Replies:** 3\
**Last updated:** [December 4, 2024, 1:45pm UTC](https://racket.discourse.group/t/matching-question/3391 "2024-12-04T13:45:24Z")

</div>

Hi, I am a bit confused why the following code doesn't produce an output: (match #f \[else (cond \[#f 'not-evaluated\] \[else 'also-not-evaluated\])\]) I would expect it to output 'also-not-evaluated …

---

## [Valid numeric entity refused by xexpr-\>xml](https://racket.discourse.group/t/valid-numeric-entity-refused-by-xexpr-xml/3393)

<div class="topic-metadata">

**Author:** [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Replies:** 2\
**Last updated:** [December 4, 2024, 12:15pm UTC](https://racket.discourse.group/t/valid-numeric-entity-refused-by-xexpr-xml/3393 "2024-12-04T12:15:06Z")

</div>

hello, i'm facing this strange error : xexpr-\>xml: contract violation; Not an Xexpr. Expected a string, symbol, valid numeric entity, comment, processing instruction, or list, given 2.2384341637010676 Context: '(DATA…

---

## [Expr/c and wrap-expr/c not error highlighting what contract states it is blaming](https://racket.discourse.group/t/expr-c-and-wrap-expr-c-not-error-highlighting-what-contract-states-it-is-blaming/3369)

<div class="topic-metadata">

**Author:** [@sora22](https://racket.discourse.group/u/sora22)\
**Replies:** 13\
**Last updated:** [December 2, 2024, 7:29pm UTC](https://racket.discourse.group/t/expr-c-and-wrap-expr-c-not-error-highlighting-what-contract-states-it-is-blaming/3369 "2024-12-02T19:29:43Z")

</div>

Don't know if I'm doing something incorrect or if this is just a bug. Been having a nightmare of a time trying to get expr/c and wrap-expr/c to work with the macros I've been writing. Whenever I attempt to use one of the…

---

## [Fxvector-\>cpointer?](https://racket.discourse.group/t/fxvector-cpointer/3385)

<div class="topic-metadata">

**Author:** [@Laurent.O](https://racket.discourse.group/u/Laurent.O)\
**Replies:** 1\
**Last updated:** [December 2, 2024, 1:48pm UTC](https://racket.discourse.group/t/fxvector-cpointer/3385 "2024-12-02T13:48:33Z")

</div>

Would it be possible for Racket to export something like fxvector-\>cpointer? Racket has flvector-\>cpointer, which allows me to make my own my-shared-flector struct work also for flvector without losing any efficiency (a…

---

## [Format for multimedia files?](https://racket.discourse.group/t/format-for-multimedia-files/3365)

<div class="topic-metadata">

**Author:** [@ToddOBryan](https://racket.discourse.group/u/ToddOBryan)\
**Replies:** 4\
**Last updated:** [December 1, 2024, 2:55pm UTC](https://racket.discourse.group/t/format-for-multimedia-files/3365 "2024-12-01T14:55:37Z")

</div>

Where is the description of what the format for multimedia files is? A lot of my early assignments include images and I'd like to be able to look at student text inside the files for analysis and grading.

---

## [FFI: 'file' size of a non-file file descriptor](https://racket.discourse.group/t/ffi-file-size-of-a-non-file-file-descriptor/3341)

<div class="topic-metadata">

**Author:** [@Laurent.O](https://racket.discourse.group/u/Laurent.O)\
**Replies:** 8\
**Last updated:** [November 29, 2024, 5:31pm UTC](https://racket.discourse.group/t/ffi-file-size-of-a-non-file-file-descriptor/3341 "2024-11-29T17:31:44Z")

</div>

I'm currently playing with shared memory spaces via the FFI, looking into shm\_open and mmap. After obtaining a file descriptor fd corresponding to an existing such space, I want to find out the underlying 'file' size. H…

---

## [Visualising programs and program transformations](https://racket.discourse.group/t/visualising-programs-and-program-transformations/3361)

<div class="topic-metadata">

**Author:** [@aanastasiou](https://racket.discourse.group/u/aanastasiou)\
**Replies:** 7\
**Last updated:** [November 29, 2024, 12:06am UTC](https://racket.discourse.group/t/visualising-programs-and-program-transformations/3361 "2024-11-29T00:06:17Z")

</div>

Hello Are there any existing tools that can take racket code and visualise it as the tree it is? I would like to visualise program transformations effected by macros. So, for example, given: (define a (+ 5 6)) The gr…

---

## [Why are struct constructors accessed through a parameter 10-20% faster than using the constructor directly?](https://racket.discourse.group/t/why-are-struct-constructors-accessed-through-a-parameter-10-20-faster-than-using-the-constructor-directly/3364)

<div class="topic-metadata">

**Author:** [@780nm](https://racket.discourse.group/u/780nm)\
**Replies:** 7\
**Last updated:** [November 28, 2024, 12:32am UTC](https://racket.discourse.group/t/why-are-struct-constructors-accessed-through-a-parameter-10-20-faster-than-using-the-constructor-directly/3364 "2024-11-28T00:32:05Z")

</div>

Hi! I was looking at the performance impacts of parameters for use in a language project and ran into some odd performance characteristics: accessing struct constructors through a parameterize-introduced binding appears…

---

## [Possible bug - Copy in vicinity of Comment Box copies contents of box](https://racket.discourse.group/t/possible-bug-copy-in-vicinity-of-comment-box-copies-contents-of-box/3294)

<div class="topic-metadata">

**Author:** [@ToddOBryan](https://racket.discourse.group/u/ToddOBryan)\
**Replies:** 3\
**Last updated:** [November 28, 2024, 12:19am UTC](https://racket.discourse.group/t/possible-bug-copy-in-vicinity-of-comment-box-copies-contents-of-box/3294 "2024-11-28T00:19:00Z")

</div>

I've been using a lot of comment boxes in starter code for student assignments, and if you right click on code near the comment box and choose Copy, you often paste the contents from the comment box instead of the select…

---

## [Conjunction and Disjunction of Streams](https://racket.discourse.group/t/conjunction-and-disjunction-of-streams/3352)

<div class="topic-metadata">

**Author:** [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Replies:** 0\
**Last updated:** [November 23, 2024, 2:57pm UTC](https://racket.discourse.group/t/conjunction-and-disjunction-of-streams/3352 "2024-11-23T14:57:31Z")

</div>

Hi, Racket Discourse. I am reimplementing some logic for my iterations over multiset-relations in terms of streams for to see what there is to see. The two basic operations to which I need access, are the conjunction (…

---

## [How to Require Macros from Untyped Racket in Typed Racket with Dependencies on Typed Imports?](https://racket.discourse.group/t/how-to-require-macros-from-untyped-racket-in-typed-racket-with-dependencies-on-typed-imports/3349)

<div class="topic-metadata">

**Author:** [@NoahStoryM](https://racket.discourse.group/u/NoahStoryM)\
**Replies:** 1\
**Last updated:** [November 25, 2024, 6:13pm UTC](https://racket.discourse.group/t/how-to-require-macros-from-untyped-racket-in-typed-racket-with-dependencies-on-typed-imports/3349 "2024-11-25T18:13:58Z")

</div>

How to Require Macros from Untyped Racket in Typed Racket with Dependencies on Typed Imports? I'm facing an issue when trying to require a macro defined in an untyped Racket module into a Typed Racket module. The macro …

---

## [Racket Compilation](https://racket.discourse.group/t/racket-compilation/3347)

<div class="topic-metadata">

**Author:** [@Rugged](https://racket.discourse.group/u/Rugged)\
**Replies:** 2\
**Last updated:** [November 25, 2024, 6:10pm UTC](https://racket.discourse.group/t/racket-compilation/3347 "2024-11-25T18:10:28Z")

</div>

Hi, I want to learn about how the racket is compiled ? What is a good reference or paper? Thanks

---

## [Clever Way to Check Unordered List Equality](https://racket.discourse.group/t/clever-way-to-check-unordered-list-equality/2919)

<div class="topic-metadata">

**Author:** [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Replies:** 20\
**Last updated:** [November 23, 2024, 5:20pm UTC](https://racket.discourse.group/t/clever-way-to-check-unordered-list-equality/2919 "2024-11-23T17:20:33Z")

</div>

Hi, Racket Discourse! Just a quick one today: Have any of you come across a "clever" way to check for unordered list equality? I've come up with this (low-effort) snippet, so far: (define (and-reduce f tree-a tree-b) …

---

## [Typed Racket mutable hash sets](https://racket.discourse.group/t/typed-racket-mutable-hash-sets/3339)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 6\
**Last updated:** [November 23, 2024, 9:01am UTC](https://racket.discourse.group/t/typed-racket-mutable-hash-sets/3339 "2024-11-23T09:01:35Z")

</div>

I asked about this a few years ago but cannot find a reply. Does Typed Racket have mutable hash sets? If so, I can't figure out how to use them. In particular, mutable-seteq seems to be unavailable, not even to make a…

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

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