From: Philip McGrath <philip@philipmcgrath.com>
To: "Leo Prikler" <leo.prikler@student.tugraz.at>,
49280@debbugs.gnu.org, "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#49280] [PATCH v2 1/3] gnu: racket: Update to 8.2.
Date: Sun, 25 Jul 2021 14:04:35 -0400 [thread overview]
Message-ID: <b9f6a84c-ce4e-8cbb-d976-6aff8fdf3f4c@philipmcgrath.com> (raw)
In-Reply-To: <45fc43e2ceba9e6a711fe1bb99320875f2b45f44.camel@student.tugraz.at>
Hi,
On 7/25/21 9:03 AM, Leo Prikler wrote:
>> On 7/19/21 2:31 AM, Philip McGrath wrote:
>>> + (add-before 'configure 'initialize-config.rktd
>>> (lambda* (#:key inputs #:allow-other-keys)
>>> - (chdir "src")
>>> + (define (write-racket-hash alist)
>>> + ;; inside must use dotted pair notation
>>> + (display "#hash(")
>>> + (for-each (match-lambda
>>> + ((k . v)
>>> + (format #t "(~s . ~s)" k v)))
>>> + alist)
>>> + (display ")\n"))
>>> + (mkdir-p "racket/etc")
>>> + (with-output-to-file "racket/etc/config.rktd"
>>> + (lambda ()
>>> + (write-racket-hash
>>> + `((lib-search-dirs
>>> + . (#f ,@(map (lambda (lib)
>>> + (string-append (assoc-ref
>>> inputs
>> lib)
>>> + "/lib"))
>>> + '("openssl"
>>> + "sqlite"))))
>>> + (catalogs
>>> + . (,(string-append
>>> + "
>>> https://download.racket-lang.org/releases/"
>>> + ,version
>>> + "/catalog/")
>>> + #f))))))
>>> #t))
> This is perhaps a somewhat noobish question, but why must we use dotted
> pair notation here? To me personally, reading '(a . (b c)) is
> confusing as it could more clearly be written as '(a b c). Is this a
> Racket convention?
Yes, the Racket reader requires that hash table literals use dotted pair
notation, e.g. #hash((a . (b c))(d . 2)). (Additionally, hand-written
Racket would often use square brackets for the key–value pairs.) I think
it's ultimately for historical reasons, but there are various
subtleties: under `quasiquote`, for example, the value position can
contain `unquote`, but the key position cannot.
Of course, that doesn't necessarily mean the Guile code must use dotted
pairs, but, at least as a Racketeer, I found writing these s-expressions
with a bit of a "Racket accent" helped me to remember that this code is
generating Racket.
> To attempt a better summary: Specifying `#f' will allow Racket to
> search for user-specific libraries etc. (in
> $XDG_DATA_HOME/racket/$RACKET_VERSION) in addition to "system-specific"
> libraries stored in $HOME/.guix-profile, am I correct?
>
> If so, then yes, doing that is absolutely fine (you could compare it to
> how Emacs users can still install stuff via ELPA).
Yes, that's a much better summary.
(Pedantically, the user-specific path could be different, depending on
the configured installation name and other things.)
The other issue is that I believe *not* specifying `#f` for
`racket-minimal` would break the build of `racket` starting in the
second patch, when the main distribution becomes a layer chaining to
`racket-minimal`. At least, it broke some examples of layered
installation I tried, which is how I figured out I'd done the wrong
thing in <https://issues.guix.gnu.org/47180>. If that were the only
issue, there might be some other workaround, but it's worth bearing in
mind, particularly because the problems caused by buggy "config.rktd"
files can be subtle and easy to miss.
-Philip
next prev parent reply other threads:[~2021-07-25 18:05 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-29 21:52 [bug#49280] [PATCH 0/4] gnu: racket: Add racket-next. Bootstrap from C Philip McGrath
2021-06-29 21:57 ` [bug#49280] [PATCH 1/4] gnu: racket: Fix lib-search-dirs configuration Philip McGrath
2021-06-29 21:57 ` [bug#49280] [PATCH 2/4] gnu: racket: Add racket-next and racket-next-minimal Philip McGrath
2021-07-08 21:25 ` [bug#49280] [PATCH 0/4] gnu: racket: Add racket-next. Bootstrap from C Ludovic Courtès
2021-07-18 21:35 ` Philip McGrath
2021-07-19 6:31 ` [bug#49280] [PATCH v2 1/3] gnu: racket: Update to 8.2 Philip McGrath
2021-07-19 6:31 ` [bug#49280] [PATCH v2 2/3] gnu: racket: Unbundle racket-minimal Philip McGrath
2021-07-30 21:33 ` [bug#49280] [PATCH v2 0/3] gnu: racket: Update to 8.2. Bootstrap from C Ludovic Courtès
2021-07-19 6:31 ` [bug#49280] [PATCH v2 3/3] gnu: racket-minimal: " Philip McGrath
2021-07-19 18:48 ` Philip McGrath
2021-07-19 19:46 ` [bug#49280] [PATCH v2 1/3] gnu: racket: Update to 8.2 Leo Prikler
2021-07-19 21:46 ` Philip McGrath
2021-07-20 9:40 ` Leo Prikler
2021-07-25 8:22 ` Philip McGrath
2021-07-25 13:03 ` Leo Prikler
2021-07-25 18:04 ` Philip McGrath [this message]
2021-07-30 23:05 ` bug#49280: [PATCH v2 0/3] gnu: racket: Update to 8.2. Bootstrap from C Ludovic Courtès
2021-07-30 21:22 ` [bug#49280] " Ludovic Courtès
2021-07-30 21:31 ` [bug#49280] References to unversioned source tarballs Ludovic Courtès
2021-07-30 22:08 ` Philip McGrath
2021-06-29 21:57 ` [bug#49280] [PATCH 3/4] gnu: racket-next: Unbundle racket-next-minimal Philip McGrath
2021-06-29 21:57 ` [bug#49280] [PATCH 4/4] gnu: racket-next-minimal: Bootstrap from C Philip McGrath
2021-07-08 21:43 ` [bug#49280] [PATCH 0/4] gnu: racket: Add racket-next. " Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b9f6a84c-ce4e-8cbb-d976-6aff8fdf3f4c@philipmcgrath.com \
--to=philip@philipmcgrath.com \
--cc=49280@debbugs.gnu.org \
--cc=leo.prikler@student.tugraz.at \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.