Going beyond filesystem based library loading

In this post, Edward explains how he extended the library loading facilities in Ikarus to allow loading from not only the file system, but also URLs, and some day maybe even SQLite databases. Very nice!

Background:

The report does not specify how source code is represented and stored. The only requirement the report imposes is that the source code of a top-level program (see report section on “Top-level program syntax”) or a script (see section D.2) be delimited. The source code of a library is self-delimiting in the sense that, if the beginning of a library form can be identified, so can the end.

Implementations may take radically different approaches to storing source code for libraries, among them: files in the file system where each file contains an arbitrary number of library forms, files in the file system where each file contains exactly one library form, records in a database, and data structures in memory.

Similarly, programs and scripts may be stored in a variety of formats. Platform constraints may restrict the choices available to an implementation, which is why the report neither mandates nor recommends a specific method for storage.

Revised 6 Report on the Algorithmic Language – Non-Normative Appendices – Appendix E – Source code representation

What are syntax-case pattern variables?

I asked here:

syntax-case takes a syntax object as an argument and destructures it via pattern matching into pattern variables.
What are pattern variables composed of?
syntax takes a template, and the pattern variables in it, to produce a syntax object that has the same lexical scoping as that of the pattern variable, so where does that lexical scope get stored?

and then Ryan explained:

The short answer is that syntax objects store scoping information and
that pattern variables have nothing to do with it.
Here’s a longer answer:
A pattern variable is essentially bound to an ellipsis-depth n and syntax object(s). If the pattern variable doesn’t have ellipses after it, then n is 0 and the pattern variable refers to a single syntax object. If it has one ellipsis after it, then n is 1 and there is a list of syntax objects. And so forth.
The ‘syntax’ form is like ‘quasiquote’, except that there is no explicit ‘unquote’; rather, pattern variables are automatically substituted, and the rest of the template becomes syntax object literals (via ‘quote-syntax’) that remember the bindings in scope where they occurred.
So pattern variables, while convenient, are not necessary for writing macros. You could do just the same with ‘quote-syntax’, ‘syntax-e’, ‘datum->syntax’, ‘car’, etc.
Lexical scoping is managed by the syntax objects. The macro arguments already have their lexical contexts embedded in them, and that is preserved as the macro takes them apart and puts them together with new syntax. This new syntax mostly comes from syntax literals.
The essence of the algorithm is explained in “Syntactic Abstraction in Scheme” by Dybvig et al.

A Scheme program that drives wheelchairs

You can read about a Scheme program that drives wheelchairs using machine learning and induction here:


;; Larceny version.
;; This program is part of a pattern recognition
;; system that drives a wheel-chair for quadriplegic
;; people: www.ciaem.org.br/ciaem.qps/Ref/QUIS-7GJP7J
;; A description of the complete system, written in
;; Scheme by Philippos, will be published in a paper
;; by Marcus Vinicius dos Santos, that can be reached
;; at web.mac.com/marcusvsantos/iWeb/Site/About%20Me.html
;; The wheel chair learns how to recognize EMG signals
;; from facial muscles. A neural network recognizes
;; the coeficients of a polynomial approximation of
;; the signal, and drives the chair accordingly.
;; The chair will be available soon, although the
;; pattern recognition version needs a special
;; order, and user training. This Larceny version
;; is not used in the chair prototype.
;; Store in file larcenet.scm

Already Postive Change for R7RS

The R7RS steering committee will be updating the charter to allow for another two members in the steering committee: Olin Shivers and Chris Hanson. Two more members is a good thing. Additionally, the post hints that the passionate discussion on the R6RS mailing list may have payed off with changes to the process that will better represent all of the community. I look forward to what comes of this.

(via PLT)