# Questions & Answers

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

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

**Page:** 33

---

## [Racket:cant return input](https://racket.discourse.group/t/racket-cant-return-input/638)

<div class="topic-metadata">

**Author:** [@osman44](https://racket.discourse.group/u/osman44)\
**Replies:** 7\
**Last updated:** [February 1, 2022, 12:10am UTC](https://racket.discourse.group/t/racket-cant-return-input/638 "2022-02-01T00:10:29Z")

</div>

i have been asked to "Write a function with one argument, L, such that, if L is a number, then it is doubled and returned, otherwise it is returned unchanged" The problem iwhenever i run the function and say type in som…

---

## [Single Sign-On across Racket- and non-Racket-based servers](https://racket.discourse.group/t/single-sign-on-across-racket-and-non-racket-based-servers/624)

<div class="topic-metadata">

**Author:** [@Byron](https://racket.discourse.group/u/Byron)\
**Replies:** 9\
**Last updated:** [January 28, 2022, 9:55am UTC](https://racket.discourse.group/t/single-sign-on-across-racket-and-non-racket-based-servers/624 "2022-01-28T09:55:14Z")

</div>

Any recommendations for implementing single sign-on across multiple (in my case two) Racket web servers and a Node server for a React-based UI? The user should be able to login on the main server (Racket) and select a R…

---

## [GUI for bash commands](https://racket.discourse.group/t/gui-for-bash-commands/628)

<div class="topic-metadata">

**Author:** [@JoePass](https://racket.discourse.group/u/JoePass)\
**Replies:** 4\
**Last updated:** [January 27, 2022, 10:45pm UTC](https://racket.discourse.group/t/gui-for-bash-commands/628 "2022-01-27T22:45:46Z")

</div>

Hi, I have a large collection of commands which I use in console bash to transform pdf, png, etc., like pdftk in.pdf cat 1 5 7 10-12 output out.pdf, for example, to extract specific pages from pdf file. I made some sh e…

---

## [How can I know the implicit name of a "World", defined in big-bang of 2htdp/universe?](https://racket.discourse.group/t/how-can-i-know-the-implicit-name-of-a-world-defined-in-big-bang-of-2htdp-universe/627)

<div class="topic-metadata">

**Author:** [@cametan](https://racket.discourse.group/u/cametan)\
**Replies:** 3\
**Last updated:** [January 26, 2022, 2:07pm UTC](https://racket.discourse.group/t/how-can-i-know-the-implicit-name-of-a-world-defined-in-big-bang-of-2htdp-universe/627 "2022-01-26T14:07:22Z")

</div>

Hello. I want to switch two images, according to the flag defined in a WorldState of big-bang in 2htdp/universe. Let's say, the experimental code I wrote was like this: #lang racket (require 2htdp/image 2htdp/univers…

---

## [Parser-tools output position token's position only has offset?](https://racket.discourse.group/t/parser-tools-output-position-tokens-position-only-has-offset/625)

<div class="topic-metadata">

**Author:** [@dannypsnl](https://racket.discourse.group/u/dannypsnl)\
**Replies:** 3\
**Last updated:** [January 26, 2022, 12:04pm UTC](https://racket.discourse.group/t/parser-tools-output-position-tokens-position-only-has-offset/625 "2022-01-26T12:04:24Z")

</div>

I want to parse some s-expression with position information by parser-tools (require parser-tools/lex (prefix-in : parser-tools/lex-sre)) (define-empty-tokens symbol (|(| |)|)) (define-tokens datum (ID …

---

## [How do you select a dropdown option with marionette](https://racket.discourse.group/t/how-do-you-select-a-dropdown-option-with-marionette/621)

<div class="topic-metadata">

**Author:** [@badkins](https://racket.discourse.group/u/badkins)\
**Replies:** 1\
**Last updated:** [January 25, 2022, 1:21am UTC](https://racket.discourse.group/t/how-do-you-select-a-dropdown-option-with-marionette/621 "2022-01-25T01:21:27Z")

</div>

How do you select a dropdown option with marionette? In some cases, I've been successful by using element-type! to type the value, but that doesn't work in some cases. In particular, if there are key handling listeners …

---

## [Drawing precisely to pixels using draw-line](https://racket.discourse.group/t/drawing-precisely-to-pixels-using-draw-line/593)

<div class="topic-metadata">

**Author:** [@Liam.Gaudy](https://racket.discourse.group/u/Liam.Gaudy)\
**Replies:** 7\
**Last updated:** [January 21, 2022, 12:35am UTC](https://racket.discourse.group/t/drawing-precisely-to-pixels-using-draw-line/593 "2022-01-21T00:35:37Z")

</div>

Hello, this is my first time engaging with the Racket community. Thanks for being here. Let me know if I should do anything better to get your help on this. I’m using draw-line to draw (pen width = 1) lines in the hope …

---

## [Indentation configuration for DrRacket and fmt](https://racket.discourse.group/t/indentation-configuration-for-drracket-and-fmt/486)

<div class="topic-metadata">

**Author:** [@sorawee](https://racket.discourse.group/u/sorawee)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 10:01pm UTC](https://racket.discourse.group/t/indentation-configuration-for-drracket-and-fmt/486 "2022-01-20T22:01:02Z")

</div>

@notjack and @SamPhillips seem to prefer pattern from the syntax/parse library to be indented as follows: (define-syntax-class arglist (pattern x:id #:with name #'x)) as opposed to: (define-syntax-class arglist …

---

## [How to make automatic line break in scribble tabular for latex target?](https://racket.discourse.group/t/how-to-make-automatic-line-break-in-scribble-tabular-for-latex-target/597)

<div class="topic-metadata">

**Author:** [@venartas](https://racket.discourse.group/u/venartas)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 3:03pm UTC](https://racket.discourse.group/t/how-to-make-automatic-line-break-in-scribble-tabular-for-latex-target/597 "2022-01-20T15:03:35Z")

</div>

Hi, How to enforce line breaks using scribble tabular in order to fit table content into pdf page? @tabular\[ #:column-properties '(left) #:row-properties '(border) (list (list @bold{ColName1} @bold{ColName2} @bold{C…

---

## [Create Racket package](https://racket.discourse.group/t/create-racket-package/587)

<div class="topic-metadata">

**Author:** [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Replies:** 12\
**Last updated:** [January 20, 2022, 2:54am UTC](https://racket.discourse.group/t/create-racket-package/587 "2022-01-20T02:54:07Z")

</div>

Hello, i want to create a Racket package, when i did that on a directory containing the module code in a file that uses other code file and i want to install it with the package manager from a directory it installs well…

---

## [How do you use arrays (if at all)](https://racket.discourse.group/t/how-do-you-use-arrays-if-at-all/571)

<div class="topic-metadata">

**Author:** [@soegaard](https://racket.discourse.group/u/soegaard)\
**Replies:** 17\
**Last updated:** [January 19, 2022, 10:19pm UTC](https://racket.discourse.group/t/how-do-you-use-arrays-if-at-all/571 "2022-01-19T22:19:13Z")

</div>

In the discussion of srfi 231 on n-dimensional arrays, Bradley Lucier raised an interesting question: More generally, I've asked in various forums (fora?) about how people use arrays, in Scheme and other languages, b…

---

## [Get proc-doc/names: unsupported procedure contract form](https://racket.discourse.group/t/get-proc-doc-names-unsupported-procedure-contract-form/591)

<div class="topic-metadata">

**Author:** [@dannypsnl](https://racket.discourse.group/u/dannypsnl)\
**Replies:** 1\
**Last updated:** [January 19, 2022, 2:07pm UTC](https://racket.discourse.group/t/get-proc-doc-names-unsupported-procedure-contract-form/591 "2022-01-19T14:07:10Z")

</div>

The following code is a minimal reproducible code #lang at-exp racket/base (require scribble/srcdoc (for-doc scribble/manual ffi/unsafe racket/base)) (provide (proc-doc/names foo (-\> string? string?) (x…

---

## [Manage C-instance with GC](https://racket.discourse.group/t/manage-c-instance-with-gc/594)

<div class="topic-metadata">

**Author:** [@dannypsnl](https://racket.discourse.group/u/dannypsnl)\
**Replies:** 1\
**Last updated:** [January 19, 2022, 2:03pm UTC](https://racket.discourse.group/t/manage-c-instance-with-gc/594 "2022-01-19T14:03:37Z")

</div>

One might get a C structure A, and its constructor make\_A() and destructor free\_A(A\*). In ffi, we can bind them by ffi/unsafe, but how to let GC handle A's instance and tell GC calls free\_A when unused?

---

## [Why does Scribble give this duplicate information warning with \`defmodulelang\`, and how do I avoid it?](https://racket.discourse.group/t/why-does-scribble-give-this-duplicate-information-warning-with-defmodulelang-and-how-do-i-avoid-it/561)

<div class="topic-metadata">

**Author:** [@benknoble](https://racket.discourse.group/u/benknoble)\
**Replies:** 3\
**Last updated:** [January 19, 2022, 12:33am UTC](https://racket.discourse.group/t/why-does-scribble-give-this-duplicate-information-warning-with-defmodulelang-and-how-do-i-avoid-it/561 "2022-01-19T00:33:20Z")

</div>

There's a gist of code available (replace scribblings-\* with scribblings/\*, since gists apparently can't have directories). If you get that setup properly and do raco pkg install, you'll see output like in scribble defmo…

---

## [Plot module: how to enlarge thickness of axes?](https://racket.discourse.group/t/plot-module-how-to-enlarge-thickness-of-axes/553)

<div class="topic-metadata">

**Author:** [@JoePass](https://racket.discourse.group/u/JoePass)\
**Replies:** 6\
**Last updated:** [January 18, 2022, 10:24pm UTC](https://racket.discourse.group/t/plot-module-how-to-enlarge-thickness-of-axes/553 "2022-01-18T22:24:42Z")

</div>

Hi everybody, I'm new in the racket and my first question: how to enlarge the thickness of axes? I prepared the plot for the scientific paper but the axes are very tiny! I did not find info about this in the documentati…

---

## [Can compiled and uncompiled versions of a single function exist in a collection?](https://racket.discourse.group/t/can-compiled-and-uncompiled-versions-of-a-single-function-exist-in-a-collection/564)

<div class="topic-metadata">

**Author:** [@Fyrbll](https://racket.discourse.group/u/Fyrbll)\
**Replies:** 2\
**Last updated:** [January 18, 2022, 7:33pm UTC](https://racket.discourse.group/t/can-compiled-and-uncompiled-versions-of-a-single-function-exist-in-a-collection/564 "2022-01-18T19:33:07Z")

</div>

Suppose I install a collection via raco pkg install. I add a printf to the body of one function within the collection that's called at various places in the same collection. I don't run raco setup after modifying the f…

---

## [Scribble as Preprocessor throwing an error](https://racket.discourse.group/t/scribble-as-preprocessor-throwing-an-error/578)

<div class="topic-metadata">

**Author:** [@leo](https://racket.discourse.group/u/leo)\
**Replies:** 2\
**Last updated:** [January 15, 2022, 1:56am UTC](https://racket.discourse.group/t/scribble-as-preprocessor-throwing-an-error/578 "2022-01-15T01:56:29Z")

</div>

:wave: I'm trying to use #lang scribble/text but I get this error when trying to process the document: scribble --text test.scrbl #or scribble test.scrbl dynamic-require: name is not provided name: 'doc module: #\<r…

---

## [One queue/channel, several consumers (futures, places, ...)](https://racket.discourse.group/t/one-queue-channel-several-consumers-futures-places/576)

<div class="topic-metadata">

**Author:** [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Replies:** 3\
**Last updated:** [January 14, 2022, 11:16pm UTC](https://racket.discourse.group/t/one-queue-channel-several-consumers-futures-places/576 "2022-01-14T23:16:24Z")

</div>

I read Parallelism with places in the Racket Guide. As I understand the section, it isn't possible to send data over a single channel to multiple places, so that the places can act as "workers" and consume tasks from the…

---

## [Plot: how to put text out of figure?](https://racket.discourse.group/t/plot-how-to-put-text-out-of-figure/569)

<div class="topic-metadata">

**Author:** [@JoePass](https://racket.discourse.group/u/JoePass)\
**Replies:** 2\
**Last updated:** [January 14, 2022, 2:29am UTC](https://racket.discourse.group/t/plot-how-to-put-text-out-of-figure/569 "2022-01-14T02:29:44Z")

</div>

To make info on the y-axes more readable I multiply my function for 10^3 and put info about the multiplier (point-pict #(110 6.5) (tex-math "\\\\times 10^{-3}" #:scale 4) #:point-size 0) . But common practice is to put th…

---

## [Plot: how to insert plot in plot](https://racket.discourse.group/t/plot-how-to-insert-plot-in-plot/562)

<div class="topic-metadata">

**Author:** [@JoePass](https://racket.discourse.group/u/JoePass)\
**Replies:** 11\
**Last updated:** [January 13, 2022, 10:34pm UTC](https://racket.discourse.group/t/plot-how-to-insert-plot-in-plot/562 "2022-01-13T22:34:53Z")

</div>

The question is simple - how can I put a small figure inside the field of another one? Like this: I read all info about Plot module, but I did not find a solution. But this type of figure with an insert is very comm…

---

## [Make-least-squares-point-smoother from simple-polynomial/fit does not work](https://racket.discourse.group/t/make-least-squares-point-smoother-from-simple-polynomial-fit-does-not-work/559)

<div class="topic-metadata">

**Author:** [@JoePass](https://racket.discourse.group/u/JoePass)\
**Replies:** 4\
**Last updated:** [January 13, 2022, 9:49pm UTC](https://racket.discourse.group/t/make-least-squares-point-smoother-from-simple-polynomial-fit-does-not-work/559 "2022-01-13T21:49:44Z")

</div>

I try to use polynomial smoothing of data Simple Polynomials of One Variable. I use exactly the same example as in this site but for my data: (define datasp (points-\>spline-evaluator data)) (define datasm (points-\>spline…

---

## [Objc ffi: implement \`windowWillClose:\`](https://racket.discourse.group/t/objc-ffi-implement-windowwillclose/549)

<div class="topic-metadata">

**Author:** [@dannypsnl](https://racket.discourse.group/u/dannypsnl)\
**Replies:** 4\
**Last updated:** [January 12, 2022, 2:43pm UTC](https://racket.discourse.group/t/objc-ffi-implement-windowwillclose/549 "2022-01-12T14:43:45Z")

</div>

The code is like: (define-objc-class MyView NSView () (- \_void (windowWillClose: \[(\_cpointer 'NSNotification) notification\]) (tell app terminate: #:type \_id self))) the corresponding code in Objective-C correc…

---

## [What would be a "recipe" and lesson plan for building a Racket-like system?](https://racket.discourse.group/t/what-would-be-a-recipe-and-lesson-plan-for-building-a-racket-like-system/554)

<div class="topic-metadata">

**Author:** [@bmitc](https://racket.discourse.group/u/bmitc)\
**Replies:** 3\
**Last updated:** [January 12, 2022, 6:25am UTC](https://racket.discourse.group/t/what-would-be-a-recipe-and-lesson-plan-for-building-a-racket-like-system/554 "2022-01-12T06:25:58Z")

</div>

I am looking for any help, references, etc. that describes how one might take Racket's language building technology and other bits and relevant lessons learned to other languages, ecosystems, or virtual machines (VMs), e…

---

## [X-expression string length](https://racket.discourse.group/t/x-expression-string-length/550)

<div class="topic-metadata">

**Author:** [@joeld](https://racket.discourse.group/u/joeld)\
**Replies:** 4\
**Last updated:** [January 11, 2022, 11:22pm UTC](https://racket.discourse.group/t/x-expression-string-length/550 "2022-01-11T23:22:56Z")

</div>

I thought I would try and calculate the length of an X-expression's string representation without actually converting the whole thing to a string. I theorized that if I could do it with math and immutable strings, it wou…

---

## [What system configuration is needed for the \[Scribble PDF\] button in DrRacket for a scribble file, in order to work properly?](https://racket.discourse.group/t/what-system-configuration-is-needed-for-the-scribble-pdf-button-in-drracket-for-a-scribble-file-in-order-to-work-properly/528)

<div class="topic-metadata">

**Author:** [@encomer](https://racket.discourse.group/u/encomer)\
**Replies:** 14\
**Last updated:** [January 11, 2022, 8:34pm UTC](https://racket.discourse.group/t/what-system-configuration-is-needed-for-the-scribble-pdf-button-in-drracket-for-a-scribble-file-in-order-to-work-properly/528 "2022-01-11T20:34:42Z")

</div>

Hi friends at Racket Discourse: I will appreciate very much recommendations about how to configure my computing environment under Windows 10, in order that the \[Scribble PDF\] button for rendering a scribble/base documen…

---

## [Writing a macro that behaves differently depending on context](https://racket.discourse.group/t/writing-a-macro-that-behaves-differently-depending-on-context/536)

<div class="topic-metadata">

**Author:** [@dimaugh](https://racket.discourse.group/u/dimaugh)\
**Replies:** 2\
**Last updated:** [January 8, 2022, 10:51am UTC](https://racket.discourse.group/t/writing-a-macro-that-behaves-differently-depending-on-context/536 "2022-01-08T10:51:57Z")

</div>

I'm trying to define a macro 'def' which behaves differently depending on where it appears. If it appears in the top-level, it expands to a normal 'define' and adds the definition to a hash. If it appears in a local cont…

---

## [Implementing debug vs production versions?](https://racket.discourse.group/t/implementing-debug-vs-production-versions/527)

<div class="topic-metadata">

**Author:** [@dstorrs](https://racket.discourse.group/u/dstorrs)\
**Replies:** 4\
**Last updated:** [January 6, 2022, 7:33pm UTC](https://racket.discourse.group/t/implementing-debug-vs-production-versions/527 "2022-01-06T19:33:00Z")

</div>

Suppose I have this code: (define (foo) (if (getenv "DEBUG") plausible-test-value (expensive-function-call-that-determines-the-actual-value))) Perhaps the production version requires a network connectio…

---

## [Trying to learn macros, have question on code snippet](https://racket.discourse.group/t/trying-to-learn-macros-have-question-on-code-snippet/523)

<div class="topic-metadata">

**Author:** [@maketo](https://racket.discourse.group/u/maketo)\
**Replies:** 4\
**Last updated:** [January 4, 2022, 7:45pm UTC](https://racket.discourse.group/t/trying-to-learn-macros-have-question-on-code-snippet/523 "2022-01-04T19:45:44Z")

</div>

Hello. I am new to Scheme/Racket (not to programming) and am trying to learn Racket through BeautifulRacket. After a few chapters I got interested in learning more about Racket's macro capabilities (before going back to …

---

## [\`#:methods gen:custom-write\` replacement in typed/racket?](https://racket.discourse.group/t/methods-gen-custom-write-replacement-in-typed-racket/521)

<div class="topic-metadata">

**Author:** [@dannypsnl](https://racket.discourse.group/u/dannypsnl)\
**Replies:** 1\
**Last updated:** [January 4, 2022, 6:58pm UTC](https://racket.discourse.group/t/methods-gen-custom-write-replacement-in-typed-racket/521 "2022-01-04T18:58:02Z")

</div>

Probably silly, but I don't want to affect any existing code that relies on gen:custom-write (struct vec3 (x y z) #:methods gen:custom-write \[(define (write-proc v port mode) (fprintf port "~a ~a ~a" (vec3-x v)…

---

## [Test environment on package server](https://racket.discourse.group/t/test-environment-on-package-server/512)

<div class="topic-metadata">

**Author:** [@sschwarzer](https://racket.discourse.group/u/sschwarzer)\
**Replies:** 4\
**Last updated:** [January 4, 2022, 12:58pm UTC](https://racket.discourse.group/t/test-environment-on-package-server/512 "2022-01-04T12:58:31Z")

</div>

For one of my packages, there are failing tests in the package server environment, although the tests succeed on my machine. From the package server's error log it looks like (find-executable-path "raco") doesn't find r…

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

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