Comments (12)
According to the r7rs specification, the full list of changes up to this point is as follows. I will cross these out as support is added to husk:
Libraries have been added as a new program structure
to improve encapsulation and sharing of code. Some
existing and new identifiers have been factored out
into separate libraries. Libraries can be imported into
other libraries or main programs, with controlled exposure
and renaming of identifiers. The contents of a
library can be made conditional on the features of the
implementation on which it is to be used. There is an
R5RS compatibility library.The expressions types include, include-ci, and
cond-expand have been added to the base library;
they have the same semantics as the corresponding
library declarations.- Exceptions can now be signaled explicitly with raise,
raise-continuable or error, and can be handled
with with-exception-handler and the guard syntax.
Any object can specify an error condition; the
implementation-defined conditions signaled by error
have a predicate to detect them and accessor functions
to retrieve the arguments passed to error. Conditions
signaled by read and by file-related procedures also
have predicates to detect them. New disjoint types supporting access to multiple fields
can be generated with the define-record-type of
SRFI 9 [19]Parameter objects can be created withThe procedures current-input-port
make-parameter, and dynamically rebound with
parameterize.
and current-output-port are now parameter
objects, as is the newly introduced
current-error-port.Bytevectors, vectors of exact integers in the range
from 0 to 255 inclusive, have been added as a new
disjoint type. A subset of the vector procedures is
provided. Bytevectors can be converted to and from
strings in accordance with the UTF-8 character encoding.
Bytevectors have a datum representation and
evaluate to themselves.Vector constants evaluate to themselves.The procedure read-line is provided to make line-oriented textual input simpler.The procedure flush-output-port is provided to allow minimal control of output port bu�ffering.Ports can now be designated as textual or binary ports,
with new procedures for reading and writing binary
data. The new predicates input-port-open? and
output-port-open? return whether a port is open or
closed. The new procedure close-port now closes a
port; if the port has both input and output sides, both
are closed.String ports have been added as a way to read and
write characters to and from strings, and bytevector
ports to read and write bytes to and from bytevectors.There are now I/O procedures specific to strings and
bytevectors.The R6RS procedure eof-object has been added. Eof-objects are now required to be a disjoint type.Syntax definitions are now allowed wherever variable
definitions are.The syntax-rules construct now allows the ellipsis.
symbol to be specified explicitly instead of the default
..., and allows tail patterns to follow an ellipsis patternThe syntax-error syntax has been added as a way to signal immediate and more informative errors when a macro is expanded.The letrec* binding construct has been added, and internal define is specified in terms of it.- Support for capturing multiple values has been
enhanced with define-values,let-values, and. Standard expression types which contain
let*-values
a sequence of expressions now permit passing zero
or more than one value to the continuations of all non-
final expressions of the sequence. The case conditional now supports => syntax analogous to cond not only in regular clauses but in the else clause as well.To support dispatching on the number of arguments
passed to a procedure, case-lambda has been added
in its own library.The convenience conditionals when and unless have been added.- The behavior of eqv? on inexact numbers now conforms
to the R6RS definition. When applied to procedures, eq? and eqv? are permitted to return diff�erent answers.The R6RS procedures boolean=? and symbol=? have been added.The log procedure now accepts a second argument specifying the logarithm base.The procedures map and for-each are now required to terminate on the shortest argument list.The procedures member and assoc now take an optional
third argument specifying the equality predicate
to be used.The numeric procedures finite?, infinite?, nan?, exact-integer?, square, and exact-integer-sqrt have been added.Positive infinity, negative infinity, NaN, and negative
inexact zero have been added to the numeric
tower as inexact values with the written representations
+inf.0, -inf.0, +nan.0, and -0.0 respectively.
Support for them is not required. The representation
-nan.0 is synonymous with +nan.0.The - and / procedures and the character and string
comparison predicates are now required to support
more than two arguments.The forms #true and #false are now supported as well as #t and #f.The procedures make-list, list-copy, list-set!,
string-map, string-for-each, string->vector,
vector-append, vector-copy, vector-map,
vector-for-each, vector->string, vector-copy!,
and string-copy! have been added to round out the
sequence operations.Some string and vector procedures support processing of part of a string or vector using optional start and end arguments.Implementations may provide any subset of the full Unicode repertoire that includes ASCII, but implementations must support any such subset in a way consistent with Unicode.Various character and string procedures have been extended accordingly, and caseconversion procedures added for strings. String comparison is no longer required to be consistent with character comparison, which is based solely on Unicode scalar values.The new digit-value procedure has been added to obtain the numerical value of a numeric character.Strings and symbols now allow mnemonic and numeric escape sequences, and the list of named characters has been extended.The procedures file-exists? and delete-file are available in the (scheme file) library.An interface to the system environment, command
line, and process exit status is available in the (scheme
process-context) library.Procedures for accessing time-related values are available in the (scheme time) library.- A less irregular set of integer division operators is provided
with new and clearer names. The load procedure now accepts a second argument specifying the environment to load into.The call-with-current-continuation procedure now has the synonym call/cc.The semantics of read-eval-print loops are now partly prescribed, requiring the redefinition of procedures, but not syntax keywords, to have retroactive eff�ect.The formal semantics now handles dynamic-wind.Transcript-on and transcript-off have been removed.
The following are unlikely to be implemented:
- Some list procedures are now defined on circular lists.
- The write procedure now generates datum labels
when applied to circular objects. The new procedure
write-simple never generates labels; write-shared
generates labels for all shared and circular structure.
The display procedure must not loop on circular objects. - Data prefixed with datum labels #= can be referenced
with ##, allowing for reading and writing of
data with shared structure. - The syntax-rules construct now allows template escapes with an ellipsis-prefixed
list. - There are now two additional comment syntaxes: #;
to skip the next datum,and #| ... |# for nestable.
block comments - Support for promises has been enhanced based on
SRFI 45 (cannot be implemented directly per spec due to Husk's restrictions ofset-car!
andset-cdr!
). - Case folding, EG: include-ci
from husk-scheme.
Of all of those, I'd really love to see the R7RS module system. That would help greatly with code structuring when using scheme as an extension language for a Haskell program.
from husk-scheme.
Thanks for the feedback. I had been holding off on this because WG1 has made changes to the module section since their first draft. But modules are the most important addition in R7RS and even a minimal, partial implementation would probably be useful in husk...
from husk-scheme.
If you think that the module API will change incompatibly before the final release of R7RS, then by all means feel free to wait until it becomes more stable. No rush.
from husk-scheme.
The plan is for the next release of husk to start having limited support for R7RS-style modules.
Going forward, R7RS items may be added as extensions if they are new "features" that do not break existing R5RS functionality. Any breaking changes will have to be included in a future "R7RS" mode, probably via command line arguments used to load a separate environment.
from husk-scheme.
Notes on how Gauche is implementing R7RS:
http://blog.practical-scheme.net/gauche/20130522-r7rs
from husk-scheme.
call-with-port would be a great addition.
from husk-scheme.
@jrmithdobbs - Thanks for the suggestion, this is a simple function to provide...
from husk-scheme.
Awesome. Also wondering why the srfi45 inspired changes aren't planned? It seems to me delay-force (srfi45's "lazy") should be fairly straightforward, easier, even, than most other implementations given the host metalanguage. :)
from husk-scheme.
@jrmithdobbs - Unfortunately, the way Husk is written makes it more difficult to implement SRFI 45 from spec. The problem is that set-car!
and set-cdr!
operate on Haskell lists instead of pointers. So you can't do some of the usual tricks with them that other Schemes support. Sorry :(
Nothing against SRFI 45. I would take a pull request for it, just have no plans to implement it anytime soon.
from husk-scheme.
Ah! Makes sense. Figured there was a reason. Why I asked. ;)
from husk-scheme.
Sure, no problem. I should be more clear about why it is on that list.
In any case this is an unfortunate restriction but there are ways to work around it.
from husk-scheme.
Related Issues (20)
- Reader hangs with or/define/cond combination HOT 3
- Add call history reporting for compiled programs
- Add a husk header to the user manual
- Issues from R7RS Considered Unifier of Previous Standards ∗ HOT 4
- Extraneous trailing parentheses are allowed HOT 2
- Non sense error when trying to load SRFI-13 reference implementation HOT 6
- Implement "hash-table-ref/default" in SRFI-69 HOT 2
- "format" fn from SRFI-28 broke some non-standard ASCII chars (UTF-8 set) HOT 2
- Error during macro expansion when referencing another non-exported variable from library HOT 1
- Build with -fuseffi fails HOT 6
- Hardcoded quote
- Problem importing definitions that are in (scheme) but not (scheme base) HOT 4
- ghc-8.6.5 HOT 5
- Problem building HOT 2
- Return value to shell on errors is not always set.
- News article HOT 2
- Build failures with GHC 9.0.1
- Cannot find load file if loading from another directory
- 9.6.1 HOT 1
- Build failures with ghc 9.8.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from husk-scheme.