Commit Graph

20 Commits

Author SHA1 Message Date
Timothy Sample 00c794c9a6 compat: Add a 'usleep' shim for Mes.
* gash/compat.scm [mes] (usleep): New procedure.
2023-02-08 14:29:54 -06:00
Timothy Sample 6c67d7b23d compat: More shims for Mes.
* gash/compat.scm [mes] (call-with-input-file): New procedure.
[mes] (exact?): New procedure.
[mes] (set-program-arguments): New procedure.
[mes] (open-file): New procedure.
[mes] (false-if-exception): New syntax.
[mes] (hex-digits): New variable.
[mes] (char->hex-string): New procedure.
[mes] (make-random-file-name): New procedure.
[mes] (tmpfile): New procedure.
2023-02-08 14:29:13 -06:00
Timothy Sample 4c04f1faa3 compat: Add 'sort' for Mes.
* gash/compat.scm [mes] (sort): New procedure.
2023-02-08 14:29:13 -06:00
Timothy Sample 469cdb60fc compat: Add 'string-for-each' for Mes.
* gash/compat.scm [mes] (string-for-each): New procedure.
2023-02-08 14:29:13 -06:00
Timothy Sample 10ee7d286e compat: Add prompts for Mes.
* gash/compat.scm [mes] (make-prompt-tag): Return a fluid.
[mes] (abort-to-prompt): New procedure.
[mes] (call-with-prompt): New procedure.
2023-02-08 14:29:13 -06:00
Timothy Sample 52e03d4d22 compat: Add 'exact-integer?' for Mes.
* gash/compat.scm [mes] (exact-integer?): New procedure.
2023-02-08 14:29:13 -06:00
Timothy Sample f5a4619c69 compat: Add exit codes for Mes.
* gash/compat.scm [mes] (EXIT_SUCCESS): New variable.
[mes] (EXIT_FAILURE): New variable.
2023-02-08 14:29:13 -06:00
Timothy Sample d088464510 compat: Add 'call-with-input-string' for Mes.
* gash/compat.scm [mes] (call-with-input-string): New procedure.
2023-02-08 14:29:13 -06:00
Timothy Sample efe0522d06 compat: Add 'thunk?' for Mes.
* gash/compat.scm [mes] (thunk?): New procedure.
2023-02-08 14:29:13 -06:00
Timothy Sample a584a5bd9c compat: Add Mes shims for the 'eval' module.
* gash/compat.scm [mes] (string-concatenate-reverse): New procedure.
[mes] (char-pred): New procedure.
[mes] (string-any): New procedure.
[mes] (string-every): Allow character sets and characters as the
predicated (using 'char-pred').
2023-02-08 14:29:13 -06:00
Timothy Sample 309f9a8893 compat: Add shims for the 'shell' module.
* gash/compat.scm [mes] (X_OK): New variable.
[mes] (program-arguments): New procedure.
[mes] (delete-duplicates!): New procedure.
[mes] (flush-all-ports): New procedure.
[mes] (file-port?): New procedure.
[mes] (input-port?): New procedure.
[mes] (output-port?): New procedure.
[mes] (dup): Redefine to support an optional 'new' argument.
2023-02-08 14:29:13 -06:00
Timothy Sample 386d12aa21 wip! environment: Port to Mes.
TODO: Implement 'canonicalize-path'.

* gash/compat.scm [mes] (make-prompt-tag): New procedure.
[mes] (canonicalize-path): New procedure.
* gash/compat/hash-table.scm (shared-shims): New macro.
[if-guile-version-below (2 0 10)]: Use it.
[mes]: Likewise.
* gash/environment.scm: Import '(gash compat)' and '(srfi srfi-14)'.
2023-02-08 14:29:13 -06:00
Timothy Sample 0c554b6b13 parser: Port to Mes.
* gash/compat.scm [mes] (the-eof-object): New variable.
[mes] (noop): New procedure.
* gash/parser.scm: Import '(gash compat)'; remove '(srfi srfi-14)'
import.
(eof-object): Remove procedure.
(make-parser): Replace 'eof-object' with 'the-eof-object'.
(call-with-backquoted-input-port): Likewise.
2023-02-08 14:29:13 -06:00
Timothy Sample e37ef0faba lexer: Port to Mes.
* gash/compat.scm [mes] (define-inlinable): New syntax.
[mes] (*fluid-accessor*): New variable.
[mes] (make-parameter): New procedure.
[mes] (parameterize): New syntax.
[mes] (set-port-line!): New procedure.
[mes] (string-every): New procedure.
* gash/compat/textual-ports.scm [mes] (<soft-input-port>): New
record type.
[mes] (make-soft-port): New procedure.
[mes] (push-soft-input-port-buffer!): New procedure.
[mes] (pop-soft-input-port-buffer!): New procedure.
[mes] (get-char): New procedure.
[mes] (unget-char): New procedure.
[mes] (lookahead-char): New procedure.
* gash/lexer.scm: Import '(gash compat)' and '(srfi srfi-14)'.
2023-02-08 14:29:05 -06:00
Timothy Sample ead347128a compat: Support Mes.
* gash/compat.scm (if-guile-version-below) [mes]: Do nothing.
(when-mes): New syntax.
* .dir-locals.el: Tell Emacs how to indent it.
2022-04-28 15:47:36 -06:00
Timothy Sample 2d41b4ae5a Allow one-armed 'if-guile-version-below'.
* gash/compat.scm: Allow one-armed 'if-guile-version-below' syntax and
use it to simplify the conditional definitions throughout.
2019-12-09 13:53:55 -05:00
Timothy Sample cf118f7a39 Fix 'setvbuf' wrapper for Guile 2.0.
* gash/compat.scm: Add '(ice-9 match)' to the list of used modules.
2019-06-01 11:09:29 -04:00
Timothy Sample 669c414116 Prefer 'if-guile-version-below' to 'cond-expand'.
* gash/compat.scm: Use 'if-guile-version-below' over 'cond-expand'.
* gash/compat/textual-ports.scm: Ditto.
2019-05-20 18:07:47 -04:00
Timothy Sample 2d46b8b43e Move 'setvbuf' shim to '(gash compat)'.
* tests/unit/shell.scm: Mode 'setvbuf' shim...
* gash/compat.scm: ...here.
2019-05-20 18:07:47 -04:00
Timothy Sample 878b9c3dca Add support for Guile 2.0.9.
* gash/compat.scm: New file.
* gash/compat/hash-table.scm: New file.
* Makefile.am: Add them.
* .dir-locals.scm: Add indentation for 'if-guile-version-below'.
* guix.scm (guile-2.0.9): New variable.
* gash/built-ins/echo.scm (escape->control): Use '#\esc'.
* gash/environment.scm: Use '(gash compat hash-table)'.
* gash/built-ins/break.scm,
gash/built-ins/cd.scm,
gash/built-ins/command.scm,
gash/built-ins/continue.scm,
gash/built-ins/dot.scm,
gash/built-ins/exec.scm,
gash/built-ins/exit.scm,
gash/built-ins/pwd.scm,
gash/built-ins/return.scm,
gash/built-ins/set.scm,
gash/built-ins/shift.scm,
gash/built-ins/trap.scm,
gash/built-ins/type.scm,
gash/built-ins/umask.scm,
gash/eval.scm,
tests/unit/automake.scm: Use '(gash compat)'.

squash! Add support for Guile 2.0.9.
2019-05-20 18:07:47 -04:00