Menu

Tree [660311] master 1.0.10 /
 History

HTTPS access


File Date Author Commit
 code-samples 2013-03-18 David A. Wheeler David A. Wheeler [76d384] code-samples/srfi-13.sscm: Tweaks to improve fo...
 examples 2013-02-04 Alan Manuel K. Gloria Alan Manuel K. Gloria [0781d7] examples/simple-nfx: Update to use $nfx$
 external 2015-01-04 David A. Wheeler David A. Wheeler [989186] Update convenience copy of asdf.lisp
 lab 2013-07-26 David A. Wheeler David A. Wheeler [c4cd04] lab/scheme-to-cl: Various bugfixes
 m4 2012-07-25 David A. Wheeler David A. Wheeler [aaddfd] Beginning of autoconfiscation. Create Makefile...
 man 2013-08-19 David A. Wheeler David A. Wheeler [5b0411] man/sweet-clisp.1: Update description (we now p...
 output 2013-08-05 David A. Wheeler David A. Wheeler [cab19b] sweet.g: Simplify comment definition and suppor...
 src 2014-11-18 David A. Wheeler David A. Wheeler [70dcf5] sweet-clisp: Set readtable-case to :invert for ...
 tests 2015-01-04 David A. Wheeler David A. Wheeler [4b7920] tests/full-test-cl: Tweak so Windows SBCL works
 .gitignore 2013-07-07 Alan Manuel K. Gloria Alan Manuel K. Gloria [33c256] .gitignore: Add diff-s-sweet, which is a genera...
 AUTHORS 2012-07-25 David A. Wheeler David A. Wheeler [aaddfd] Beginning of autoconfiscation. Create Makefile...
 Analysis.md 2013-10-14 David A. Wheeler David A. Wheeler [809934] Add "Analysis.md" as a stub
 COPYING 2012-07-25 David A. Wheeler David A. Wheeler [aaddfd] Beginning of autoconfiscation. Create Makefile...
 COPYING.GPL 2013-08-19 David A. Wheeler David A. Wheeler [d7045a] Add new file COPYING.GPL
 ChangeLog 2017-09-10 David A. Wheeler David A. Wheeler [c319da] Document changes in ChangeLog
 Common-lisp-tutorial.md 2017-09-04 David A. Wheeler David A. Wheeler [0b3083] Update documentation using "make from-wiki"
 Examples.md 2017-09-10 David A. Wheeler David A. Wheeler [a8efb7] Update documentation from wiki
 Hunchentoot-make-docstrings.md 2013-10-14 David A. Wheeler David A. Wheeler [c424a6] Add Hunchentoot-make-docstrings.md
 INSTALL 2013-10-13 David A. Wheeler David A. Wheeler [8ed717] INSTALL: Tweak
 Install-howto.md 2014-12-12 David A. Wheeler David A. Wheeler [967506] Update documentation from wiki
 Makefile-demo 2013-09-28 David A. Wheeler David A. Wheeler [01964d] Makefile-demo: Improve demo, including fixing s...
 Makefile.am 2015-01-04 David A. Wheeler David A. Wheeler [04eaf2] Enable Common Lisp testing with either sbcl or ...
 NEWS 2012-07-25 David A. Wheeler David A. Wheeler [aaddfd] Beginning of autoconfiscation. Create Makefile...
 Prepackaged.md 2015-05-26 David A. Wheeler David A. Wheeler [d9572b] Minor documentation improvement (update from wiki)
 Problem.md 2013-10-14 David A. Wheeler David A. Wheeler [2e18c0] Update some markdown files - e.g., add more cro...
 README 2014-11-18 David A. Wheeler David A. Wheeler [9147e9] README: Expand it with more examples and clarif...
 README-ANTLR 2013-08-01 David A. Wheeler David A. Wheeler [dea68c] README-ANTLR: Warnings eliminated, so don't nee...
 README-files 2013-08-24 David A. Wheeler David A. Wheeler [d589aa] Document how to chang version number.
 Rationale.md 2013-10-15 David A. Wheeler David A. Wheeler [9386ec] Rationale.md: Add links to SRFI-105 and SRFI-110.
 Retort.md 2014-06-14 David A. Wheeler David A. Wheeler [a6ad24] Update documentation from wiki
 SRFI-105.html 2013-08-10 David A. Wheeler David A. Wheeler [5b57f6] SRFI-105.html: Include FINAL version of SRFI-105.
 SRFI-110.html 2013-09-09 David A. Wheeler David A. Wheeler [5d77a2] SRFI-110.html: Update to final version.
 Scheme-tutorial.md 2017-09-04 David A. Wheeler David A. Wheeler [0b3083] Update documentation using "make from-wiki"
 Solution.md 2017-09-10 David A. Wheeler David A. Wheeler [a8efb7] Update documentation from wiki
 TODO 2013-10-14 David A. Wheeler David A. Wheeler [cf6470] TODO: Remove obsolete entry
 arne-formulation.scm 2013-02-10 Alan Manuel K. Gloria Alan Manuel K. Gloria [ca2abd] arne-formulation.scm: Alternative approach, bas...
 backquote.lisp 2013-04-29 David A. Wheeler David A. Wheeler [036420] Common Lisp: Re-implement backquote/comma (adds...
 basic-curly-clisp 2013-04-20 David A. Wheeler David A. Wheeler [944c0b] basic-curly-clisp: Add this for quick debugging
 basic-curly.lisp 2014-12-10 David A. Wheeler David A. Wheeler [afe4d2] basic-curly.lisp: Fix basic-curly-read to prope...
 configure.ac 2015-05-30 David A. Wheeler David A. Wheeler [511309] Change version number to 1.0.10
 enablers.lisp 2014-12-07 David A. Wheeler David A. Wheeler [bab373] Modify Common Lisp so enable-* routines are inv...
 factorial.lisp 2014-11-18 David A. Wheeler David A. Wheeler [e13f2a] factorial.*lisp: Improve Common Lisp short demo...
 factorial.slisp 2014-11-18 David A. Wheeler David A. Wheeler [e13f2a] factorial.*lisp: Improve Common Lisp short demo...
 get-from-wiki 2013-09-28 David A. Wheeler David A. Wheeler [a30b11] Make unwriteable the generated .html files and ...
 head.html 2013-09-18 David A. Wheeler David A. Wheeler [a9f0d8] Include generated HTML from markdown in tarball...
 kernel.scm 2013-03-06 David A. Wheeler David A. Wheeler [e042b2] SRFI-110.html: Repair URL for reference impleme...
 markdown-urls 2013-09-18 David A. Wheeler David A. Wheeler [b5456b] New file: markdown-urls
 markdown2.py 2013-09-18 David A. Wheeler David A. Wheeler [a9f0d8] Include generated HTML from markdown in tarball...
 math.slisp 2014-11-17 David A. Wheeler David A. Wheeler [f4e288] math.slisp: Use standard "subseq", and use :inv...
 my-realpath 2015-01-04 David A. Wheeler David A. Wheeler [fe9982] my-realpath: Handle pathnames with whitespace
 neoteric-clisp 2013-04-20 David A. Wheeler David A. Wheeler [57b5c1] neoteric.lisp: Begin changing implementation ap...
 neoteric.lisp 2017-08-28 Matthew Stickney Matthew Stickney [9e590c] Remove trailing whitespace.
 numberize-entities 2012-09-03 David A. Wheeler David A. Wheeler [4260d5] SRFI-105.html: Switch to numeric entities - now...
 patch_cond_else 2014-07-02 David A. Wheeler David A. Wheeler [f93b60] Auto-detect if guile supports (cond..else); if ...
 print.lisp 2014-11-18 David A. Wheeler David A. Wheeler [95c5d4] print.lisp: Add MIT license text to front of file.
 readable-s-expressions-arne.org 2012-08-06 David A. Wheeler David A. Wheeler [01e1b6] Add readable-s-expressions-arne.org
 readable-s-expressions.odp 2013-09-10 David A. Wheeler David A. Wheeler [cd813b] readable-s-expressions.odp: Note that Common Li...
 readable-simple.spec 2014-12-08 David A. Wheeler David A. Wheeler [a60276] Update version number to 1.0.8 (so it's not con...
 readable.asd 2014-12-10 David A. Wheeler David A. Wheeler [328c51] Expose *original-readtable* in Common Lisp inte...
 readable.spec 2014-12-08 David A. Wheeler David A. Wheeler [a60276] Update version number to 1.0.8 (so it's not con...
 sample.arne 2013-02-10 Alan Manuel K. Gloria Alan Manuel K. Gloria [ca2abd] arne-formulation.scm: Alternative approach, bas...
 srfi-49.html 2012-12-15 David A. Wheeler David A. Wheeler [85bde3] Add srfi-49, so that it's easily compared.
 sweet.g 2013-08-19 David A. Wheeler David A. Wheeler [0206a3] Fix comment in BNF (ANTLR uses C/C++ convention...
 sweet.lisp 2014-12-07 David A. Wheeler David A. Wheeler [bab373] Modify Common Lisp so enable-* routines are inv...
 tail.html 2013-09-18 David A. Wheeler David A. Wheeler [a9f0d8] Include generated HTML from markdown in tarball...
 to-srfi 2013-08-07 David A. Wheeler David A. Wheeler [e17486] Omit "returns [Object v]" to simplify BNF produ...

Read Me

Readable Lisp S-expressions ("readable")
========================================

This "readable" software improves the readability of Lisp S-expressions
by adding up to three tiers of new s-expression abbreviations.
These tiers are (oversimplified):

1. Curly-infix-expressions (c-expressions): Lists with {...} are infix, in a
   Lispy way: {a op b ...} maps to (op a b ...). No precedence, by intent.
2. Neoteric-expressions (n-expressions): An e(...) maps to
   (e ...), and e{...} with content maps to e({...}).
3. Sweet-expressions (t-expressions): Parentheses are deduced from indentation:
   - An indented line is a parameter of its parent.
   - Later terms on a line are parameters of the first term.
   - A line with exactly one term and no child lines is simply that term.
   - Empty lines end the previous expression. Just type ENTER ENTER
     to execute what you've typed.

Unlike nearly all past efforts to improve s-expression readability, these
are general (the notation is independent from any underlying semantic)
and homoiconic (the underlying data structure is clear from the syntax).
They are also backwards-compatible; nicely-formatted traditional
s-expressions continue work normally.  Thus, it's easy to transition to
these, and you can use traditional forms whenever it's convenient.

Lisp-based languages where this approach or software can be helpful
include Scheme (including guile), Common Lisp, Emacs Lisp, Clojure, Arc,
BitC, ACL2, SUO-KIF, the GCC MiddleEndLispTranslator (MELT),
Satisfiability Modulo Theories Library (SMT-LIB), NewLisp, and ISLisp.
For Scheme these notations are defined in SRFI-105 and SRFI-110.

At this time, the implementation and tools focus on Scheme and Common Lisp,
but some of the tools can be easily used with many other Lisps.

The file "Problem.html" describes the problem this is intended to solve, and
"Solution.html" describes these notations.  Installation instructions
are in "Install-howto.html".  Hands-on tutorials are in
"Scheme-tutorial.html" and "Common-lisp-tutorial.html".  These .html
files are generated from the equivalent .md (markdown) files.

For more information, see:
  http://readable.sourceforge.net


Curly-infix-expression examples
===============================

Here are some examples of basic curly-infix-expressions:

    {3 + 4}             ; (+ 3 4)
    {a * {b + c}}       ; (* a (+ b c))

Neoteric-expression examples
============================

Here are some examples of neoteric expressions
(note that this notation is optional):

    cos(0)              ; (cos 0)
    if({n > max} max n) ; (if (> n max) max n)

Sweet-expression examples
=========================

You can optionally enable sweet-expressions. Remember:
   - An indented line is a parameter of its parent.
   - Later terms on a line are parameters of the first term.
   - A line with exactly one term and no child lines is simply that term.

Here is an example of a sweet-expression:

define fibfast(n)   ; Typical function notation
  if {n < 2}        ; Indentation, infix {...}
     n              ; Single expr = no new list
     fibup n 2 1 0  ; Simple function calls

That sweet-expression would be interpreted as:

(define (fibfast n)
  (if (< n 2)
      n
      (fibup n 2 1 0)))

A sweet-expression reader would accept *either* one.

Here's another example of a sweet-expression and its meaning:

a b c d      ; (a b c d
  e f g      ;    (e f g)
  h i        ;    (h i
    j k l    ;       (j k l)
    m n o    ;       (m n o))
  p          ;    p
  q r s      ;    (q r s))



Maturity
========

This code is *mature* and *production-ready* for Scheme and Common Lisp.
It comes with an extensive test suite, which it passes.


License
=======

With one exception, the software is released under the
"MIT license", which permits practically any use.
The MIT license is an open source software / Free Software
license approved by both the OSI (opensource.org) as an open source software
license, and by the FSF (fsf.org) as a Free software license.
See the COPYING file for the license text.

The one exception is the file "sweet-clisp", which interfaces to clisp.
Most of this file is also licensed under the MIT license.
However, that file contains code derived from the "clisp" program itself.
Clisp is licensed under the "GNU General Public License version 2 (GPLv2)",
so those parts are also under the GPLv2 (see the file for details).
The GPLv2 is also an open source software / Free Software license approved
by both the OSI (opensource.org) as an open source software license,
and by the FSF (fsf.org) as a Free software license.
See the COPYING.GPL file for the conditions for the "sweet-clisp" program.


Getting, building, and installing
=================================

Most people should get the current stable version.  To get the whole package:

* Use your web browser to view http://readable.sourceforge.net
* Click on "Download files"
* Download the current version.

You'll then need to uncompress it.  One way is via the command line:

    tar xvzf readable-*.tar.gz
    cd readable-*

Then follow the installation instructions in the file
"Install-howto.md".  Stable versions also have a file named
"Install-howto.html", which are exactly the same instructions in HTML format
(you can use your web browser!).  The installation instructions are also at:
https://sourceforge.net/p/readable/wiki/Install-howto/

You can also get the development version using "git".
In git the "master" branch contains final released versions, while
the "develop" branch contains the version in development.

This software supports the usual GNU Build System conventions, and
it should be easy to install on most systems.  If you have
very exotic needs, the file INSTALL gives details on how
to precisely control the installation.  For most people the automatic
install will "do the right thing".

Users who only want to use the Common Lisp library can use QuickLisp instead.


Scheme Tutorial
==============

File "Scheme-tutorial.html" is the Scheme tutorial on how to use it.
You need guile to follow it.


Common Lisp Tutorial
====================

File "Common-lisp-tutorial.html" is the Common Lisp tutorial for how to use it.
Any Common Lisp implementation should do, but you need the widely-used system
definition facility ASDF, or use QuickLisp, as described in "Install-howto".
Once installed, you can directly use these notations within your
Common Lisp implementation.


Specification
====================

For Scheme, SRFI-105 (in file "SRFI-105.html") is the official definition of
full curly-infix notation, and it also defines neoteric-expressions.
SRFI-110 (in file "SRFI-110.html" defines sweet-expressions.
SRFI-110 has an especially rigorous BNF.

The file "Solution.md" is the official definition for all other Lisps.
The file "Solution.html" is the same thing in HTML format.
If it's unclear what something means, look at SRFI-105 and SRFI-110
for clarification, but note that the SRFIs include various
Scheme-specific material (e.g., #!sweet is a Scheme-specific mechanism
for enabling sweet-expressions).


Transitioning
=============

The "sweeten" tool is a pretty-printer that translates
s-expressions to sweet-expressions.  You can use "sweeten" to create a file,
hand-tweak the result to make it "prettier", and then use "diff-s-sweet"
to verify that your newly-formatted file has exactly the same meaning.

The "unsweeten" tool can be used as a sweet-expression pre-processor,
so you can use these notations even if your Lisp implementation does not
yet support them.

By default the "sweeten" and "unsweeten" tools process Scheme; if you
have Common Lisp (or something like it), provide the "-C" (Common Lisp)
option as documented.  They can be used as front-ends for other tools.


For more information
===================

For more information, see:
  http://readable.sourceforge.net

Discussions are held on its "readable-discuss" mailing list.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.