From fa45700f3024e46ad0d334bd452c52f9800e327b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Ren=C3=A9=20Rideau?= Date: Mon, 23 Oct 2023 23:47:20 -0700 Subject: [PATCH] Minor fixes: gxpkg, std/text/char-set, README (#1023) --- doc/guide/README.md | 6 +++--- src/std/text/char-set.ss | 6 +++--- src/tools/gxpkg.ss | 14 +++++++++----- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/doc/guide/README.md b/doc/guide/README.md index 854b253640..6e9d5107dc 100644 --- a/doc/guide/README.md +++ b/doc/guide/README.md @@ -109,7 +109,7 @@ docker pull gerbil/gerbil:$(uname -m) To get to the REPL: ```bash -docker run -it gerbil/gebil:$(uname -m) +docker run -it gerbil/gerbil:$(uname -m) ``` To get a bash shell where you can compile programs: @@ -125,6 +125,6 @@ See the [Docker Gulde](docker.md) for additional information. You can install Gerbil using Nix. See [nix.md](nix.md) for more details. There are also Docker containers based on Nix, with some gerbil libraries also installed, -at `mukn/gerbil` (with the compiler) and `mukn/glow` (with many libraries installed) -(user `user` working in `/home`). +at `mukn/glow:devel` or `ghcr.io/glow-lang/glow:devel` with many libraries installed. + See the `scripts` directory of [Gerbil Clan](https://github.com/fare/gerbil-utils) for details. diff --git a/src/std/text/char-set.ss b/src/std/text/char-set.ss index b2cc73b707..6e9ec25b3b 100644 --- a/src/std/text/char-set.ss +++ b/src/std/text/char-set.ss @@ -65,11 +65,11 @@ (= c #x0D))) ;; #\return ;; Whitespace as defined by C, C++ and Python. +;; To the strict-whitespace above, add two characters: +;; #\vtab (vertical tab) C'\v' and #\page (page break, form feed) C'\f' ;; : Codepoint -> Bool (def-codepoint (ascii-whitespace? c) - (or (codepoint-strict-whitespace? c) - (= c #x0B) ;; #\vtab (vertical tab) C'\v' - (= c #x0C))) ;; #\page (page break, form feed) C'\f' + (or (= c #x20) (<= #x09 c #x0D))) ;; Whitespace as defined by the underlying Scheme implementation ;; For Gambit and thus Gerbil (so far), it is the union of ASCII whitespace diff --git a/src/tools/gxpkg.ss b/src/tools/gxpkg.ss index ab6d374795..01ac2c6a24 100644 --- a/src/tools/gxpkg.ss +++ b/src/tools/gxpkg.ss @@ -23,6 +23,7 @@ ;;; TODO: add private repos support (import :gerbil/gambit + :std/format :std/getopt :std/sugar :std/iter @@ -85,11 +86,9 @@ (def new-cmd (command 'new help: "create a new package template in the current directory" (option 'package "-p" "--package" - help: "the package prefix for your project; defaults to the current username" - default: (getenv "USER")) + help: "the package prefix for your project; defaults to the current username") (option 'name "-n" "--name" - help: "the package name; defaults to the current directory name" - default: (path-strip-directory (path-normalize* (current-directory)))) + help: "the package name; defaults to the current directory name") (option 'link "-l" "--link" help: "link this package with a public package name; for example: github.com/your-user/your-package"))) (def deps-cmd @@ -340,7 +339,12 @@ (force once) (force +pkg-root-dir+)))) -(def (pkg-new prefix name maybe-link) +(def (pkg-new package-prefix package-name maybe-link) + (def prefix (or package-prefix + (getenv "USER" #f) + (error "Package prefix not specified with -p or --package, and USER not defined"))) + (def name (or package-name + (path-strip-directory (path-normalize* (current-directory))))) (def (create-template file template . args) (call-with-output-file file (lambda (output)