Skip to content

Commit 059ca9f

Browse files
committed
release version 0.9.1
1 parent d7b73f1 commit 059ca9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+129
-105
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ MKDIR_P = mkdir -p
4949
######################################################################################
5050
# no user-serviceable parts below this line
5151
######################################################################################
52-
LIBSCHEMESH_SO=libschemesh_0.9.0.so
53-
LIBSCHEMESH_C_SO=libschemesh_c_0.9.0.so
52+
LIBSCHEMESH_SO=libschemesh_0.9.1.so
53+
LIBSCHEMESH_C_SO=libschemesh_c_0.9.1.so
5454

5555
SRCS=containers/containers.c eval.c posix/posix.c shell/shell.c
5656
OBJS=containers.o eval.o posix.o shell.o

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,20 @@ The analogous job control mechanisms from Scheme syntax are:
9393

9494
Some more advanced Scheme functions:
9595
* `(sh-run/string job-object)` start a job in foreground, wait until job finishes, return its output as a Scheme string
96-
* `(sh-start/fd-stdout job-object)` start a job in background, return a file descriptor fixnum for reading its standard output - for example with `(open-fd-input-port fd)`
96+
* `(sh-start/ports job-object)` start a job in background, return a list containing three binary ports:<br/>
97+
the first one for writing to job's standard input<br/>for example with `(put-bytevector port bytevector)`,<br/>
98+
the second one for reading from job's standard output<br/>for example with `(get-bytevector-some port bytevector)`,<br/>
99+
the third one for reading from job's standard error<br/>for example with `(get-bytevector-some port bytevector)`.<br/>
100+
Ports must be closed with `(close-port)` when no longer needed.
101+
* `(sh-start/fd-stdout job-object)` start a job in background, return a file descriptor fixnum<br/>
102+
for reading job's standard output - for example with `(open-fd-input-port fd)` or `(fd-read-some fd bytevector)`
103+
File descriptor must be closed with `(fd-close)` when no longer needed.
104+
* `(sh-start/fds job-object)` start a job in background, return a list containing three file descriptor fixnums:<br/>
105+
the first one for writing to job's standard input<br/>for example with `(open-fd-output-port fd)` or `(fd-write fd bytevector)`,<br/>
106+
the second one for reading from job's standard output<br/>for example with `(open-fd-input-port fd)` or `(fd-read fd bytevector)`,<br/>
107+
the third one for reading from job's standard error<br/>for example with `(open-fd-input-port fd)` or `(fd-read fd bytevector)`.<br/>
108+
File descriptors must be closed with `(fd-close)` when no longer needed.
109+
97110

98111

99112
### Subshells and command substitution
@@ -427,7 +440,7 @@ and inspect the Scheme source or objects generated by shell syntax:
427440
(begin
428441
(#3%$invoke-library
429442
'(schemesh shell job)
430-
'(0 9 0)
443+
'(0 9 1)
431444
'#{job c35q9golxfpwdr5y269nhygk1-54})
432445
(sh-and
433446
(sh-cmd* "make" 1 '> "log")
@@ -479,7 +492,7 @@ sudo apt update
479492
sudo apt install build-essential chezscheme-dev liblz4-dev libncurses-dev git uuid-dev zlib1g-dev
480493
git clone https://github.com/cosmos72/schemesh
481494
cd schemesh
482-
git checkout -f v0.9.0
495+
git checkout -f v0.9.1
483496
make -j
484497

485498
# try schemesh without installing it
@@ -503,7 +516,7 @@ then replace the command `make -j` with `make -j CC='gcc -fno-lto'`
503516
sudo dnf install gcc make chez-scheme-devel lz4-devel ncurses-devel git libuuid-devel zlib-devel
504517
git clone https://github.com/cosmos72/schemesh
505518
cd schemesh
506-
git checkout -f v0.9.0
519+
git checkout -f v0.9.1
507520
make -j
508521

509522
# try schemesh without installing it
@@ -523,7 +536,7 @@ by default, WSL installs [Ubuntu Linux](#ubuntu-linux)
523536
pkg install chez-scheme gcc git gmake # must be executed as root
524537
git clone https://github.com/cosmos72/schemesh
525538
cd schemesh
526-
git checkout -f v0.9.0
539+
git checkout -f v0.9.1
527540
gmake -j
528541

529542
# try schemesh without installing it
@@ -541,7 +554,7 @@ gmake install # must be executed as root
541554
sudo xcode-select --install # only needed if you don't already have XCode Command Line Tools
542555
brew install chezscheme lz4
543556
git clone https://github.com/cosmos72/schemesh
544-
git checkout -f v0.9.0 # version v0.8.3 does not support Mac OS X
557+
git checkout -f v0.9.1 # version v0.8.3 does not support Mac OS X
545558
cd schemesh
546559
make -j
547560

@@ -566,7 +579,7 @@ nix-build && ./result/bin/schemesh
566579
let
567580
schemesh = pkgs.fetchgit {
568581
url = "https://github.com/cosmos72/schemesh.git";
569-
rev = "refs/tags/v0.9.0"; # or: "refs/heads/main"
582+
rev = "refs/tags/v0.9.1"; # or: "refs/heads/main"
570583
sha256 = ""; # insert sha256 when ready
571584
};
572585
{

bootstrap/arrow.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh bootstrap arrow (0 9 0))
10+
(library (schemesh bootstrap arrow (0 9 1))
1111
(export expand==>)
1212
(import
1313
(rnrs)

bootstrap/bootstrap.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh bootstrap (0 9 0))
10+
(library (schemesh bootstrap (0 9 1))
1111
(export
1212
;; bootstrap.ss
1313

bootstrap/chez-compat.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
;;
1313
;; then it can be imported from Racket #!r6rs files with the usual (import (chez compat))
1414
;;
15-
(library (chez compat (0 9 0))
15+
(library (chez compat (0 9 1))
1616
(export append!
1717
check-interrupts current-time
1818
chez:car chez:cdr chez:cons chez:list chez:pair?

bootstrap/functions.ss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#!r6rs
1515

16-
(library (schemesh bootstrap functions (0 9 0))
16+
(library (schemesh bootstrap functions (0 9 1))
1717
(export
1818
check-interrupts fx<=?* nop parameter-swapper
1919
generate-pretty-temporaries generate-pretty-temporary gensym-pretty
@@ -235,14 +235,14 @@
235235

236236
;; return Schemesh version string
237237
(define sh-version
238-
(let ((ret (string->immutable-string "Schemesh Version 0.9.0")))
238+
(let ((ret (string->immutable-string "Schemesh Version 0.9.1")))
239239
(lambda ()
240240
ret)))
241241

242242

243243
;; return three values: schemesh version MAJOR, MINOR and PATCH fixnums
244244
(define (sh-version-number)
245-
(values 0 9 0))
245+
(values 0 9 1))
246246

247247
) ; close library
248248

containers/bitmap.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
;;;;;;;;; define Scheme type "bitmap", a fixed size bit vector ;;;;;;;;;;;;;
1212
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1313

14-
(library (schemesh containers bitmap (0 9 0))
14+
(library (schemesh containers bitmap (0 9 1))
1515
(export
1616
bitmap make-bitmap bitmap? bitmap-length bitmap-ref bitmap-set! bitmap-last-zero)
1717
(import

containers/bytespan.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
;;;;;;;;; define Scheme type "bytespan", a resizeable bytevector ;;;;;;;;;;;;;
1212
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1313

14-
(library (schemesh containers bytespan (0 9 0))
14+
(library (schemesh containers bytespan (0 9 1))
1515
(export
1616
list->bytespan bytevector->bytespan bytevector->bytespan* make-bytespan
1717
bytespan->bytevector bytespan->bytevector*! bytespan->bytevector0

containers/bytevector.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
;;; (at your option) any later version.
77

88

9-
(library (schemesh containers bytevector (0 9 0))
9+
(library (schemesh containers bytevector (0 9 1))
1010
(export
1111
in-bytevector list->bytevector subbytevector
1212

containers/charspan.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
;;;;;;;;;;; define Scheme type "charspan", a resizeable string ;;;;;;;;;;;;;;;
1212
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1313

14-
(library (schemesh containers charspan (0 9 0))
14+
(library (schemesh containers charspan (0 9 1))
1515
(export
1616
list->charspan string->charspan string->charspan* make-charspan
1717
charspan->string charspan->string*!

containers/containers.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#!r6rs
99

1010
;; define (schemesh containers) as a library that exports all its imported bindings
11-
(library-reexport (schemesh containers (0 9 0))
11+
(library-reexport (schemesh containers (0 9 1))
1212
(import (schemesh containers bitmap)
1313
(schemesh containers bytespan)
1414
(schemesh containers bytevector)

containers/flvector.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#!r6rs
1010

11-
(library (schemesh containers flvector (0 9 0))
11+
(library (schemesh containers flvector (0 9 1))
1212
(export
1313
flvector-native? flvector flvector? flvector-length flvector-ref flvector-set! make-flvector)
1414
(import

containers/gbuffer.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
;;;;;;; Implementation: contains two spans, a "left" and a "right" ones ;;;;;;;;
1313
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1414

15-
(library (schemesh containers gbuffer (0 9 0))
15+
(library (schemesh containers gbuffer (0 9 1))
1616
(export
1717
list->gbuffer vector->gbuffer vector->gbuffer* span->gbuffer span->gbuffer*
1818
make-gbuffer gbuffer gbuffer? gbuffer->vector gbuffer->span

containers/hashtable.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh containers hashtable (0 9 0))
10+
(library (schemesh containers hashtable (0 9 1))
1111
(export
1212
make-hash-iterator hash-iterator? hash-iterator-copy hash-iterator-pair hash-iterator-next!
1313

containers/in.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh containers in (0 9 0))
10+
(library (schemesh containers in (0 9 1))
1111
(export
1212
constant in-value in-interval in-numbers
1313
in-roundrobin in-list-roundrobin in-sequences number->cflonum)

containers/list.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh containers list (0 9 0))
10+
(library (schemesh containers list (0 9 1))
1111
(export
1212
any count every for-alist for-list for-plist in-alist in-list in-plist on-list
1313

containers/macros.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh containers macros (0 9 0))
10+
(library (schemesh containers macros (0 9 1))
1111
(export
1212
begin^ for for* if^ let^ let-values^ unless^ when^)
1313
(import

containers/replacements.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh containers replacements (0 9 0))
10+
(library (schemesh containers replacements (0 9 1))
1111
;; the following functions *intentionally* conflict with R6RS and Chez Scheme
1212
;; functions with the same names,
1313
;;

containers/sort.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh containers sort (0 9 0))
10+
(library (schemesh containers sort (0 9 1))
1111
(export
1212
span-sort! subvector-sort!) ; R6RS already defines (vector-sort!)
1313
(import

containers/span.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
;;;;;;;;;;;;; define Scheme type "span", a resizeable vector ;;;;;;;;;;;;;;;;;
1212
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1313

14-
(library (schemesh containers span (0 9 0))
14+
(library (schemesh containers span (0 9 1))
1515
(export
1616
list->span vector->span vector->span* make-span span->list span->vector span span?
1717
span-length span-empty? span-clear! span-capacity span-capacity-left span-capacity-right

containers/string.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh containers string (0 9 0))
10+
(library (schemesh containers string (0 9 1))
1111
(export
1212
assert-string-list? in-string
1313
string-any string-contains string-count string-empty? string-every

containers/utf8b-utils.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
;;; b. converting integers to decimal and writing them into "bytevector" and "bytespan"
1313

1414

15-
(library (schemesh containers utf8b utils (0 9 0))
15+
(library (schemesh containers utf8b utils (0 9 1))
1616
(export
1717
bytevector-char-ref bytevector-char-set! char->utf8b-length
1818
bytespan-ref/char bytespan-set/char! bytespan-insert-left/char! bytespan-insert-right/char!

containers/utf8b.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh containers utf8b (0 9 0))
10+
(library (schemesh containers utf8b (0 9 1))
1111
(export
1212
codepoint? codepoint-utf8b? integer->char* string->utf8b string->utf8b/0
1313
utf8b->string utf8b->string-copy! utf8b-bytespan->string)

containers/vector.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh containers vector (0 9 0))
10+
(library (schemesh containers vector (0 9 1))
1111
(export
1212
for-vector
1313
in-vector in-fxvector in-flvector ; in-flvector requires Chez Scheme >= 10.0.0

conversions/conversions.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh conversions (0 9 0))
10+
(library (schemesh conversions (0 9 1))
1111
(export
1212
display-condition* display-any display-bytevector0 write-bytevector0
1313
any->bytevector text->bytevector text->string

conversions/unicode.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#!r6rs
99

10-
(library (schemesh conversions unicode (0 9 0))
10+
(library (schemesh conversions unicode (0 9 1))
1111
(export char-display-wide?)
1212
(import
1313
(rnrs)

doc/recent_changes.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
## RECENT CHANGES
22

3+
### release v0.9.1, 2025-05-09
4+
5+
* fix saving history to `~/.cache/schemesh/history.txt`
6+
* fix issue #26: flush all open C `FILE*` streams before `fork()`ing a subshell
7+
* add shell builtin `threads`
8+
* add functions `(sh-start/fds)` `(sh-start/ports)`
9+
* add functions `(get-thread)` `(thread)` `(thread-alive?)` `(thread-count)` `(thread-find)`
10+
`(thread-id)` `(thread-initial-bindings)` `(thread-kill)` `(threads)` `(threads-status)`
11+
* add macro `(for-alist)` and function `(in-alist)`
12+
13+
314
### release v0.9.0, 2025-05-02
415

516
* fix job control bugs on macOS, fixes issue #17

doc/schemesh_as_library.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ sudo apt update
1010
sudo apt install build-essential chezscheme-dev liblz4-dev libncurses-dev git uuid-dev zlib1g-dev
1111
git clone https://github.com/cosmos72/schemesh
1212
cd schemesh
13-
git checkout -f v0.9.0
13+
git checkout -f v0.9.1
1414
```
1515

1616
Then compile schemesh as a C shared library:<br/>
1717
the following commands work at least on Linux, on other systems they may differ.
1818
```shell
1919
make clean
2020
make -j CC='cc -fPIC'
21-
cc -shared -o libschemesh_c_0.9.0.so containers.o eval.o posix.o shell.o
21+
cc -shared -o libschemesh_c_0.9.1.so containers.o eval.o posix.o shell.o
2222
```
2323

2424
Finally, from Chez Scheme REPL:
2525
```lisp
26-
(load-shared-object "./libschemesh_c_0.9.0.so")
26+
(load-shared-object "./libschemesh_c_0.9.1.so")
2727
((foreign-procedure "schemesh_register_c_functions" () int)) ; should return 0
28-
(load "./libschemesh_0.9.0.so")
28+
(load "./libschemesh_0.9.1.so")
2929
(import (schemesh))
3030
(repl) ; optional, user can also continue with Chez Scheme REPL
3131
```

examples/benchmark_sort.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
;; example file containing a benchmark for (vector-sort!) and (subvector-sort!)
33
;; it is not read, compiled nor evaluated.
44

5-
(library (schemesh benchmark sort (0 9 0))
5+
(library (schemesh benchmark sort (0 9 1))
66
(export
77
benchmark-make-vector benchmark-vector-sort! benchmark-subvector-sort! )
88
(import

examples/example_caller.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(library (schemesh example caller (0 9 0))
1+
(library (schemesh example caller (0 9 1))
22
(export call^ apply^)
33
(import
44
(rnrs)

examples/example_multitasking.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
(library (schemesh example multitasking (0 9 0))
3+
(library (schemesh example multitasking (0 9 1))
44
(export
55
tasks make-task task-yield task-resume)
66

examples/example_signal_handler.ss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(library (schemesh example signal handler (0 9 0))
1+
(library (schemesh example signal handler (0 9 1))
22
(export check-interrupts init-signal-handlers)
33
(import
44
(rnrs)

0 commit comments

Comments
 (0)