# Questions & Answers

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

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

**Page:** 27

---

## [What is the proper way to close a dialog box?](https://racket.discourse.group/t/what-is-the-proper-way-to-close-a-dialog-box/1233)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 2\
**Last updated:** [August 15, 2022, 6:49pm UTC](https://racket.discourse.group/t/what-is-the-proper-way-to-close-a-dialog-box/1233 "2022-08-15T18:49:05Z")

</div>

What is the proper way to close a dialog box? I admit I haven't read everything in the GUI library yet and I'm trying to learn as I go, but I feel like I must be overcomplicating something here. I looked at the code f…

---

## [New vs instantiate vs make-object](https://racket.discourse.group/t/new-vs-instantiate-vs-make-object/1230)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 2\
**Last updated:** [August 15, 2022, 4:26pm UTC](https://racket.discourse.group/t/new-vs-instantiate-vs-make-object/1230 "2022-08-15T16:26:30Z")

</div>

6.3 Creating Objects shows three separate methods for creating objects: (make-object class init-v ...) → object? (new class-expr (id by-name-expr) ...) (instantiate class-expr (by-pos-expr ...) (id by-name-expr) ...) I…

---

## [Recommended Approach to Locks](https://racket.discourse.group/t/recommended-approach-to-locks/1228)

<div class="topic-metadata">

**Author:** [@bsilver](https://racket.discourse.group/u/bsilver)\
**Replies:** 4\
**Last updated:** [August 15, 2022, 1:11pm UTC](https://racket.discourse.group/t/recommended-approach-to-locks/1228 "2022-08-15T13:11:23Z")

</div>

In some utilities I previously created using non-Racket languages, I'd track information referenced by multiple routines by using a struct with a R/W lock as a field; then I could create functions that would lock and def…

---

## [Typed abstract methods / typed interfaces](https://racket.discourse.group/t/typed-abstract-methods-typed-interfaces/1197)

<div class="topic-metadata">

**Author:** [@scolobb](https://racket.discourse.group/u/scolobb)\
**Replies:** 7\
**Last updated:** [August 11, 2022, 4:42pm UTC](https://racket.discourse.group/t/typed-abstract-methods-typed-interfaces/1197 "2022-08-11T16:42:56Z")

</div>

Hello, I would like to define typed classes with abstract methods / interfaces. This is the approach I am going for at the moment: (define my-interface% (class object% (super-new) (: abstract-increment (-\> …

---

## [Inheritance of parameterized typed classes](https://racket.discourse.group/t/inheritance-of-parameterized-typed-classes/1217)

<div class="topic-metadata">

**Author:** [@scolobb](https://racket.discourse.group/u/scolobb)\
**Replies:** 0\
**Last updated:** [August 8, 2022, 6:40pm UTC](https://racket.discourse.group/t/inheritance-of-parameterized-typed-classes/1217 "2022-08-08T18:40:40Z")

</div>

Hi, Suppose I have the following typed class: (define parent% (class object% #:forall (a) (super-new) (: show-me (-\> a Void)) (define/public (show-me x) (displayln x)))) What is the best way to say …

---

## [How to measure an object size accurate](https://racket.discourse.group/t/how-to-measure-an-object-size-accurate/1202)

<div class="topic-metadata">

**Author:** [@dannypsnl](https://racket.discourse.group/u/dannypsnl)\
**Replies:** 8\
**Last updated:** [August 7, 2022, 7:00pm UTC](https://racket.discourse.group/t/how-to-measure-an-object-size-accurate/1202 "2022-08-07T19:00:18Z")

</div>

I make a draft macro called size which takes an object and measures the memory use: (define-syntax (size stx) (syntax-parse stx \[(\_ obj) #'(let (\[before-use (current-memory-use)\]) obj (defin…

---

## [The elegantest way to manipulate part of a list?](https://racket.discourse.group/t/the-elegantest-way-to-manipulate-part-of-a-list/1205)

<div class="topic-metadata">

**Author:** [@slbtty](https://racket.discourse.group/u/slbtty)\
**Replies:** 5\
**Last updated:** [August 6, 2022, 5:04pm UTC](https://racket.discourse.group/t/the-elegantest-way-to-manipulate-part-of-a-list/1205 "2022-08-06T17:04:08Z")

</div>

When I look at the “remove” functions of lisp, I noticed there are optional arguments :start :end to designate the part of the list you want to manipulate. http://clhs.lisp.se/Body/f\_rm\_rm.htm I cannot find an elegant …

---

## [Raise-argument-error](https://racket.discourse.group/t/raise-argument-error/1206)

<div class="topic-metadata">

**Author:** [@joskoot](https://racket.discourse.group/u/joskoot)\
**Replies:** 2\
**Last updated:** [August 6, 2022, 1:58pm UTC](https://racket.discourse.group/t/raise-argument-error/1206 "2022-08-06T13:58:56Z")

</div>

\#lang racket/base (raise-argument-error 'monkey "banana" 3 0 1 2 3 4 5 6 7 8 9) Yields error message monkey: contract violation expected: banana given: 3 argument position: 4th other arguments...: I want to see a…

---

## [How do I make Racket notice a SQLite update?](https://racket.discourse.group/t/how-do-i-make-racket-notice-a-sqlite-update/1201)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 3\
**Last updated:** [August 5, 2022, 5:53pm UTC](https://racket.discourse.group/t/how-do-i-make-racket-notice-a-sqlite-update/1201 "2022-08-05T17:53:34Z")

</div>

macOS Catalina comes with sqlite3 version 3.28. This version does not include the 'table\_list' pragma, so I upgraded to version 3.39.2 (the latest). I have checked the version number on the new version and verified tha…

---

## [How to run old version of racket and raco](https://racket.discourse.group/t/how-to-run-old-version-of-racket-and-raco/1200)

<div class="topic-metadata">

**Author:** [@marc](https://racket.discourse.group/u/marc)\
**Replies:** 3\
**Last updated:** [August 5, 2022, 2:42pm UTC](https://racket.discourse.group/t/how-to-run-old-version-of-racket-and-raco/1200 "2022-08-05T14:42:54Z")

</div>

I want to run some old code of mine that needs some racket version 7.7 code and relies on a bunch of packages. I am on Ubuntu and the current version I have is 8.5. First, should I still be able to run the old versions …

---

## [Tab-panel is not sized properly](https://racket.discourse.group/t/tab-panel-is-not-sized-properly/1196)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 0\
**Last updated:** [August 1, 2022, 8:00pm UTC](https://racket.discourse.group/t/tab-panel-is-not-sized-properly/1196 "2022-08-01T20:00:09Z")

</div>

Given this code: #lang racket/gui (define frame (new frame% \[label "Example"\])) (define panel (new vertical-panel% \[parent frame\] )) (define tab-panel (new tab-panel% …

---

## [Racket/gui fullscreen and parameters](https://racket.discourse.group/t/racket-gui-fullscreen-and-parameters/1190)

<div class="topic-metadata">

**Author:** [@dominik.pantucek](https://racket.discourse.group/u/dominik.pantucek)\
**Replies:** 4\
**Last updated:** [August 1, 2022, 12:52pm UTC](https://racket.discourse.group/t/racket-gui-fullscreen-and-parameters/1190 "2022-08-01T12:52:20Z")

</div>

I have a simple program like: #lang racket/gui (define current-width (make-parameter #f)) (define (run-fullscreen proc) (define window (new (class frame% (super-new) (define/override (on-size …

---

## [I can not close window completely created by racket on macOS 13 beta](https://racket.discourse.group/t/i-can-not-close-window-completely-created-by-racket-on-macos-13-beta/1166)

<div class="topic-metadata">

**Author:** [@ixnij](https://racket.discourse.group/u/ixnij)\
**Replies:** 21\
**Last updated:** [August 1, 2022, 10:04am UTC](https://racket.discourse.group/t/i-can-not-close-window-completely-created-by-racket-on-macos-13-beta/1166 "2022-08-01T10:04:13Z")

</div>

My racket version is 8.5. For example, when I opened the about window, I can't close it neither by clicking the red button nor by press C-w. other windows have the same problem. GUI - problem with delete-child - #5 …

---

## ["Deleting" a package?](https://racket.discourse.group/t/deleting-a-package/1191)

<div class="topic-metadata">

**Author:** [@greghendershott](https://racket.discourse.group/u/greghendershott)\
**Replies:** 2\
**Last updated:** [July 31, 2022, 2:18pm UTC](https://racket.discourse.group/t/deleting-a-package/1191 "2022-07-31T14:18:40Z")

</div>

This recent discussion reminded me I have an old package echonest that has failing tests -- and the tests can't ever pass again because the company no longer supplies that web API (IIRC Spotify bought them and shut down …

---

## [Syntax-local-introduce and module boundaries](https://racket.discourse.group/t/syntax-local-introduce-and-module-boundaries/1157)

<div class="topic-metadata">

**Author:** [@Kalimehtar](https://racket.discourse.group/u/Kalimehtar)\
**Replies:** 7\
**Last updated:** [July 28, 2022, 5:47pm UTC](https://racket.discourse.group/t/syntax-local-introduce-and-module-boundaries/1157 "2022-07-28T17:47:38Z")

</div>

If I use syntax-local-introduce inside one module, then it works: (define-syntax (require-macro stx) (syntax-local-introduce #'(require racket/math))) (define-syntax (define-macro stx) (syntax-local-introduce #'(de…

---

## [Possible bug in parser-tools lexer-srcloc](https://racket.discourse.group/t/possible-bug-in-parser-tools-lexer-srcloc/1189)

<div class="topic-metadata">

**Author:** [@jjsimpso](https://racket.discourse.group/u/jjsimpso)\
**Replies:** 0\
**Last updated:** [July 27, 2022, 3:59pm UTC](https://racket.discourse.group/t/possible-bug-in-parser-tools-lexer-srcloc/1189 "2022-07-27T15:59:31Z")

</div>

Using both Drracket and Emacs racket-mode, the error highlighting is sometimes incorrect in my custom lang(#lang magic). I finally found that the issue is that a literal '\\r' in the file's text leads to what appears to b…

---

## [Converting Scribble-generated single HTML to EPUB via Pandoc](https://racket.discourse.group/t/converting-scribble-generated-single-html-to-epub-via-pandoc/1188)

<div class="topic-metadata">

**Author:** [@ds26gte](https://racket.discourse.group/u/ds26gte)\
**Replies:** 3\
**Last updated:** [July 27, 2022, 3:29pm UTC](https://racket.discourse.group/t/converting-scribble-generated-single-html-to-epub-via-pandoc/1188 "2022-07-27T15:29:04Z")

</div>

Greetings, friiends. I've been trying to use Pandoc to create a readable EPUB from a Scribble-generated single HTML page. It works fine for everything except the math bits, which show up as verbatim LaTeX source inthe E…

---

## [Macro Template Syntax Quasi-Quote with Ellipses](https://racket.discourse.group/t/macro-template-syntax-quasi-quote-with-ellipses/1179)

<div class="topic-metadata">

**Author:** [@Liam.Gaudy](https://racket.discourse.group/u/Liam.Gaudy)\
**Replies:** 5\
**Last updated:** [July 25, 2022, 10:57pm UTC](https://racket.discourse.group/t/macro-template-syntax-quasi-quote-with-ellipses/1179 "2022-07-25T22:57:33Z")

</div>

I'm using the below as an example to ask the question. Please recall that case works like this: (case (+ 7 5) \[( 1 2 3) 'small\] \[( 10 11 12) 'big\]) Let's say I never need more than one match for the same body.…

---

## [Is that possible to create a "purely functional" language with #lang?](https://racket.discourse.group/t/is-that-possible-to-create-a-purely-functional-language-with-lang/1186)

<div class="topic-metadata">

**Author:** [@z2gr8339](https://racket.discourse.group/u/z2gr8339)\
**Replies:** 1\
**Last updated:** [July 25, 2022, 7:11pm UTC](https://racket.discourse.group/t/is-that-possible-to-create-a-purely-functional-language-with-lang/1186 "2022-07-25T19:11:25Z")

</div>

Please have a look on these questions: How to execute deterministic code from an untrusted third party safely? Defining a "purely functional" R5RS env in Racket Is that possible to create a new language (something lik…

---

## [How can I generate WXME files from some other external files?](https://racket.discourse.group/t/how-can-i-generate-wxme-files-from-some-other-external-files/1176)

<div class="topic-metadata">

**Author:** [@etaoinbe](https://racket.discourse.group/u/etaoinbe)\
**Replies:** 2\
**Last updated:** [July 24, 2022, 12:47pm UTC](https://racket.discourse.group/t/how-can-i-generate-wxme-files-from-some-other-external-files/1176 "2022-07-24T12:47:16Z")

</div>

how can I generate WXME files from some other external files? the decoding wxme chapter appearst to assume you already have a wxme file, I want to GENERATE a wxme file that can be edited afterwards in drracket

---

## [Am I barking up the wrong tree with HtDP?](https://racket.discourse.group/t/am-i-barking-up-the-wrong-tree-with-htdp/1169)

<div class="topic-metadata">

**Author:** [@okeefe77](https://racket.discourse.group/u/okeefe77)\
**Replies:** 7\
**Last updated:** [July 23, 2022, 4:18pm UTC](https://racket.discourse.group/t/am-i-barking-up-the-wrong-tree-with-htdp/1169 "2022-07-23T16:18:57Z")

</div>

I've been programming on and off both professionally and as a hobby for years and recently realized that the design and architecture of programs is a huge weakness for me. I tend to learn a language and then not know wh…

---

## [GUI - problem with delete-child](https://racket.discourse.group/t/gui-problem-with-delete-child/1160)

<div class="topic-metadata">

**Author:** [@jtp](https://racket.discourse.group/u/jtp)\
**Replies:** 5\
**Last updated:** [July 21, 2022, 9:01pm UTC](https://racket.discourse.group/t/gui-problem-with-delete-child/1160 "2022-07-21T21:01:31Z")

</div>

Below is a simple example of something which I am having trouble with. I want to be able to delete all the children of a frame, regardless of what they are. It seems like this should work but it errors out as shown be…

---

## [Newbie issue with read/write and SQL-NULL](https://racket.discourse.group/t/newbie-issue-with-read-write-and-sql-null/1162)

<div class="topic-metadata">

**Author:** [@KenMax](https://racket.discourse.group/u/KenMax)\
**Replies:** 2\
**Last updated:** [July 21, 2022, 1:42pm UTC](https://racket.discourse.group/t/newbie-issue-with-read-write-and-sql-null/1162 "2022-07-21T13:42:20Z")

</div>

My objective is to backup and restore a MYSQL table. I am selecting all of the rows with (define sql-rows (query-rows... I am dumping them to a file with (with-output-to-file "backup.dat" (lambda () (write sql-rows)... …

---

## [How can I redefine defintions in typed racket top level (repl)](https://racket.discourse.group/t/how-can-i-redefine-defintions-in-typed-racket-top-level-repl/1155)

<div class="topic-metadata">

**Author:** [@Inc0n](https://racket.discourse.group/u/Inc0n)\
**Replies:** 3\
**Last updated:** [July 16, 2022, 10:47pm UTC](https://racket.discourse.group/t/how-can-i-redefine-defintions-in-typed-racket-top-level-repl/1155 "2022-07-16T22:47:22Z")

</div>

Edit: I have realised, the details in my post is flawed (the example) and incomplete, please see my reply here in this samep post, for the additional details I have put in. What version of Racket are you using? Racket 8…

---

## [Why is lazy faster than memo here?](https://racket.discourse.group/t/why-is-lazy-faster-than-memo-here/1151)

<div class="topic-metadata">

**Author:** [@Grafcube](https://racket.discourse.group/u/Grafcube)\
**Replies:** 5\
**Last updated:** [July 15, 2022, 12:37pm UTC](https://racket.discourse.group/t/why-is-lazy-faster-than-memo-here/1151 "2022-07-15T12:37:25Z")

</div>

Hi. I'm new to Racket and I'm learning functional programming. I was reading about lazy evaluation and memoize and I was testing it on this program. #lang lazy ;; #lang racket/base ;; (require memo) ;; (define/memoize…

---

## [Is it possible to unsafely assume sub-types in Typed Racket?](https://racket.discourse.group/t/is-it-possible-to-unsafely-assume-sub-types-in-typed-racket/1140)

<div class="topic-metadata">

**Author:** [@pcn](https://racket.discourse.group/u/pcn)\
**Replies:** 1\
**Last updated:** [July 11, 2022, 2:41pm UTC](https://racket.discourse.group/t/is-it-possible-to-unsafely-assume-sub-types-in-typed-racket/1140 "2022-07-11T14:41:20Z")

</div>

Typed Racket exposes unsafe primitives that make it possible to unsafely cast a value to an arbitrary type. Is it also possible to use existing unsafe utilities to somehow make Typed Racket assume that one type is anothe…

---

## [What's the common idea to represent types in Racket's LOP?](https://racket.discourse.group/t/whats-the-common-idea-to-represent-types-in-rackets-lop/1144)

<div class="topic-metadata">

**Author:** [@doublex](https://racket.discourse.group/u/doublex)\
**Replies:** 2\
**Last updated:** [July 11, 2022, 11:17am UTC](https://racket.discourse.group/t/whats-the-common-idea-to-represent-types-in-rackets-lop/1144 "2022-07-11T11:17:24Z")

</div>

Hi all, I'm new to designing languages in Racket and need some help with general techniques. Suppose I want to build a statically typed language (s-exp) on top of Racket. In my opinion, For the surface language, what …

---

## [Teaching systematic program design to industry folks?](https://racket.discourse.group/t/teaching-systematic-program-design-to-industry-folks/1130)

<div class="topic-metadata">

**Author:** [@jschuster](https://racket.discourse.group/u/jschuster)\
**Replies:** 2\
**Last updated:** [July 9, 2022, 10:46am UTC](https://racket.discourse.group/t/teaching-systematic-program-design-to-industry-folks/1130 "2022-07-09T10:46:57Z")

</div>

Hello, Racketeers! I'm part of a new initiative to teach software design at Google, and HtDP's idea of systematic program design has been on my mind lately. I recommended the book recently in an internal mailing list th…

---

## [Questions about Plot / plot3d](https://racket.discourse.group/t/questions-about-plot-plot3d/1134)

<div class="topic-metadata">

**Author:** [@JustinZed](https://racket.discourse.group/u/JustinZed)\
**Replies:** 2\
**Last updated:** [July 9, 2022, 12:30am UTC](https://racket.discourse.group/t/questions-about-plot-plot3d/1134 "2022-07-09T00:30:49Z")

</div>

I have several questions about the Plot library, especially plot3d. When clicking and dragging a 3D plot, the altitude won't go below zero, so I can't view the plot from below. Setting the altitude to a negative numbe…

---

## [How can I keep a REPL alive during \`read-eval-print-loop\` + \`with-handlers\` + a contract violation?](https://racket.discourse.group/t/how-can-i-keep-a-repl-alive-during-read-eval-print-loop-with-handlers-a-contract-violation/1126)

<div class="topic-metadata">

**Author:** [@benknoble](https://racket.discourse.group/u/benknoble)\
**Replies:** 4\
**Last updated:** [July 7, 2022, 4:27pm UTC](https://racket.discourse.group/t/how-can-i-keep-a-repl-alive-during-read-eval-print-loop-with-handlers-a-contract-violation/1126 "2022-07-07T16:27:33Z")

</div>

I have a program that starts a REPL via (read-eval-print-loop) that happens to be dynamically inside a with-handlers clause. And I noticed something equivalent to the following that might be related to error-escape-handl…

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

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