# Questions & Answers

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

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

**Page:** 35

---

## [Lazy, yet opportunistic streams](https://racket.discourse.group/t/lazy-yet-opportunistic-streams/369)

<div class="topic-metadata">

**Author:** [@dominik.pantucek](https://racket.discourse.group/u/dominik.pantucek)\
**Replies:** 1\
**Last updated:** [December 7, 2021, 9:27am UTC](https://racket.discourse.group/t/lazy-yet-opportunistic-streams/369 "2021-12-07T09:27:21Z")

</div>

While playing around with various ideas about how to approach rendering large (long) tables in uni-table\[1\], I realized that a lot of the processing work can be done lazily. However that would only postpone the actual wo…

---

## [Check-exn Reference entry question](https://racket.discourse.group/t/check-exn-reference-entry-question/362)

<div class="topic-metadata">

**Author:** [@rclayton](https://racket.discourse.group/u/rclayton)\
**Replies:** 4\
**Last updated:** [December 6, 2021, 10:45pm UTC](https://racket.discourse.group/t/check-exn-reference-entry-question/362 "2021-12-06T22:45:55Z")

</div>

The check-exn entry of the rackunit section of the Reference contains the sentence In the latter case, the exception raised must be an exn:fail?. This confuses me because exn:fail? is a predicate, not an exception. I t…

---

## [How to safely cast a \_pointer to \_bytes?](https://racket.discourse.group/t/how-to-safely-cast-a-pointer-to-bytes/364)

<div class="topic-metadata">

**Author:** [@kurinoku](https://racket.discourse.group/u/kurinoku)\
**Replies:** 6\
**Last updated:** [December 6, 2021, 7:26pm UTC](https://racket.discourse.group/t/how-to-safely-cast-a-pointer-to-bytes/364 "2021-12-06T19:26:07Z")

</div>

I'm using racket/draw/unsafe/cairo and a custom ffi for MagickWand C API. I have this definition, you can see the last parameter is \_bytes. (define-mwand MagickExportImagePixels (\_fun \_MagickWand-pointer \_size \_size \_s…

---

## [Contract for (λ (x . rest) x)](https://racket.discourse.group/t/contract-for-x-rest-x/325)

<div class="topic-metadata">

**Author:** [@badkins](https://racket.discourse.group/u/badkins)\
**Replies:** 2\
**Last updated:** [December 6, 2021, 7:21pm UTC](https://racket.discourse.group/t/contract-for-x-rest-x/325 "2021-12-06T19:21:01Z")

</div>

The documentation for -\>\* mentions a particular contract not matching (λ (x . rest) x) due to the rest args not being optional, but I was unable to find a contract that does match that function. What contract matches th…

---

## [Performance optimizations (by Typed Racket, or otherwise)](https://racket.discourse.group/t/performance-optimizations-by-typed-racket-or-otherwise/350)

<div class="topic-metadata">

**Author:** [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Replies:** 2\
**Last updated:** [December 6, 2021, 3:32pm UTC](https://racket.discourse.group/t/performance-optimizations-by-typed-racket-or-otherwise/350 "2021-12-06T15:32:06Z")

</div>

In the Racket Slack someone asked whether the optimizations by Typed Racket can be done from standard Racket. The answer was "yes", since Typed Racket is just a library. :slight\_smile: This made me curious. What kind of…

---

## [Pict color specifications](https://racket.discourse.group/t/pict-color-specifications/356)

<div class="topic-metadata">

**Author:** [@dominik.pantucek](https://racket.discourse.group/u/dominik.pantucek)\
**Replies:** 4\
**Last updated:** [December 5, 2021, 3:28pm UTC](https://racket.discourse.group/t/pict-color-specifications/356 "2021-12-05T15:28:35Z")

</div>

I am a bit confused about how the colors are specified in the pict package. The colorize\[1\] procedure allows any of the color/c\[2\] values to be used (although it is explicitly written in the documented contract what that…

---

## [Naming convention for X vs. a procedure that returns X](https://racket.discourse.group/t/naming-convention-for-x-vs-a-procedure-that-returns-x/299)

<div class="topic-metadata">

**Author:** [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Replies:** 5\
**Last updated:** [December 4, 2021, 10:37pm UTC](https://racket.discourse.group/t/naming-convention-for-x-vs-a-procedure-that-returns-x/299 "2021-12-04T22:37:13Z")

</div>

In my code, I sometimes have a pattern (define ... (define func-result (func ...)) ...) That is, I call a function func and want to bind the result of the function call to a local identifier. Now, in many cases it …

---

## [Where's the Racket wiki?](https://racket.discourse.group/t/wheres-the-racket-wiki/351)

<div class="topic-metadata">

**Author:** [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Replies:** 4\
**Last updated:** [December 4, 2021, 4:56pm UTC](https://racket.discourse.group/t/wheres-the-racket-wiki/351 "2021-12-04T16:56:46Z")

</div>

I'm sure I've seen the Racket wiki before. But I don't see it mentioned on the front page https://racket-lang.org/ under "Vibrant Community" nor under "Racket, the Ecosystem." When I do a web search racket programmi…

---

## [Running chez after building Racket?](https://racket.discourse.group/t/running-chez-after-building-racket/329)

<div class="topic-metadata">

**Author:** [@jbclements](https://racket.discourse.group/u/jbclements)\
**Replies:** 1\
**Last updated:** [December 2, 2021, 4:28pm UTC](https://racket.discourse.group/t/running-chez-after-building-racket/329 "2021-12-02T16:28:59Z")

</div>

Some users would like to be able to run Chez Scheme "with racket additions"; that is, the copy of Chez that is built as part of a Racket release. This used to be easy, when Chez was a separate repository. Since July 202…

---

## [Racket's match shows strange movements](https://racket.discourse.group/t/rackets-match-shows-strange-movements/289)

<div class="topic-metadata">

**Author:** [@cametan](https://racket.discourse.group/u/cametan)\
**Replies:** 14\
**Last updated:** [December 2, 2021, 1:46am UTC](https://racket.discourse.group/t/rackets-match-shows-strange-movements/289 "2021-12-02T01:46:49Z")

</div>

Hello. I'm trying translating the WhiteSpace language onto Racket, because it was originally written in Haskell, and that looks relatively easy to be written in Racket. As you know, Haskell uses a bunch of Pattern Matc…

---

## [Macros generating phase-0 parametric units](https://racket.discourse.group/t/macros-generating-phase-0-parametric-units/316)

<div class="topic-metadata">

**Author:** [@cperivol](https://racket.discourse.group/u/cperivol)\
**Replies:** 1\
**Last updated:** [November 30, 2021, 4:24pm UTC](https://racket.discourse.group/t/macros-generating-phase-0-parametric-units/316 "2021-11-30T16:24:19Z")

</div>

A few days ago I first found out about units and it seemed kind of nice. If I understand the motivation for units correctly I have been solving the same problem so far using closures (define (pseudo-unit param1 param2) …

---

## [Define forms for library API](https://racket.discourse.group/t/define-forms-for-library-api/317)

<div class="topic-metadata">

**Author:** [@rscho](https://racket.discourse.group/u/rscho)\
**Replies:** 3\
**Last updated:** [November 30, 2021, 2:59pm UTC](https://racket.discourse.group/t/define-forms-for-library-api/317 "2021-11-30T14:59:15Z")

</div>

Hi, I'm making a library where I have the following macro: (define-syntax (define-dataframe stx) (syntax-case stx () \[(\_ name args ...) (with-syntax (\[name-string (symbol-\>string (format-symbol "~a" #'…

---

## [Is this a sensible use of define-runtime-path](https://racket.discourse.group/t/is-this-a-sensible-use-of-define-runtime-path/266)

<div class="topic-metadata">

**Author:** [@Don](https://racket.discourse.group/u/Don)\
**Replies:** 13\
**Last updated:** [November 29, 2021, 4:32pm UTC](https://racket.discourse.group/t/is-this-a-sensible-use-of-define-runtime-path/266 "2021-11-29T16:32:53Z")

</div>

Is the following a sensible use of define-runtime-path so that when the code is in an executable, the user-path will be appropriate when run on a machine where the user-path is different: (require racket/runtime-path) …

---

## [Structs vs symbols for building an AST](https://racket.discourse.group/t/structs-vs-symbols-for-building-an-ast/286)

<div class="topic-metadata">

**Author:** [@joeld](https://racket.discourse.group/u/joeld)\
**Replies:** 4\
**Last updated:** [November 29, 2021, 4:45pm UTC](https://racket.discourse.group/t/structs-vs-symbols-for-building-an-ast/286 "2021-11-29T16:45:34Z")

</div>

I’m experimenting with having a Pollen project compile to an AST rather than directly to HTML-equivalent X-expressions. I notice that in other libraries, such as the xml library and the new commonmark library, transpare…

---

## [Ambiguous identifier binding (adding a pass to the reader)](https://racket.discourse.group/t/ambiguous-identifier-binding-adding-a-pass-to-the-reader/298)

<div class="topic-metadata">

**Author:** [@soegaard](https://racket.discourse.group/u/soegaard)\
**Replies:** 5\
**Last updated:** [November 29, 2021, 8:39am UTC](https://racket.discourse.group/t/ambiguous-identifier-binding-adding-a-pass-to-the-reader/298 "2021-11-29T08:39:48Z")

</div>

Hi All, I am experimenting with adding a new pass to the Skething language. Instead of read -\> expand -\> compile -\> evaluate I want to add an adjust pass: read -\> adjust -\> expand -\> compile -\> evaluate It's rela…

---

## [Sqlite3-connect crashes with "invalid memory reference", but only when racket/gui is required](https://racket.discourse.group/t/sqlite3-connect-crashes-with-invalid-memory-reference-but-only-when-racket-gui-is-required/239)

<div class="topic-metadata">

**Author:** [@simonls](https://racket.discourse.group/u/simonls)\
**Replies:** 11\
**Last updated:** [November 28, 2021, 8:02am UTC](https://racket.discourse.group/t/sqlite3-connect-crashes-with-invalid-memory-reference-but-only-when-racket-gui-is-required/239 "2021-11-28T08:02:58Z")

</div>

I have an app of medium complexity that uses sqlite, with recent racket versions (I think since racket 8.2 maybe 8.1 dot something) while trying to connect to the database I get an error that doesn't give a lot of clues: …

---

## [Any DrRacket hackers available to help on a quickscript?](https://racket.discourse.group/t/any-drracket-hackers-available-to-help-on-a-quickscript/251)

<div class="topic-metadata">

**Author:** [@countvajhula](https://racket.discourse.group/u/countvajhula)\
**Replies:** 13\
**Last updated:** [November 27, 2021, 11:16pm UTC](https://racket.discourse.group/t/any-drracket-hackers-available-to-help-on-a-quickscript/251 "2021-11-27T23:16:10Z")

</div>

Hi all, Emacs user here, but there's a feature I'd like to have for DrRacket users and could use some help with it: I'd like to be able to evaluate an expression on demand. This feature would be generally useful, but I…

---

## [Dispatching generic defaults on struct type](https://racket.discourse.group/t/dispatching-generic-defaults-on-struct-type/273)

<div class="topic-metadata">

**Author:** [@rscho](https://racket.discourse.group/u/rscho)\
**Replies:** 3\
**Last updated:** [November 26, 2021, 10:11am UTC](https://racket.discourse.group/t/dispatching-generic-defaults-on-struct-type/273 "2021-11-26T10:11:55Z")

</div>

Hi, I'd like to make a generic interface as such: #lang racket …

---

## [Best way to use contracts -- define/contract, contract-out, ...?](https://racket.discourse.group/t/best-way-to-use-contracts-define-contract-contract-out/247)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 12\
**Last updated:** [November 25, 2021, 11:47pm UTC](https://racket.discourse.group/t/best-way-to-use-contracts-define-contract-contract-out/247 "2021-11-25T23:47:01Z")

</div>

I make heavy use of define-contract in my code, since I like having the system do the work of catching when I pass the wrong thing from another function. I've seen other modules and documentation that leave the contract…

---

## [Run graphical hello world from command line](https://racket.discourse.group/t/run-graphical-hello-world-from-command-line/265)

<div class="topic-metadata">

**Author:** [@decuser](https://racket.discourse.group/u/decuser)\
**Replies:** 2\
**Last updated:** [November 25, 2021, 4:30pm UTC](https://racket.discourse.group/t/run-graphical-hello-world-from-command-line/265 "2021-11-25T16:30:16Z")

</div>

I have modified the example given at https://racket-lang.org/: #lang racket/gui (message-box "Hello, world" "hello world") It works fine in dr racket. How do I run it from the command line? I saved it in a file hello…

---

## [Package manager install followed by remove, keeps platform specific sub-packages?](https://racket.discourse.group/t/package-manager-install-followed-by-remove-keeps-platform-specific-sub-packages/256)

<div class="topic-metadata">

**Author:** [@simonls](https://racket.discourse.group/u/simonls)\
**Replies:** 2\
**Last updated:** [November 25, 2021, 5:59am UTC](https://racket.discourse.group/t/package-manager-install-followed-by-remove-keeps-platform-specific-sub-packages/256 "2021-11-25T05:59:53Z")

</div>

In another topic I noticed that when I install the libsqlite3 package and then remove it again, its platform specific sub package keeps being installed. I would have expected that it is removed with its parent package be…

---

## [Collection-file-path and expand-user-path](https://racket.discourse.group/t/collection-file-path-and-expand-user-path/255)

<div class="topic-metadata">

**Author:** [@Don](https://racket.discourse.group/u/Don)\
**Replies:** 1\
**Last updated:** [November 25, 2021, 2:13am UTC](https://racket.discourse.group/t/collection-file-path-and-expand-user-path/255 "2021-11-25T02:13:57Z")

</div>

If I use: (collection-file-path "alpha-bool.ss" "DG" "all") ;that returns: #path:/home/don/.plt-scheme/4.2.1/collects/DG/all/alpha-bool.ss When an executable of the program is made, does the "/home/don" portion of the…

---

## [Path function appropriate for](https://racket.discourse.group/t/path-function-appropriate-for/246)

<div class="topic-metadata">

**Author:** [@Don](https://racket.discourse.group/u/Don)\
**Replies:** 7\
**Last updated:** [November 24, 2021, 10:30pm UTC](https://racket.discourse.group/t/path-function-appropriate-for/246 "2021-11-24T22:30:54Z")

</div>

I can imagine defining file paths something like this: (define file1 (string-append (path-\>string (expand-user-path)) () "file1")) What is recommended for ? My current racket installation has: (string-append (pa…

---

## [Best practices for contracts](https://racket.discourse.group/t/best-practices-for-contracts/174)

<div class="topic-metadata">

**Author:** [@dominik.pantucek](https://racket.discourse.group/u/dominik.pantucek)\
**Replies:** 1\
**Last updated:** [November 24, 2021, 9:35pm UTC](https://racket.discourse.group/t/best-practices-for-contracts/174 "2021-11-24T21:35:54Z")

</div>

Hello Racketeers, lately I've encountered a few instances where I use contracts extensively to establish both intra- and inter- module boundaries. Some of the contracts are provided for other modules to use as well. I a…

---

## [HTTP 0.9 queries](https://racket.discourse.group/t/http-0-9-queries/228)

<div class="topic-metadata">

**Author:** [@LaughingWater](https://racket.discourse.group/u/LaughingWater)\
**Replies:** 3\
**Last updated:** [November 24, 2021, 9:12pm UTC](https://racket.discourse.group/t/http-0-9-queries/228 "2021-11-24T21:12:53Z")

</div>

I have a temperature-monitoring device that responds only to HTTP 0.9 queries (and the company no longer is in business). Can Racket do it? It looks like Racket's command requires HTTP 1.0. Failing that, what I have bee…

---

## [Does DrRacket have a function that returns the Package Source path](https://racket.discourse.group/t/does-drracket-have-a-function-that-returns-the-package-source-path/229)

<div class="topic-metadata">

**Author:** [@Don](https://racket.discourse.group/u/Don)\
**Replies:** 4\
**Last updated:** [November 24, 2021, 4:29pm UTC](https://racket.discourse.group/t/does-drracket-have-a-function-that-returns-the-package-source-path/229 "2021-11-24T16:29:31Z")

</div>

A package source path can be entered in: DrRacket/Package Manager/Package Source: Would be nice if there was a function that could return the entered value. The nearest similar function that I can find is: current-lib…

---

## [How do I create a functional REPL?](https://racket.discourse.group/t/how-do-i-create-a-functional-repl/154)

<div class="topic-metadata">

**Author:** [@benknoble](https://racket.discourse.group/u/benknoble)\
**Replies:** 2\
**Last updated:** [November 18, 2021, 6:21pm UTC](https://racket.discourse.group/t/how-do-i-create-a-functional-repl/154 "2021-11-18T18:21:00Z")

</div>

I know I can use (read-eval-print-loop), but by default it has no #%top-interaction or #%app or anything. I would also like to be able to augment it with specific bindings.

---

## [Why doesn't my package have documentation link on pkgs.racket-lang.org](https://racket.discourse.group/t/why-doesnt-my-package-have-documentation-link-on-pkgs-racket-lang-org/142)

<div class="topic-metadata">

**Author:** [@slbtty](https://racket.discourse.group/u/slbtty)\
**Replies:** 2\
**Last updated:** [November 17, 2021, 4:05pm UTC](https://racket.discourse.group/t/why-doesnt-my-package-have-documentation-link-on-pkgs-racket-lang-org/142 "2021-11-17T16:05:58Z")

</div>

I am experimenting to upload a package to pkgs.racket-lang.org. I forked an older, no-longer-maintained package (list-utils) and added a few new functions. Link to my package: awesome-list However, the website doesn't …

---

## [GUI builder/designer?](https://racket.discourse.group/t/gui-builder-designer/151)

<div class="topic-metadata">

**Author:** [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Replies:** 1\
**Last updated:** [November 17, 2021, 9:02am UTC](https://racket.discourse.group/t/gui-builder-designer/151 "2021-11-17T09:02:10Z")

</div>

Is there a Graphical user interface builder or designer tool for Racket?

---

## [How to include SQLite in a Stand-Alone Executable?](https://racket.discourse.group/t/how-to-include-sqlite-in-a-stand-alone-executable/150)

<div class="topic-metadata">

**Author:** [@spdegabrielle](https://racket.discourse.group/u/spdegabrielle)\
**Replies:** 1\
**Last updated:** [November 17, 2021, 8:51am UTC](https://racket.discourse.group/t/how-to-include-sqlite-in-a-stand-alone-executable/150 "2021-11-17T08:51:40Z")

</div>

How do I use libsqlite3 ? Would like to distribute sqlite with an exe but unsure how to do so with that pkg

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

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