chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] Add initial version of (chicken base)


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Add initial version of (chicken base)
Date: Mon, 11 Sep 2017 19:35:33 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Hi all,

Attached is a first stab at a (chicken base) module.  I implemented what
was on the wiki and took the liberty of adding a few "obvious" candidates
to the list, and implementing that at the same time.  These additions are:

- case-lambda
- define-constant
- define-record-type (we already had only define-record)
- define-record-printer
- define-values
- exact-integer?
- exact-integer-sqrt and exact-integer-nth-root
- include-relative
- let-optionals and optional
- let{,*,rec}-values
- nth-value
- notice (we already had "warning" and "error", however, notice seems
          to be used mostly in the compiler)
- use
- require-library
- require-extension
- quotient&{remainder,modulo}

I'm not 100% sure about require-library, require-extension and use,
especially given that import is in (chicken module).

I've put a few even more questionable entries under TODO on the wiki
core-library-reorganization page.

IMO, ideally in the end we'd only have (module) declarations and (set!)
calls at the toplevel in library.scm.  However, we need to find out how
to control what's available at toplevel and in macros by default.
Currently only the toplevel definitions are visible there, which is
why I had to add a nasty hack at the end of the file to ensure that
add1, sub1 and gensym are available in macros (without the hack,
everything will break).

I think by default the entire scheme and (chicken base) modules should
be available at the regular and meta toplevels.

I'm less certain what we should add to the non-macro toplevel default
Perhaps (chicken type), (chicken fixnum), (chicken flonum) and
(chicken foreign) [the latter for compiled code], but we could also
keep it otherwise empty, or even add everything from library.scm, much
like we do today in CHICKEN 4.  This would make it easier for scripts,
but perhaps a bit more confusing for beginners ("what do you mean,
sometimes I have to import and sometimes it's already there?!!")
Clear documentation is a must in any case.

Cheers,
Peter

Attachment: 0001-Add-priliminary-version-of-chicken-base-module.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]