416 commits

Author SHA1 Message Date
David A. Wheeler
70dcf5a2fd sweet-clisp: Set readtable-case to :invert for improved lowercase display. 2014-11-18 17:37:31 -05:00
David A. Wheeler
c95ac2075f sweet-sbcl: Enable lowercase input and output using readtable-case invert.
- This now runs "(setf (readtable-case *readtable*) :invert)",
    which enables nice symbol input and output in lowercase.
    The "invert" mechanism is kind of a hack in Common Lisp, but it
    gets nice results and is completely standard.
2014-11-18 13:03:32 -05:00
David A. Wheeler
8217a71e06 Fix "appende" (though it doesn't really matter).
- The "appende" function should have (append x y) as the normal case,
    so change to that.  In practice, these have been optimized out,
    so the bug cannot appear in practice, but may as well be clean.
2014-11-18 12:19:28 -05:00
David A. Wheeler
cfc5606bb5 sweet-clisp: Add support for *repl-write-readable* to control writing 2014-10-18 12:58:30 -04:00
David A. Wheeler
31ae99b5db sweet-clisp: Change REPL to use readable:write-readable instead of write.
- This makes the results prettier in many cases, especially when you
    also use clisp's "-modern" flag.
2014-10-18 11:59:10 -04:00
David A. Wheeler
95d351700a On line continuation allow further indents 2014-07-05 21:52:37 -04:00
David A. Wheeler
cf8b92ab90 Update copyright end date (2014) in src/kernel.scm and sweet.lisp 2014-07-05 11:14:50 -04:00
David A. Wheeler
615d411f4e src/kernel.scm: Add comments to explain many productions 2014-07-05 10:59:58 -04:00
David A. Wheeler
2b7caab20b src/kernel.scm: Remove question. Collecting-content just returns result. 2014-07-05 10:41:21 -04:00
David A. Wheeler
d07487b2d7 src/kernel.scm: Improve local extension (\\ as line continuation) 2014-07-05 10:21:52 -04:00
David A. Wheeler
5a5b149e2e Add local extension (\\ as line-continuation) for Common Lisp compatibility
- As a local extension, allow \\ as line-continuation for
   compatibility with the Common Lisp implementation.
   This is *NOT* a SRFI-110 requirement.
2014-07-04 11:27:06 -04:00
David A. Wheeler
f93b602127 Auto-detect if guile supports (cond..else); if not (v1.6), patch library
- Determine if guile can handle cond...else.  This is standard Scheme,
    and chicken Scheme complains if you use cond...#t.  Sadly,
    guile 1.6 doesn't support it.  So we'll try to use it; if it fails,
    we will set PATCH_COND_ELSE to a program that fixes it
    (patch_cond_else).  Normally PATCH_COND_ELSE will be ":", which is a no-op.
2014-07-02 00:16:05 -04:00
David A. Wheeler
34f2a73013 kernel.scm: Patch guile srfi-69 imports to work on 1.8 AND 2.0 2014-06-30 18:35:54 -04:00
David A. Wheeler
11cac58a4b kernel.scm: Remove warning when using guile 2.0; (ice-9 syncase) is obsolete. 2014-06-30 18:02:31 -04:00
David A. Wheeler
3c02473a19 kernel.scm: Change keyword manipulation to work on guile 2.0 2014-06-30 17:55:58 -04:00
David A. Wheeler
a3b158018b Modify sweet-run so it returns exit code, add test of sweet-run 2014-06-14 17:56:45 -04:00
Elliott Cable
ee1a859e46 fix: sweet-run invokes mktemp in a Darwin-friendly way
This fixes the following error arising on Mac OS X machines:

    > sweet-run something.sscp
    usage: mktemp [-d] [-q] [-t prefix] [-u] template ...
          mktemp [-d] [-q] [-u] -t prefix
    /usr/local/bin/sweet-run: line 20: : No such file or directory
    chmod: fts_open: No such file or directory
    /usr/local/bin/sweet-run: line 30: ./: is a directory

The meat of the solution is by "krinkle" [on Stack Overflow.][1]

   [1]: <http://unix.stackexchange.com/a/84980> "Fix or alternative
for mktemp in OS X"

Signed-off-by: elliottcable <me@ell.io>
2014-06-14 17:03:10 -04:00
David A. Wheeler
010abae29d Improve Scheme error reporting when given "Unexpected text after n-expression"
- Now we report the next (peeked) character when we have
    unexpected text.   This should make it easier for developers to figure
    out what the problem is.
2013-12-06 23:14:38 -05:00
David A. Wheeler
55c86c59ee src/kernel.scm: Add as delimiters #\' and #\` and #\,
- Add as delimiters #\' and #\` and #\.  These are not required
    to be delimiters in Scheme, but they can be, and doing so
    means that we can detect syntax errors of very dodgy constructs.
    This means that x'y will be considered an error, not a 3-char symbol.
    We can already express that as |x'y|, and (x 'y) or x('y) work
    for making a list.
2013-12-06 23:09:33 -05:00
David A. Wheeler
c1dde47988 src/kernel.scm: Fix comment typo 2013-12-06 23:08:50 -05:00
David A. Wheeler
9f15796932 src/kernel.scm: Remove last rscheme warning.
- From Jörg F. Wittenberger
2013-11-24 08:18:49 -05:00
David A. Wheeler
ca57f96650 src/kernel.scm: Clean up cond-expand formatting 2013-11-23 17:51:10 -05:00
David A. Wheeler
0e6f950c41 src/kernel.scm: Many compatibility-layer changes for rscheme
- Provided by Jörg F. Wittenberger
2013-11-23 16:57:55 -05:00
David A. Wheeler
3c3cb40992 src/kernel.scm: Fix bug in n-expr-or-scomment
- Provided by Jörg F. Wittenberger
2013-11-23 15:06:26 -05:00
David A. Wheeler
bc079d9a2e src/kernel.scm: Rename "body" to "read-body" for rscheme 2013-11-23 14:57:25 -05:00
David A. Wheeler
e8a216bdf0 src/kernel.scm: Add type annotations and tweak translate-cl
- Improvements from Jörg F. Wittenberger, 2013-11-21
    "[Readable-discuss] initial support for rscheme".

--- David A. Wheeler
2013-11-22 08:55:38 -05:00
David A. Wheeler
809f81639d src/kernel.scm: Tweak so "#:" never appears in the source (for portability)
- Many Schemes reject "#:...".  This modifies the guile-specific
    code so that it doesn't use #:..., resulting in more portable source code.
2013-11-18 23:33:12 -05:00
David A. Wheeler
540889824d src/kernel.scm: Use (no-values) when no defined value is returned
- This is more portable; some Schemes have trouble with
    something returning (values) in the middle of a (begin ...) sequence.
2013-11-18 23:10:15 -05:00
David A. Wheeler
93a55c6af2 src/kernel.scm: Add type annotation for process-curly 2013-11-18 00:58:53 -05:00
David A. Wheeler
1663c1d5ac src/kernel.scm: Add more type annotations 2013-11-18 00:51:05 -05:00
David A. Wheeler
5b0a7d0cda src/kernel.scm: Optimize read-digits by putting character check inline
- This approach was recommended by Jörg F. Wittenberger
2013-11-18 00:28:18 -05:00
David A. Wheeler
3e57a68247 src/kernel.scm: Remove obsolete definition "current-read-mode" 2013-11-18 00:20:57 -05:00
David A. Wheeler
e6089c80eb src/kernel.scm: Reorganize portability layer, putting all guile things together 2013-11-18 00:15:13 -05:00
David A. Wheeler
9158654cad src/kernel.scm: Remove tabs
- Remove a few stray tab characters.  Generally we use only spaces,
    since they work exactly the same way everywhere.
2013-11-18 00:11:30 -05:00
David A. Wheeler
bb5e087257 src/kernel.scm: Add type annotations (Joerg F. Wittenberger)
- Add type annotations in chicken format. Original version provided
    by Joerg F. Wittenberger on Sun, 17 Nov 2013 21:31:34 +0100.
    These verify in "chicken -strict-types" mode.
    David A. Wheeler had to massage things so guile would skip the annotations.
2013-11-18 00:01:30 -05:00
David A. Wheeler
1ac746c463 Add #!keyword-prefix and #!keyword-suffix support
- Add support for STUFF: and :STUFF as possible keywords.
    This can be enabled/disabled through #![no-]keyword-prefix|suffix
    and through set-read-mode.
2013-11-17 20:26:21 -05:00
David A. Wheeler
dcba5eb650 src/kernel.scm: Bugfix, change all "eq" to "eq?" 2013-11-17 08:41:45 -05:00
David A. Wheeler
a4256d33bc Move guile-specific initialization to guile-specific section
- This should help portability
2013-11-16 20:50:57 -05:00
David A. Wheeler
6849ae4cb6 Fix comment - we don't use guile-specific stuff there any more. 2013-11-16 20:46:20 -05:00
David A. Wheeler
22602c2309 Implement "guard" on old guile, so we can use R6RS/R7RS syntax 2013-11-16 20:40:36 -05:00
David A. Wheeler
3da79d58f8 Change "throw" to "raise", and implement in guile via macro 2013-11-16 20:10:49 -05:00
David A. Wheeler
2b61c83fe9 Make flush-output-port work on chicken scheme as well as guile
- Eventually integrate this into the portability layer.
2013-11-13 23:38:13 -05:00
David A. Wheeler
8d06de3122 src/kernel.scm: Change (cond .. #t) to (cond .. else) (Joerg F. Wittenberger)
- Change all final "otherwise" cond clauses, so that instead of using #t
    they use "else".  Either is legal Scheme, but chicken Scheme emits
    warnings on each.  Doing it this way removes the warnings.
    Reported and patched by Jörg F. Wittenberger, original patch submitted
    on Tuesday, 2013-11-12 12:47:33 +0100
2013-11-13 23:16:42 -05:00
David A. Wheeler
83d40e1b00 src/kernel.scm: Fix symbol reading (Joerg F. Wittenberger)
- Fix bug in handling EOF during the symbol-reading of internal procedures
    read-symbol-elements and read-literal-symbol.  Reported by
    by Jörg F. Wittenberger on Tuesday, 2013-11-12 12:47:33 +0100
2013-11-12 18:59:27 -05:00
David A. Wheeler
8e88051a71 src/kernel.scm: Fix set-read-mode for [no-]fold-case (Joerg F. Wittenberger)
- Fix bug in Scheme set-read-mode; its [no-]fold-case tests
    accidentally omitted the "mode" parameter.  This was reported
    by Jörg F. Wittenberger on Tuesday, 2013-11-12 12:47:33 +0100
2013-11-12 11:45:48 -05:00
David A. Wheeler
32a484fd41 Delete obsolete src/sweeten.old file 2013-10-04 02:15:29 -04:00
David A. Wheeler
b6da08ce77 src/unsweeten: Remove obsolete TODO 2013-10-04 02:13:27 -04:00
David A. Wheeler
9605876597 src/sweet-clisp, src/sweet-sbcl: Add "don't edit" warning to generated files 2013-10-04 02:07:35 -04:00
David A. Wheeler
a276242896 Make "local" sweet-clisp and sweet-sbcl work regardless of current directory
- With this change, "local" (build directory) script embeds the
    build directory and sets CL_SOURCE_REGISTRY to it.
    That way, you can always always run the script and will use the
    correct (NOT installed) library.
2013-10-03 23:40:17 -04:00
David A. Wheeler
c687667c26 In generated scripts, rename @LIBRARY_DIRECTORY@ to @GUILE_LIBRARY_DIRECTORY@
- We want to distinguish the guile library directory from the
    Common Lisp library directory; distinct names help.
2013-10-03 23:25:34 -04:00