Readable Lisp S-expressions ("readable") https://sourceforge.net/p/readable/wiki/Solution/
Find a file
2013-09-26 23:05:33 -04:00
code-samples code-samples/srfi-13.sscm: Tweaks to improve formatting 2013-03-17 20:35:44 -04:00
examples examples/simple-nfx: Update to use $nfx$ 2013-02-05 06:06:07 +08:00
lab lab/scheme-to-cl: Various bugfixes 2013-07-25 23:39:21 -04:00
m4 Beginning of autoconfiscation. Create Makefile.am and configure.ac 2012-07-25 06:53:16 -04:00
man man/sweet-clisp.1: Update description (we now patch clisp) 2013-08-19 18:13:04 -04:00
output sweet.g: Simplify comment definition and supporting definitions generally 2013-08-05 18:10:59 -04:00
src src/sweeten.sscm: Minor simplification of code format 2013-09-01 16:17:31 -04:00
tests Add tests for numeric fraction 2013-08-19 18:44:12 -04:00
.gitignore .gitignore: Add diff-s-sweet, which is a generated script. 2013-07-07 14:16:58 +08:00
arne-formulation.scm arne-formulation.scm: Alternative approach, based on Arne Babenhauserheide's ideas 2013-02-10 20:46:12 +08:00
AUTHORS Beginning of autoconfiscation. Create Makefile.am and configure.ac 2012-07-25 06:53:16 -04:00
backquote.lisp Common Lisp: Re-implement backquote/comma (adds file backquote.lisp) 2013-04-29 18:03:43 -04:00
basic-curly-clisp basic-curly-clisp: Add this for quick debugging 2013-04-20 19:23:37 -04:00
basic-curly.lisp Common Lisp: Improve performance of enable-... when already enabled 2013-05-19 22:48:42 -04:00
ChangeLog ChangeLog: Document the major changes. 2013-09-26 23:04:18 -04:00
Common-lisp-tutorial.md Update README, INSTALL, and some ".md" files so install info isn't duplicated 2013-09-26 22:37:19 -04:00
configure.ac configure.ac: Fix error messages (should use "-" not "_"). 2013-09-24 19:18:42 -04:00
COPYING Beginning of autoconfiscation. Create Makefile.am and configure.ac 2012-07-25 06:53:16 -04:00
COPYING.GPL Add new file COPYING.GPL 2013-08-19 18:01:55 -04:00
Examples.md Add Examples.md to git repo 2013-09-20 00:28:19 -04:00
factorial.lisp factorial.lisp: Improve comments. 2013-08-10 13:59:08 -04:00
factorial.slisp factorial.slisp: Fix comment (file has been renamed) 2013-08-07 18:46:15 -04:00
get-from-wiki get-from-wiki: Minor output format tweaks 2013-09-26 21:08:27 -04:00
head.html Include generated HTML from markdown in tarball and installation 2013-09-17 22:43:04 -04:00
INSTALL Update README, INSTALL, and some ".md" files so install info isn't duplicated 2013-09-26 22:37:19 -04:00
Install-howto.md Update Install-howto.md 2013-09-26 22:48:25 -04:00
kernel.scm SRFI-110.html: Repair URL for reference implementation 2013-03-06 18:59:16 -05:00
Makefile-demo Makefile-demo: Simplify. 2013-09-10 18:23:08 -04:00
Makefile.am Makefile.am: Briefly document, in comments, the new "make from-wiki" command 2013-09-26 22:36:31 -04:00
markdown-urls New file: markdown-urls 2013-09-18 17:58:21 -04:00
markdown2.py Include generated HTML from markdown in tarball and installation 2013-09-17 22:43:04 -04:00
my-realpath my-realpath, Makefile.am: Replace reference to non-portable realpath command. 2013-07-07 07:56:17 +08:00
my-subst Distribute and install sweet-run as part of package. 2012-07-28 14:25:33 -04:00
neoteric-clisp neoteric.lisp: Begin changing implementation approach 2013-04-20 19:36:26 -04:00
neoteric.lisp neoteric.lisp: Fix spelling in comment 2013-08-17 14:38:15 -04:00
NEWS Beginning of autoconfiscation. Create Makefile.am and configure.ac 2012-07-25 06:53:16 -04:00
numberize-entities SRFI-105.html: Switch to numeric entities - now it's fully HTML 3.2. 2012-09-03 09:44:45 -04:00
Problem.md Add "Problem.md" to the set of distributed markdown files. 2013-09-19 22:42:13 -04:00
Rationale.md Add markdown/html stub files so clicking on links doesn't fail 2013-09-19 22:57:04 -04:00
readable-s-expressions-arne.org Add readable-s-expressions-arne.org 2012-08-06 20:07:49 -04:00
readable-s-expressions.odp readable-s-expressions.odp: Note that Common Lisp code is MIT-licensed 2013-09-09 21:03:12 -04:00
readable-simple.spec readable-simple.spec: Remove obsolete TODO 2013-09-24 18:37:23 -04:00
readable.asd Update "develop" version numbers to 0.9.3 2013-08-26 00:06:14 -04:00
readable.spec readable.spec: By default do not include scsh in rpm file 2013-09-24 19:12:23 -04:00
README Update README, INSTALL, and some ".md" files so install info isn't duplicated 2013-09-26 22:37:19 -04:00
README-ANTLR README-ANTLR: Warnings eliminated, so don't need to justify them. 2013-08-01 07:43:52 -04:00
README-files Document how to chang version number. 2013-08-24 08:10:38 -04:00
Retort.md Add markdown/html stub files so clicking on links doesn't fail 2013-09-19 22:57:04 -04:00
sample.arne arne-formulation.scm: Alternative approach, based on Arne Babenhauserheide's ideas 2013-02-10 20:46:12 +08:00
Scheme-tutorial.md Update README, INSTALL, and some ".md" files so install info isn't duplicated 2013-09-26 22:37:19 -04:00
Solution.md Update README, INSTALL, and some ".md" files so install info isn't duplicated 2013-09-26 22:37:19 -04:00
srfi-49.html Add srfi-49, so that it's easily compared. 2012-12-15 18:23:24 -05:00
SRFI-105.html SRFI-105.html: Include FINAL version of SRFI-105. 2013-08-10 10:28:04 -04:00
SRFI-110.html SRFI-110.html: Update to final version. 2013-09-09 08:19:39 -04:00
sweet-clisp Make it clear that sweet-clisp (but not the rest) is GPLv2. 2013-08-19 18:04:20 -04:00
sweet-sbcl sweet-sbcl: Update and simplify 2013-08-07 19:07:28 -04:00
sweet.g Fix comment in BNF (ANTLR uses C/C++ convention not Lisp convention) 2013-08-19 18:08:21 -04:00
sweet.lisp sweet.lisp: Simplify re-enabling char-by-char debug printouts 2013-08-17 17:25:59 -04:00
tail.html Include generated HTML from markdown in tarball and installation 2013-09-17 22:43:04 -04:00
to-srfi Omit "returns [Object v]" to simplify BNF productions. 2013-08-06 23:20:35 -04:00
TODO Include generated HTML from markdown in tarball and installation 2013-09-17 22:43:04 -04:00

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 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. Hands-on tutorials are in
"Scheme-tutorial.html" and "Common-lisp-tutorial.html".

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


Example
=======

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.


Maturity
========

This code is *mature* and *production-ready*, and comes with an
extensive test suite.


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.
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 those conditions.


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

Most people should get the current stable version.  To get it:

* 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 is exactly the same thing but in HTML format
(use your web browser!).  The installation instructions are also at:
https://sourceforge.net/p/readable/wiki/Install-howto/

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
installation.



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.  A "make install" puts files in the usual place,
$PREFIX/share/common-lisp/source (where $PREFIX is /usr/local by default).


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.html" is the official definition for all other Lisps.
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.