Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes: gxpkg, std/text/char-set, README #1023

Merged
merged 3 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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.
6 changes: 3 additions & 3 deletions src/std/text/char-set.ss
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions src/tools/gxpkg.ss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
;;; TODO: add private repos support

(import :gerbil/gambit
:std/format
:std/getopt
:std/sugar
:std/iter
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading