# Questions & Answers

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

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

**Page:** 26

---

## [Opportunities for indexing?](https://racket.discourse.group/t/opportunities-for-indexing/1321)

<div class="topic-metadata">

**Author:** [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Replies:** 2\
**Last updated:** [September 23, 2022, 3:26am UTC](https://racket.discourse.group/t/opportunities-for-indexing/1321 "2022-09-23T03:26:44Z")

</div>

Background: I was looking at the comments on Open defining file should jump to definition · Issue #273 · racket/drracket · GitHub I'm wondering at what points identifiers are gathered, and if they would be opportunities…

---

## [Getting the type of a (class) expression](https://racket.discourse.group/t/getting-the-type-of-a-class-expression/1302)

<div class="topic-metadata">

**Author:** [@scolobb](https://racket.discourse.group/u/scolobb)\
**Replies:** 4\
**Last updated:** [September 22, 2022, 11:14am UTC](https://racket.discourse.group/t/getting-the-type-of-a-class-expression/1302 "2022-09-22T11:14:26Z")

</div>

Hi, Consider the following typed class definition: (define my-class (class object% (super-new) (init-field \[x : Integer\]) (define/public (get-x) x))) I can easily get the type of this class in the REPL: …

---

## [Adding HTML attributes to Scribble \`subsubsection\`](https://racket.discourse.group/t/adding-html-attributes-to-scribble-subsubsection/1296)

<div class="topic-metadata">

**Author:** [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Replies:** 2\
**Last updated:** [September 19, 2022, 11:10am UTC](https://racket.discourse.group/t/adding-html-attributes-to-scribble-subsubsection/1296 "2022-09-19T11:10:41Z")

</div>

In a Scribble document, I'm using subsubsection, but don't want numbering - and the line above the title. If I add style="border: none; padding-top: 0px; margin-top: 1em;" to the generated HTML in the h5 tag, this has t…

---

## [Klunky structure code with generics](https://racket.discourse.group/t/klunky-structure-code-with-generics/1308)

<div class="topic-metadata">

**Author:** [@hendrikboom3](https://racket.discourse.group/u/hendrikboom3)\
**Replies:** 4\
**Last updated:** [September 18, 2022, 9:19pm UTC](https://racket.discourse.group/t/klunky-structure-code-with-generics/1308 "2022-09-18T21:19:57Z")

</div>

I am having trouble figuring out how to represent the dta structures I want in a convenient way. Here's a very stripped-down example, with comments indicating what I'm finding klunky. (I found classes confusing -- shou…

---

## [Access syntax object of defined procedure?](https://racket.discourse.group/t/access-syntax-object-of-defined-procedure/1301)

<div class="topic-metadata">

**Author:** [@wenzeljakob](https://racket.discourse.group/u/wenzeljakob)\
**Replies:** 2\
**Last updated:** [September 15, 2022, 2:52pm UTC](https://racket.discourse.group/t/access-syntax-object-of-defined-procedure/1301 "2022-09-15T14:52:51Z")

</div>

Dear all, I am looking into Racket with an interest in meta-programming/program transformations. Racket's macros & support for pattern-matching the AST are very powerful but appear somewhat static to me. They can be use…

---

## [Expansion and "enriching"](https://racket.discourse.group/t/expansion-and-enriching/1294)

<div class="topic-metadata">

**Author:** [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Replies:** 1\
**Last updated:** [September 12, 2022, 6:17pm UTC](https://racket.discourse.group/t/expansion-and-enriching/1294 "2022-09-12T18:17:34Z")

</div>

In Racket Mode I have a cache of fully expanded syntax. Some users of the cache need it to be "enriched", as done by expand (as opposed to expand-syntax). In one case I want to "warm" the cache from a compiled load hand…

---

## [Signature and unit](https://racket.discourse.group/t/signature-and-unit/1295)

<div class="topic-metadata">

**Author:** [@dannypsnl](https://racket.discourse.group/u/dannypsnl)\
**Replies:** 0\
**Last updated:** [September 10, 2022, 7:24am UTC](https://racket.discourse.group/t/signature-and-unit/1295 "2022-09-10T07:24:45Z")

</div>

If I define a signature, then the unit exports it has to implement all identifiers as I know, does there has any abstraction is that I can provide default implementation like replying unsupported with a brief interface l…

---

## [CS ≠ BC for call-with-values](https://racket.discourse.group/t/cs-bc-for-call-with-values/1284)

<div class="topic-metadata">

**Author:** [@joskoot](https://racket.discourse.group/u/joskoot)\
**Replies:** 4\
**Last updated:** [September 8, 2022, 12:03am UTC](https://racket.discourse.group/t/cs-bc-for-call-with-values/1284 "2022-09-08T00:03:42Z")

</div>

... Running the following program with DrRacket BC gives other results than DrRacket CS. Can someone tell me why? Is the difference intended? Thanks. ... #lang racket/base ; version 8.6 ; windows 10 enterprise ; run…

---

## [Help: \`make install\` fails on Termux](https://racket.discourse.group/t/help-make-install-fails-on-termux/934)

<div class="topic-metadata">

**Author:** [@spore](https://racket.discourse.group/u/spore)\
**Replies:** 9\
**Last updated:** [September 3, 2022, 3:04am UTC](https://racket.discourse.group/t/help-make-install-fails-on-termux/934 "2022-09-03T03:04:56Z")

</div>

I'm trying to compile Racket 8.4(cs) on my Android phone with Termux, because the version provided in their repo is too old (7.4 bc). I used ./configure --prefix=$PREFIX and it seems good, make also succeeded with no er…

---

## [Run infinite loop in future for message-passing style?](https://racket.discourse.group/t/run-infinite-loop-in-future-for-message-passing-style/1265)

<div class="topic-metadata">

**Author:** [@dannypsnl](https://racket.discourse.group/u/dannypsnl)\
**Replies:** 12\
**Last updated:** [September 2, 2022, 6:49am UTC](https://racket.discourse.group/t/run-infinite-loop-in-future-for-message-passing-style/1265 "2022-09-02T06:49:52Z")

</div>

I write the code like the following (struct process (fu ch)) (define (process-send pro msg) (async-channel-put (process-ch pro) msg)) (define (^friend my-name) (define ch (make-async-channel)) (define self (futu…

---

## [Passing INSTALL\_SETUP\_FLAGS to zuo](https://racket.discourse.group/t/passing-install-setup-flags-to-zuo/1260)

<div class="topic-metadata">

**Author:** [@bremner](https://racket.discourse.group/u/bremner)\
**Replies:** 5\
**Last updated:** [September 2, 2022, 2:06am UTC](https://racket.discourse.group/t/passing-install-setup-flags-to-zuo/1260 "2022-09-02T02:06:48Z")

</div>

In the Debian build I previously relied on PLT\_SETUP\_OPTIONS to pass --do-docs to (the equivalent of) raco setup. Is there a suggested new way? I found that bin/zuo . install INSTALL\_SETUP\_FLAGS="$whatever" works, b…

---

## [Documentation for -r/--script is incorrect](https://racket.discourse.group/t/documentation-for-r-script-is-incorrect/1270)

<div class="topic-metadata">

**Author:** [@jdjohnston](https://racket.discourse.group/u/jdjohnston)\
**Replies:** 1\
**Last updated:** [September 1, 2022, 1:46pm UTC](https://racket.discourse.group/t/documentation-for-r-script-is-incorrect/1270 "2022-09-01T13:46:17Z")

</div>

Racket Reference, section 18.1.4, "Command Line" states that -r \<file\> or --script \<file\> is like -t \<file\> -N \<file\> --. As racket --help shows it (correctly), -r/--script is essentially -f \<file\> -N \<file\> --. Option -…

---

## [Rich \`text%\` editors](https://racket.discourse.group/t/rich-text-editors/1267)

<div class="topic-metadata">

**Author:** [@LiberalArtist](https://racket.discourse.group/u/LiberalArtist)\
**Replies:** 2\
**Last updated:** [September 1, 2022, 11:36am UTC](https://racket.discourse.group/t/rich-text-editors/1267 "2022-09-01T11:36:23Z")

</div>

I'm interested in using text% from racket/gui for an application that needs a rich text editor. I'm interested in general in any existing work along these lines, but I have a very basic question to start with: How can I …

---

## [Documenting class fields](https://racket.discourse.group/t/documenting-class-fields/1258)

<div class="topic-metadata">

**Author:** [@scolobb](https://racket.discourse.group/u/scolobb)\
**Replies:** 2\
**Last updated:** [August 31, 2022, 8:58pm UTC](https://racket.discourse.group/t/documenting-class-fields/1258 "2022-08-31T20:58:44Z")

</div>

Hi, What is the canonical way to document class fields in Scribble? Consider for example the following code: #lang typed/racket (define my-class% (class object% (super-new) (init-field \[public-integer : Int…

---

## [Racket/gui: how to use canvas%'s init-auto-scrollbar method](https://racket.discourse.group/t/racket-gui-how-to-use-canvas-s-init-auto-scrollbar-method/1263)

<div class="topic-metadata">

**Author:** [@jjsimpso](https://racket.discourse.group/u/jjsimpso)\
**Replies:** 2\
**Last updated:** [August 31, 2022, 1:40am UTC](https://racket.discourse.group/t/racket-gui-how-to-use-canvas-s-init-auto-scrollbar-method/1263 "2022-08-31T01:40:55Z")

</div>

I'm developing a new canvas by subclassing canvas%. I would like for my new canvas to manage the scrollbars automatically and am attempting to setup automatic scrollbars with init-auto-scrollbars. My thought is that I …

---

## [Why ffi's \`\_list\` is bad syntax?](https://racket.discourse.group/t/why-ffis-list-is-bad-syntax/1264)

<div class="topic-metadata">

**Author:** [@dannypsnl](https://racket.discourse.group/u/dannypsnl)\
**Replies:** 1\
**Last updated:** [August 30, 2022, 9:09pm UTC](https://racket.discourse.group/t/why-ffis-list-is-bad-syntax/1264 "2022-08-30T21:09:40Z")

</div>

Code #lang racket (require ffi/unsafe) (\_fun (\_list io \_uint32) -\> \_uint32) Full error message: ffi.rkt:5:6: \_list: bad syntax in: (\_list io \_uint32) location...: ffi.rkt:5:6 context...: /Applications/Rac…

---

## [Where to report typos in the docs?](https://racket.discourse.group/t/where-to-report-typos-in-the-docs/1256)

<div class="topic-metadata">

**Author:** [@jgomo3](https://racket.discourse.group/u/jgomo3)\
**Replies:** 3\
**Last updated:** [August 27, 2022, 1:59pm UTC](https://racket.discourse.group/t/where-to-report-typos-in-the-docs/1256 "2022-08-27T13:59:17Z")

</div>

The documentation for gcd of the BSL language says Determines the greatest common divisor of two integers (exact or inexact). But it actually accepts many arguments. (The same happens in the lcm function). I was abo…

---

## [Purely Functional Data Structures anyone?](https://racket.discourse.group/t/purely-functional-data-structures-anyone/1246)

<div class="topic-metadata">

**Author:** [@dominik.pantucek](https://racket.discourse.group/u/dominik.pantucek)\
**Replies:** 10\
**Last updated:** [August 26, 2022, 8:30pm UTC](https://racket.discourse.group/t/purely-functional-data-structures-anyone/1246 "2022-08-26T20:30:17Z")

</div>

While working on my own non-TR implementation of PFDS RB Tree following\[1\] and heavily consulting the pfds implementation in the Racket package catalog\[2\]\[3\]\[4\], when trying to implement key deletion, I found an issue wi…

---

## [Running a selected set of check-expect settings](https://racket.discourse.group/t/running-a-selected-set-of-check-expect-settings/1252)

<div class="topic-metadata">

**Author:** [@jgomo3](https://racket.discourse.group/u/jgomo3)\
**Replies:** 3\
**Last updated:** [August 24, 2022, 10:17am UTC](https://racket.discourse.group/t/running-a-selected-set-of-check-expect-settings/1252 "2022-08-24T10:17:04Z")

</div>

How can I check only one single check-expect or a selection of those in DrRacket? All I know to do now is to run the whole file and review the reports from all check-expects, but having half-baked wish functions, it cou…

---

## [Unexpected behavior permutations vs in-permutations](https://racket.discourse.group/t/unexpected-behavior-permutations-vs-in-permutations/1253)

<div class="topic-metadata">

**Author:** [@simonls](https://racket.discourse.group/u/simonls)\
**Replies:** 2\
**Last updated:** [August 24, 2022, 1:28am UTC](https://racket.discourse.group/t/unexpected-behavior-permutations-vs-in-permutations/1253 "2022-08-24T01:28:05Z")

</div>

When I use permutations or in-permutations I get different orderings for the permutations returned, is there some good reason for that? From the documentation I would expect identical behaviour, it states: (in-permuta…

---

## [Can you save a jpeg image?](https://racket.discourse.group/t/can-you-save-a-jpeg-image/1192)

<div class="topic-metadata">

**Author:** [@KenMax](https://racket.discourse.group/u/KenMax)\
**Replies:** 4\
**Last updated:** [August 24, 2022, 1:11am UTC](https://racket.discourse.group/t/can-you-save-a-jpeg-image/1192 "2022-08-24T01:11:15Z")

</div>

I need to be able to rescale some jpeg images. The 2htdp/image library has bitmap and scale procedures, which is almost exactly what I need, except I have not found a way to save the image back as a jpeg, only as a png. …

---

## [\[BSL\] Would it be considered bad practice to name custom function with the same pattern as selectors?](https://racket.discourse.group/t/bsl-would-it-be-considered-bad-practice-to-name-custom-function-with-the-same-pattern-as-selectors/1251)

<div class="topic-metadata">

**Author:** [@jgomo3](https://racket.discourse.group/u/jgomo3)\
**Replies:** 1\
**Last updated:** [August 24, 2022, 12:08am UTC](https://racket.discourse.group/t/bsl-would-it-be-considered-bad-practice-to-name-custom-function-with-the-same-pattern-as-selectors/1251 "2022-08-24T00:08:02Z")

</div>

I'm reading How to Design Programs. This question is about the Beginning Student Language. Doing the exercise of the Graphical Editor, we define an structure like this: (define-struct editor \[pre post\]) Which implies…

---

## [Transforming the code to use recursion](https://racket.discourse.group/t/transforming-the-code-to-use-recursion/1236)

<div class="topic-metadata">

**Author:** [@erfan](https://racket.discourse.group/u/erfan)\
**Replies:** 21\
**Last updated:** [August 23, 2022, 12:07pm UTC](https://racket.discourse.group/t/transforming-the-code-to-use-recursion/1236 "2022-08-23T12:07:29Z")

</div>

Hi all! I have written a simple program that uses the imperative style to calculate prime numbers up to a given number. I understand however that imperative style (set!) should be avoided when possible and recursion is …

---

## [Pointful? : A mixin+interface for finding identified children](https://racket.discourse.group/t/pointful-a-mixin-interface-for-finding-identified-children/1247)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 7\
**Last updated:** [August 22, 2022, 10:51pm UTC](https://racket.discourse.group/t/pointful-a-mixin-interface-for-finding-identified-children/1247 "2022-08-22T22:51:44Z")

</div>

I'm running into a challenge with the GUI, I have a solution that I am considering putting into a module and posting on the package server. I'd like some feedback on whether this seems useful or if there's a better way…

---

## [How do I find the (dis|en)enabled status of a control?](https://racket.discourse.group/t/how-do-i-find-the-dis-en-enabled-status-of-a-control/1242)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 2\
**Last updated:** [August 20, 2022, 1:34am UTC](https://racket.discourse.group/t/how-do-i-find-the-dis-en-enabled-status-of-a-control/1242 "2022-08-20T01:34:29Z")

</div>

The Reference specifies how to set the enabled/disabled status of a window/control/etc, and there is also on-superwindow-enable, which provides a hook for handling state changes to a window's enabled/disabled status, but…

---

## [Number oddities](https://racket.discourse.group/t/number-oddities/1171)

<div class="topic-metadata">

**Author:** [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Replies:** 7\
**Last updated:** [August 19, 2022, 8:43pm UTC](https://racket.discourse.group/t/number-oddities/1171 "2022-08-19T20:43:50Z")

</div>

(No, the subject isn't about odd and even numbers. :wink: ) A part of this post is complaining :wink: and a part is asking for your experiences and advice. I'm currently reading the chapter on numbers in the Racket Ref…

---

## [Scribble: Pre rendered HTML](https://racket.discourse.group/t/scribble-pre-rendered-html/1216)

<div class="topic-metadata">

**Author:** [@soegaard](https://racket.discourse.group/u/soegaard)\
**Replies:** 5\
**Last updated:** [August 18, 2022, 7:51pm UTC](https://racket.discourse.group/t/scribble-pre-rendered-html/1216 "2022-08-18T19:51:51Z")

</div>

Hi All, I am working on pyffi a way to use Python libraries from Racket. As an example I want to use Pygments as a showcase. Pygments is a generic syntax highlighter and more than 500 languages are supported. It woul…

---

## [Rendering \`6/3\` in code example at prompt](https://racket.discourse.group/t/rendering-6-3-in-code-example-at-prompt/1238)

<div class="topic-metadata">

**Author:** [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Replies:** 3\
**Last updated:** [August 17, 2022, 7:23pm UTC](https://racket.discourse.group/t/rendering-6-3-in-code-example-at-prompt/1238 "2022-08-17T19:23:10Z")

</div>

With the help of scribble/example, I try to render this Scribble code: @examples\[ (integer? 6/3)\] This renders as \> (integer? 2) #t presumably because 6/3 is evaluated before rendering, maybe even before Scribble s…

---

## [What kind of spline does \`draw-spline\` draw?](https://racket.discourse.group/t/what-kind-of-spline-does-draw-spline-draw/1231)

<div class="topic-metadata">

**Author:** [@benknoble](https://racket.discourse.group/u/benknoble)\
**Replies:** 8\
**Last updated:** [August 16, 2022, 7:23pm UTC](https://racket.discourse.group/t/what-kind-of-spline-does-draw-spline-draw/1231 "2022-08-16T19:23:03Z")

</div>

Alternately: how can I convert points that I liked with draw-spline to points consistent with curve-to? I'm working on drawing some fire with racket/draw + pict (using the dc constructor for picts). Once I get the right…

---

## [Where can i find solutions to exercises from the book "How to Design Classes"](https://racket.discourse.group/t/where-can-i-find-solutions-to-exercises-from-the-book-how-to-design-classes/1199)

<div class="topic-metadata">

**Author:** [@recursia](https://racket.discourse.group/u/recursia)\
**Replies:** 4\
**Last updated:** [August 15, 2022, 9:27pm UTC](https://racket.discourse.group/t/where-can-i-find-solutions-to-exercises-from-the-book-how-to-design-classes/1199 "2022-08-15T21:27:35Z")

</div>

English is not my main language,sorry for bad grammar. Programming is my hobby. I just finished HtDP. As a person,who have never programmed before,it gave me a lot. There is a book How to design Classes (same authors of…

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

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