Releases: Shen-Language/shen-sources
Releases · Shen-Language/shen-sources
Shen OS Kernel 20.1
Added
(command-line)
function that returns a list of command line fragments. By default it returns["shen"]
, ports can override this function or set the value of the*argv*
variable on startup.
Fixed
- Fixed
dict-fold
. - Handle integer overflows in prolog's complexity calculation function. Solves issues in ports with 32bit integers.
- In the 20.0 release,
*sterror*
was not properly set as external inmake.shen
, fixed now.
Shen OS Kernel 20.0
Added
- Documentation for system functions (
doc/system-functions.md
). - Character based I/O, makes Shen work on environments where I/O streams are multibyte encoded (SBCL >= 1.1.2 on Windows).
- Dict datatype with API:
(dict Size)
— returns dictionary object.(dict? Dict)
— predicate.(dict-count Dict)
— returns dictionary items count.(dict-> Dict Key Value)
— stores value.(<-dict Dict Key)
— retrieves value if it exists or throws an error.(<-dict/or Dict Key OrDefault)
— like<-dict
but returns the result of thawingOrDefault
instead of throwing an error when the key is missing.(dict-rm Dict Key)
— removes value from a dictionary.(dict-fold F Dict Acc)
— walks the dictionary, calling(F Key Value Acc)
for each item in it. The result of each call is the new value ofAcc
, once no more items are left, the final value ofAcc
is returned.(dict-keys Dict)
— Returns a list containing all keys inDict
.(dict-values Dict)
— Returns a list containing all values inDict
.
- Added
get/or
,value/or
,<-address/or
and<-vector/or
. These work like their/or
-less counterparts, but accept as an extra argument a continuation ((freeze ...)
). Whenever their original versions would raise an exception, these variants will insteadthaw
the continuation and return it's result. - Added
(fold-left F Acc List)
. Calls(F Acc Elt)
for everyElt
element inList
. The result of each call toF
is used as the newAcc
for the next call. The final result is the return value of the last call toF
. - Added
(fold-right F List Acc)
. Calls(F Elt Acc)
for everyElt
element inList
. The result of each call toF
is used as the newAcc
for the next call. The final result is the return value of the last call toF
. - Added
(for-each F List)
. CallsF
on every element ofList
(in order), ignoring the results. - Added
(filter Predicate List)
. Returns a new lost with all elements to which(Predicate Elt)
returns true. - Added
(exit ExitCode)
. Exits the program using the specified error code. The default implementation just ends the REPL loop, ports have to overrideexit
if they want the exit code to have any effect. - Added
*sterror*
and(sterror)
, STDERR port. Defaults to an alias of*stoutput*
. - Added
(read-char-code Stream)
. Reads a character from a stream, and returns its numeric value. - Added
(read-file-as-charlist Name)
. Reads the contents of a file as a sequence of characters. The result if a list of numeric character codes.
Changed
- Reader is now built on top of
read-char-code
instead ofread-byte
. As a result, Shen's REPL now works on multibyte environments, like SBCL >= 1.1.2 on Windows. - Reimplemented
put
andget
on top of dicts. - Reimplemented runtime function lookup using
put
andget
. - Changed
hash
so that 0 is a valid return value. - Changed
make.shen
so that 19.2 can correctly compile the new version without needing two passes. - Ctrl+D (EOF) in the REPL when the line is empty, exits Shen.
Fixed
- Declared arity for system functions that were missing it.
- Fixed package prefix handling for internal package symbols.