Skip to content

Commit

Permalink
Minor fixes: gxpkg, std/text/char-set, README
Browse files Browse the repository at this point in the history
  • Loading branch information
fare committed Oct 24, 2023
1 parent 3d61672 commit 7d65632
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
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
15 changes: 10 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,13 @@
(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)
(begin (eprintf "Package prefix not specified with -p or --package, and USER not defined\n")
(exit 2))))
(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

0 comments on commit 7d65632

Please sign in to comment.