# Questions & Answers

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

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

**Page:** 14

---

## [Self-documented Racket source code](https://racket.discourse.group/t/self-documented-racket-source-code/2820)

<div class="topic-metadata">

**Author:** [@Tyrn](https://racket.discourse.group/u/Tyrn)\
**Replies:** 12\
**Last updated:** [May 8, 2024, 12:31pm UTC](https://racket.discourse.group/t/self-documented-racket-source-code/2820 "2024-05-08T12:31:36Z")

</div>

Hi, Inspecting bits and pieces that come my way I learned that there are no docstrings in Racket. One can write his docs with Scribble (how?), upload it online and even see the relevant docs in an IDE while hovering one…

---

## [Parser combinator in Typed Racket: how to define the type constructor for the parser?](https://racket.discourse.group/t/parser-combinator-in-typed-racket-how-to-define-the-type-constructor-for-the-parser/2909)

<div class="topic-metadata">

**Author:** [@yossarian](https://racket.discourse.group/u/yossarian)\
**Replies:** 1\
**Last updated:** [May 7, 2024, 4:06pm UTC](https://racket.discourse.group/t/parser-combinator-in-typed-racket-how-to-define-the-type-constructor-for-the-parser/2909 "2024-05-07T16:06:35Z")

</div>

I am trying to translate the nice Haskell tutorial by Stephen Diehl on parser combinators in Typed Racket. However, I am already stuck when trying to define the parametric Parser type. Haskell: newtype Parser a = Parser…

---

## [Choosing good names](https://racket.discourse.group/t/choosing-good-names/2900)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 4\
**Last updated:** [May 6, 2024, 6:16pm UTC](https://racket.discourse.group/t/choosing-good-names/2900 "2024-05-06T18:16:17Z")

</div>

Choosing good names is said to be one of the most difficult things to so in programming. I'm looking for some advice here. Let's say I want to talk about an onion in a Racket program. It's somewhat obvious to call it …

---

## [Performance comparison between (append (reverse a) b)) and (foldl cons b a))](https://racket.discourse.group/t/performance-comparison-between-append-reverse-a-b-and-foldl-cons-b-a/2903)

<div class="topic-metadata">

**Author:** [@NeraSnow](https://racket.discourse.group/u/NeraSnow)\
**Replies:** 7\
**Last updated:** [May 6, 2024, 2:40pm UTC](https://racket.discourse.group/t/performance-comparison-between-append-reverse-a-b-and-foldl-cons-b-a/2903 "2024-05-06T14:40:23Z")

</div>

I have the following code example. I am wondering if method1 is slower than method2? I want to write a benchmark program, but I don't have any prior experience in this. #lang racket (define (method1 a b) (append (rev…

---

## [How to install the "drracket-cmdline-args" (and other) plugin?](https://racket.discourse.group/t/how-to-install-the-drracket-cmdline-args-and-other-plugin/2892)

<div class="topic-metadata">

**Author:** [@frodeaux](https://racket.discourse.group/u/frodeaux)\
**Replies:** 2\
**Last updated:** [April 29, 2024, 6:44pm UTC](https://racket.discourse.group/t/how-to-install-the-drracket-cmdline-args-and-other-plugin/2892 "2024-04-29T18:44:13Z")

</div>

I had no problem locating a reference to this plugin for DrRacket, which allows specifying arguments to a script when it is run from DrRacket, but I can find nothing on where to obtain the plugin and how to install it! …

---

## [Efficiently updating nested data structures in Racket](https://racket.discourse.group/t/efficiently-updating-nested-data-structures-in-racket/2877)

<div class="topic-metadata">

**Author:** [@rvdalen](https://racket.discourse.group/u/rvdalen)\
**Replies:** 12\
**Last updated:** [April 27, 2024, 8:09pm UTC](https://racket.discourse.group/t/efficiently-updating-nested-data-structures-in-racket/2877 "2024-04-27T20:09:06Z")

</div>

I am trying to write some code that updates immutable nested data structures. There does not seem to be good support for this in base Racket, and the internet seems to point to using the lens library for this. The lens…

---

## [How to evaluate code with function definitions in scribble](https://racket.discourse.group/t/how-to-evaluate-code-with-function-definitions-in-scribble/2888)

<div class="topic-metadata">

**Author:** [@oomaschloom](https://racket.discourse.group/u/oomaschloom)\
**Replies:** 2\
**Last updated:** [April 27, 2024, 4:53am UTC](https://racket.discourse.group/t/how-to-evaluate-code-with-function-definitions-in-scribble/2888 "2024-04-27T04:53:04Z")

</div>

Hi folks, I can't get an example to evaluate when it has define in it. I've tried lots of stuff. The example in the scribble documentation works, but that uses typed racket. I don't want to use typed racket: @examples\[…

---

## [Why isn't my macro hygienic?](https://racket.discourse.group/t/why-isnt-my-macro-hygienic/2881)

<div class="topic-metadata">

**Author:** [@xiaoyu2006](https://racket.discourse.group/u/xiaoyu2006)\
**Replies:** 8\
**Last updated:** [April 24, 2024, 2:15pm UTC](https://racket.discourse.group/t/why-isnt-my-macro-hygienic/2881 "2024-04-24T14:15:43Z")

</div>

Sorry for my newbie metaprogramming question. Say I have this macro: #lang racket/base (require (for-syntax racket/base)) ;; Depends on map, eval, quote (define-syntax (eval-emit stx) (syntax-case stx () \[(\_ exp…

---

## [Turn-based games in typed Racket](https://racket.discourse.group/t/turn-based-games-in-typed-racket/2876)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 1\
**Last updated:** [April 23, 2024, 4:02pm UTC](https://racket.discourse.group/t/turn-based-games-in-typed-racket/2876 "2024-04-23T16:02:43Z")

</div>

How can one do something like \[Turn-Based Games\] Turn-Based Games in Typed Racket? The trouble is that each game one might implement requires its own types for Side, GameState, and MoveChoice. This presumably affects t…

---

## [Is this expected output for call-with-composable-continuation?](https://racket.discourse.group/t/is-this-expected-output-for-call-with-composable-continuation/2875)

<div class="topic-metadata">

**Author:** [@Trung0246](https://racket.discourse.group/u/Trung0246)\
**Replies:** 2\
**Last updated:** [April 22, 2024, 9:32pm UTC](https://racket.discourse.group/t/is-this-expected-output-for-call-with-composable-continuation/2875 "2024-04-22T21:32:50Z")

</div>

\#lang racket/base (let (\[tag (make-continuation-prompt-tag)\]) (println "111") (println (string-append "222" (call-with-continuation-prompt (lambda () (let (\[data 0\]) (println (string-append "333" (c…

---

## [Transitive thread suspension for pausing computations made up of nested threads](https://racket.discourse.group/t/transitive-thread-suspension-for-pausing-computations-made-up-of-nested-threads/2867)

<div class="topic-metadata">

**Author:** [@gregr](https://racket.discourse.group/u/gregr)\
**Replies:** 7\
**Last updated:** [April 20, 2024, 2:18pm UTC](https://racket.discourse.group/t/transitive-thread-suspension-for-pausing-computations-made-up-of-nested-threads/2867 "2024-04-20T14:18:48Z")

</div>

I'm interested in running a pause-able computation as a separate thread that may itself spawn its own threads. I'd like to be able to pause the parent thread, and have it transitively pause the child threads it has spaw…

---

## [Navigation through (top-level) definitions in DrRacket](https://racket.discourse.group/t/navigation-through-top-level-definitions-in-drracket/2807)

<div class="topic-metadata">

**Author:** [@yossarian](https://racket.discourse.group/u/yossarian)\
**Replies:** 4\
**Last updated:** [April 16, 2024, 8:59pm UTC](https://racket.discourse.group/t/navigation-through-top-level-definitions-in-drracket/2807 "2024-04-16T20:59:14Z")

</div>

Hi, As a new user of (Dr)Racket I really miss a keyboard-based way to navigate through the different definitions of a .rkt file. I often forgot the name (or the existence) of a function that I have written before, and g…

---

## [Kill-safe cleanup of locally created threads](https://racket.discourse.group/t/kill-safe-cleanup-of-locally-created-threads/2862)

<div class="topic-metadata">

**Author:** [@gregr](https://racket.discourse.group/u/gregr)\
**Replies:** 1\
**Last updated:** [April 16, 2024, 12:25pm UTC](https://racket.discourse.group/t/kill-safe-cleanup-of-locally-created-threads/2862 "2024-04-16T12:25:10Z")

</div>

I'm interested in ensuring kill-safe cleanup of locally created threads in an arbitrary execution context. For instance, a user might run my code in a thread that is not managed by a custodian, which they then kill at a…

---

## [Main file name of module in https://pkgs.racket-lang.org/](https://racket.discourse.group/t/main-file-name-of-module-in-https-pkgs-racket-lang-org/2856)

<div class="topic-metadata">

**Author:** [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Replies:** 2\
**Last updated:** [April 10, 2024, 1:10pm UTC](https://racket.discourse.group/t/main-file-name-of-module-in-https-pkgs-racket-lang-org/2856 "2024-04-10T13:10:42Z")

</div>

Bonjour, i have a question about Racket's package. First due to another answer in a thread i have to say,once and only,that i do not respond to false answer about any of my project that would lead to polemic's long an…

---

## [Supporting displaced vectors & arrays in Racket](https://racket.discourse.group/t/supporting-displaced-vectors-arrays-in-racket/2858)

<div class="topic-metadata">

**Author:** [@mthom](https://racket.discourse.group/u/mthom)\
**Replies:** 3\
**Last updated:** [April 8, 2024, 12:42am UTC](https://racket.discourse.group/t/supporting-displaced-vectors-arrays-in-racket/2858 "2024-04-08T00:42:47Z")

</div>

Common Lisp has a nice feature for creating displaced arrays (or views, or slices, or ...) as exemplified in this interaction: CL-USER 29 \> (setq my-array (make-array '(2 2) :initial-contents '((a11 a12) (a13 a23)))) #2…

---

## [How to vertically-align number-entries in Scribble HTML bibliographies?](https://racket.discourse.group/t/how-to-vertically-align-number-entries-in-scribble-html-bibliographies/2650)

<div class="topic-metadata">

**Author:** [@encomer](https://racket.discourse.group/u/encomer)\
**Replies:** 1\
**Last updated:** [April 7, 2024, 11:07pm UTC](https://racket.discourse.group/t/how-to-vertically-align-number-entries-in-scribble-html-bibliographies/2650 "2024-04-07T23:07:21Z")

</div>

When rendering a scribble HTML document bibliography (using the number-style), the numbers at each entry are vertically aligned to the center. For example, with the following code: #lang scribble/manual @require\[scribl…

---

## [Does Ruckus still work?](https://racket.discourse.group/t/does-ruckus-still-work/2838)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 1\
**Last updated:** [April 6, 2024, 6:03pm UTC](https://racket.discourse.group/t/does-ruckus-still-work/2838 "2024-04-06T18:03:20Z")

</div>

When I run the sample first Rucku program as instructed in 2 Getting Your Ruckus On #lang ruckus (sphere 200) it fails. It writes out a lot of C code on my terminal, then complains generate-compile-and-link: error…

---

## [Else: not allowed as an expression in: else](https://racket.discourse.group/t/else-not-allowed-as-an-expression-in-else/2848)

<div class="topic-metadata">

**Author:** [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Replies:** 9\
**Last updated:** [April 4, 2024, 4:05am UTC](https://racket.discourse.group/t/else-not-allowed-as-an-expression-in-else/2848 "2024-04-04T04:05:39Z")

</div>

\> (if #t 3 else) . else: not allowed as an expression in: else what is the real cause of the error? \> (if #t 3 toto) 3 in the context of a macro 'if' why is the 'else' reserved in scheme? (i would understand better th…

---

## [Using formlets from/with typed/racket, formlet-process and typing](https://racket.discourse.group/t/using-formlets-from-with-typed-racket-formlet-process-and-typing/2834)

<div class="topic-metadata">

**Author:** [@gabre](https://racket.discourse.group/u/gabre)\
**Replies:** 2\
**Last updated:** [March 30, 2024, 6:10pm UTC](https://racket.discourse.group/t/using-formlets-from-with-typed-racket-formlet-process-and-typing/2834 "2024-03-30T18:10:04Z")

</div>

I am trying to use formlets from typed/racket. I have the following racket module: #lang racket (require web-server/formlets/syntax) (require web-server/formlets/input) (require "blog-core-model.rkt") (provide new-p…

---

## [Break out of the cycle. What's the Racket way alternative?](https://racket.discourse.group/t/break-out-of-the-cycle-whats-the-racket-way-alternative/2814)

<div class="topic-metadata">

**Author:** [@Tyrn](https://racket.discourse.group/u/Tyrn)\
**Replies:** 34\
**Last updated:** [March 30, 2024, 2:53am UTC](https://racket.discourse.group/t/break-out-of-the-cycle-whats-the-racket-way-alternative/2814 "2024-03-30T02:53:04Z")

</div>

Hi, Iterating through a string is a piece of cake: (for (\[c "Hello"\]) (display c) (newline)) Even in a more sophisticated way: (define (list-chars str) (for (\[c str\] \[i (in-naturals)\]) (p…

---

## [A library for rearranging filter map join, etc. Clojure style](https://racket.discourse.group/t/a-library-for-rearranging-filter-map-join-etc-clojure-style/2841)

<div class="topic-metadata">

**Author:** [@Tyrn](https://racket.discourse.group/u/Tyrn)\
**Replies:** 7\
**Last updated:** [March 29, 2024, 6:19am UTC](https://racket.discourse.group/t/a-library-for-rearranging-filter-map-join-etc-clojure-style/2841 "2024-03-29T06:19:34Z")

</div>

Hi, I've seen a Racket library which allows for structuring filtering and mapping Clojure style, like this: (-\>\> (-\> (cs/replace authors #"\\"(?:\\\\.|\[^\\"\\\\\])\*\\"" " ") ;; Remove quoted substrings. (cs/repla…

---

## [Custom sort with a comparator](https://racket.discourse.group/t/custom-sort-with-a-comparator/2839)

<div class="topic-metadata">

**Author:** [@Tyrn](https://racket.discourse.group/u/Tyrn)\
**Replies:** 7\
**Last updated:** [March 27, 2024, 7:57pm UTC](https://racket.discourse.group/t/custom-sort-with-a-comparator/2839 "2024-03-27T19:57:53Z")

</div>

Hi, I want nothing fancy: a sort function (from a library), taking for arguments a list or a vector (of strings, in my case) and a comparator which I want to write myself according to my needs. The comparators are desc…

---

## [Importing in r6rs](https://racket.discourse.group/t/importing-in-r6rs/2840)

<div class="topic-metadata">

**Author:** [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Replies:** 1\
**Last updated:** [March 27, 2024, 12:18am UTC](https://racket.discourse.group/t/importing-in-r6rs/2840 "2024-03-27T00:18:43Z")

</div>

hello, how can i import a library in r6rs i have this working in Racket : (require "../Scheme-PLUS-for-Racket/main/Scheme-PLUS-for-Racket/src/array.rkt") Welcome to DrRacket, version 8.12 \[cs\]. Language: r6rs, with …

---

## [Rewind a port (file) or other method?](https://racket.discourse.group/t/rewind-a-port-file-or-other-method/2837)

<div class="topic-metadata">

**Author:** [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Replies:** 6\
**Last updated:** [March 26, 2024, 10:36pm UTC](https://racket.discourse.group/t/rewind-a-port-file-or-other-method/2837 "2024-03-26T22:36:35Z")

</div>

hello, i just want to skip comments and blank lines at the beginning of a file, i find a solution that rewind the port/file using file-position but is there other method/solution? (require (only-in racket/base \[do d…

---

## [Pattern matching 'Some' and 'None'](https://racket.discourse.group/t/pattern-matching-some-and-none/2819)

<div class="topic-metadata">

**Author:** [@mohanr](https://racket.discourse.group/u/mohanr)\
**Replies:** 3\
**Last updated:** [March 26, 2024, 5:28am UTC](https://racket.discourse.group/t/pattern-matching-some-and-none/2819 "2024-03-26T05:28:57Z")

</div>

Hi I am porting SML to Racket. Managed to create a recursive data type like this. I reuse a macro by Alexis King for this. (define-datatype Expr ( BoolValue Boolean ) ( IntValue Number ) ( Op Expr (U Plus GTE…

---

## [SRFI 48: is it possible to get rid of the decimal point?](https://racket.discourse.group/t/srfi-48-is-it-possible-to-get-rid-of-the-decimal-point/2836)

<div class="topic-metadata">

**Author:** [@Tyrn](https://racket.discourse.group/u/Tyrn)\
**Replies:** 4\
**Last updated:** [March 25, 2024, 6:32pm UTC](https://racket.discourse.group/t/srfi-48-is-it-possible-to-get-rid-of-the-decimal-point/2836 "2024-03-25T18:32:22Z")

</div>

Hi, I've got this: "helpers.rkt"\> (format "~0,0F" 1.22) "1." "helpers.rkt"\> (format "~0,0F" 1.55) "2." I'd be satisfied with the same without the decimal point. Is there a way?

---

## [Question about #lang reader](https://racket.discourse.group/t/question-about-lang-reader/2825)

<div class="topic-metadata">

**Author:** [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Replies:** 1\
**Last updated:** [March 24, 2024, 9:21am UTC](https://racket.discourse.group/t/question-about-lang-reader/2825 "2024-03-24T09:21:37Z")

</div>

hello, i try to add support for r6rs in my SRFI-105 reader, used this way: #lang reader "../src/SRFI-105.rkt" it used to return a module like this, reading an input file stream : (define (literal-read-syntax src in) …

---

## [Question about gensym](https://racket.discourse.group/t/question-about-gensym/2826)

<div class="topic-metadata">

**Author:** [@Antigen-11](https://racket.discourse.group/u/Antigen-11)\
**Replies:** 2\
**Last updated:** [March 23, 2024, 11:46am UTC](https://racket.discourse.group/t/question-about-gensym/2826 "2024-03-23T11:46:44Z")

</div>

Hello, everyone. I want to generate unique names containing only alphanumeric characters and '\_' in racket. Is it safe to use gensym? For example, (define (make-unique-name) (gensym 'my\_name)) Can I be sure (make-…

---

## [EBNF dialect used in the Racket docs](https://racket.discourse.group/t/ebnf-dialect-used-in-the-racket-docs/2821)

<div class="topic-metadata">

**Author:** [@Tyrn](https://racket.discourse.group/u/Tyrn)\
**Replies:** 6\
**Last updated:** [March 23, 2024, 6:09am UTC](https://racket.discourse.group/t/ebnf-dialect-used-in-the-racket-docs/2821 "2024-03-23T06:09:18Z")

</div>

Hi, Is there somewhere a description of the subj?

---

## [Local versus github links in scribble](https://racket.discourse.group/t/local-versus-github-links-in-scribble/2818)

<div class="topic-metadata">

**Author:** [@joskoot](https://racket.discourse.group/u/joskoot)\
**Replies:** 4\
**Last updated:** [March 22, 2024, 7:15pm UTC](https://racket.discourse.group/t/local-versus-github-links-in-scribble/2818 "2024-03-22T19:15:08Z")

</div>

local versus github links in scribble defmodule and hyperlinks act differently when installing from github or locally. I resolved the problem as follows: @(define-for-syntax local #f) @; set to #t when installing loca…

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

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