Commit Graph

1845 Commits

Author SHA1 Message Date
Abdulaziz Ghuloum 3e71a5aa5e fixed reading of polar notation 2009-08-02 12:23:07 +03:00
Abdulaziz Ghuloum b2bca8a00a some refactoring of string-to-number parsers 2009-08-02 10:47:39 +03:00
Abdulaziz Ghuloum 4df1dcb25a attempting to reference/modify unexportable bindings was crashing
the expander instead of raising a proper error.  fixed.
2009-08-01 22:18:26 +03:00
Abdulaziz Ghuloum b586d2e21a some asserion violations in the reader are converted to &lexicals so
that the repl displays them properly.  E.g., 
(read (open-string-input-port "#!r6rs |foo|")) shows an &assertion,
but typing #!r6rs |foo| at the repl causes the repl to reset without
a message.
2009-07-30 21:46:11 +03:00
Abdulaziz Ghuloum af233a2ac2 added post-gc-hooks, a list of thunks that are invoked after garbage
collection.
2009-07-30 14:19:46 +03:00
Abdulaziz Ghuloum 7d2c1b0b9e added missing punctuations that are allowd in scribble parens. 2009-07-29 19:43:49 +03:00
Abdulaziz Ghuloum ac3581286f Ikarus now supports PLT's Scribble syntax!
- The only thing unsupported is the transposition of punctuations,
  e.g., @`foo{bar} => `@foo{bar}.
2009-07-29 19:07:03 +03:00
Abdulaziz Ghuloum cdea4e0942 added define-fluid-syntax and fixed fluid-let-syntax. 2009-07-28 22:12:48 +03:00
Abdulaziz Ghuloum 7961405db7 input ports now support "input-port-column-number" and
"input-port-row-number".  These currently work for string ports,
latin-1 ports, and utf-8 ports as long as only ascii chars are 
read.
2009-07-23 16:35:05 +03:00
Abdulaziz Ghuloum 9e764c76b4 - eqv? and equal? now guarantee #t when given two NaNs (unspecified
by R6RS).
2009-07-20 10:01:05 +03:00
Abdulaziz Ghuloum fe88c7bd0d fixed incorrect setting of IKARUS_LIBRARY_PATH. 2009-07-06 13:20:09 +03:00
Abdulaziz Ghuloum acbd00c356 fixed a bug in expanding macros in definition context where the
scope would get messed up when the macro call appears inside
let/letrec-syntax.  Basically, in the following example,

(let-syntax ([id-macro (syntax-rules () [(_ x) x])])
  (let () 
    (define (foo) (display "not ok\n")) 
    (let-syntax ([foo (syntax-rules () [(_) (display "ok\n")])])
      (id-macro (foo)))))

the call to (id-macro) would make (foo) refer to the foo in the
internal-definition context (the not ok one) instead of the
let-syntax one.

On the plus side, macro expansion is now half a second faster!
2009-07-06 12:14:08 +03:00
Abdulaziz Ghuloum cda06eba58 added a parameter to switch between different letrec handling routines 2009-07-06 12:07:18 +03:00
Abdulaziz Ghuloum 832fe616d2 revived waddell's letrec/letrec* optimization 2009-07-04 21:05:03 +03:00
Abdulaziz Ghuloum 7a6ae6322c added basic letrec/letrec* handling (as in the one defined in R5RS) 2009-07-04 20:33:38 +03:00
Abdulaziz Ghuloum cc569cce64 letrec optimization moved into its own file. 2009-07-04 19:47:15 +03:00
Abdulaziz Ghuloum 0cc2aae7dc added two aux libraries for parsing and formatting floating point
numbers.
2009-06-30 19:01:20 +03:00
Abdulaziz Ghuloum b324709e86 - ratnum->flonum now handles more numbers, though it's now slower
and may still be incorrect in some cases.
- (- <compnum> <flonum>) was raising an incorrect error.
2009-06-30 07:27:26 +03:00
Abdulaziz Ghuloum 7de0f39736 fixed floating point exception in (modulo <fx> 0). 2009-06-30 04:10:51 +03:00
Abdulaziz Ghuloum 6e7f0ccf84 fixed a bug in get-bytevector-n! when n == 1. 2009-06-30 03:51:01 +03:00
Abdulaziz Ghuloum b8cfdbbf66 bzr-snapshot more verbose 2009-06-27 11:45:11 +03:00
Abdulaziz Ghuloum 5e26cf5313 added a script to extract latest development snapshot from bzr 2009-06-27 10:22:04 +03:00
Abdulaziz Ghuloum f766b91fe8 make-string now signals an error if given a very large fixnum
I.e., greater than (fxsra (greatest-fixnum) 1).
2009-06-26 13:01:48 +03:00
Abdulaziz Ghuloum 9692eb097f Made libffi autodetectable as per bug 288748. Thanks to Andreas
Rottmann for supplying the patch.
2009-06-26 12:12:25 +03:00
Abdulaziz Ghuloum f5f61f60d3 Fixed tcp examples in lab directory. Thanks to Dudley Flanders for
reporting this.
2009-06-26 12:04:39 +03:00
Abdulaziz Ghuloum 30ac7870de the debugger now propagates nonserious conditions upwards instead of
trapping on them.
2009-06-26 11:33:32 +03:00
Abdulaziz Ghuloum 1803f9f23c fixed (modulo <bignum> 0) and (modulo <bignum> <largish-fixnum>)
errors that caused either a segfault or returning an incorrect
value.
2009-06-26 11:15:02 +03:00
Abdulaziz Ghuloum f495665f7d changed "condition" to "exception" in debugger output. 2009-06-26 11:05:40 +03:00
Abdulaziz Ghuloum d2cc4c65a3 put-string now takes the required optional arguments (same as
put-bytevector)
2009-06-26 10:52:56 +03:00
Abdulaziz Ghuloum 3d17aa7cf8 small cleanup to the reader. 2009-06-26 10:07:26 +03:00
Abdulaziz Ghuloum 5e02972e7f enabled debug-scc flag for debugging the scc pass of the compiler
(not useful for casual users)
2009-06-14 12:06:48 +03:00
Abdulaziz Ghuloum 2a0e53dcb0 minor work on command-line:
- no dependence on ikarus
  - split tests from main library
2009-06-02 01:12:07 +03:00
Abdulaziz Ghuloum 471921fcc7 NEW: ikarus --r6rs-repl <script-name>
runs the script according to the R6RS semantics, then starts a
  repl in an interaction environment made of everything visible
  (imported and defined) in the script.

  Use cases include:
  * debugging a script.
  * starting ikarus in some predefined environment, e.g., 
       $ ikarus --r6rs-repl rnrs.ss
    where rnrs.ss contains (import (rnrs))

  Also, interaction-environment is made a parameter with an initial
  value set prior to entering the repl.
2009-05-31 13:32:33 +03:00
Abdulaziz Ghuloum 5f4151a2e9 moved port position into cookie instead of being its own vector. 2009-05-30 13:34:18 +03:00
Abdulaziz Ghuloum 3099d1d629 moved output strings, file descriptors, and port mode into a port "cookie" 2009-05-30 13:18:43 +03:00
Abdulaziz Ghuloum eec9453fc7 - if IKARUS_LIBRARY_PATH is set, "." is no longer added to
library-path, so, whereever you set it, you should decide whether
  to include "." or exclude it.
  ["$prefix/lib/ikarus" is still added to the path so that multiple
  versions of ikarus can exist and each uses its own sources dir
  without interference]

- some cleanup in compiler to use the new include library instead of 
  "ikarus.include-src.ss" which is no longer needed.
2009-05-30 10:46:45 +03:00
Abdulaziz Ghuloum ac0e583310 - include now resolves relative includes (where file name does not
start with "/") according to library-path.  Absolute paths are not
  resolved.
2009-05-30 09:47:56 +03:00
Abdulaziz Ghuloum f13876d385 - removed include and include-into from (ikarus) library
- moved include and include/lexical-context to their own 
  (ikarus include) library (source only, not in boot image).
2009-05-30 08:14:09 +03:00
Abdulaziz Ghuloum 2653cedee1 expand changed:
- it now takes an optional environment (it was required)
  - it no longer returns a second value (list of libraries)
  - it's output is "pretty".

the old expand is now called core-expand.
2009-05-30 05:16:04 +03:00
Abdulaziz Ghuloum 83d8f051fe fixed minor bug in cogen of vector? 2009-05-28 14:04:19 +03:00
Abdulaziz Ghuloum 1dd8e71a2c RC files:
Summary:
  By default, ikarus now executes the file $HOME/.ikarusrc (which
  must be an R6RS script) (if it exists) before startup.

Details:
  
There is a default behavior for RC files which can be overriden by
command-line options.

Default RC files location:
  1. If the command-line argument --no-rcfile is set, the set of RC
     files is empty.
  2. Otherwise, if there is at least one --rcfile <filename> 
     command-line argument, the specified files are used as the set
     of RC files.  (--rcfile and --no-rcfile are mutually exclusive)
  3. Otherwise, if the environment variable IKARUS_RC_FILES is set,
     the colon-separated list of files are used as the RC files.
  4. Otherwise, if the file $HOME/.ikarusrc exists, only it is used.
  5. Otherwise, the set is empty.

The startup sequence is now:
  1. Setup the library path.
  2. Execute all RC files.
  3. Set command-line options (e.g., -O2, --debug, etc.).
  4. Set command-line-arguments.
  5. Proceed with normal operation (start repl, run an r6rs script,
     compile dependencies, etc.).
2009-05-28 13:29:07 +03:00
Abdulaziz Ghuloum 24ece86772 - Added stale-when:
syntax:  (stale-when guard-expr e* ...)   ;; in definition context
            (stale-when guard-expr e e* ...) ;; in expression context

   semantics:
     When a stale-when form is encountered while expanding any code
     (expressions, macros, macros in macros, etc.) in a library
     body, the guard-expr is expanded (but not evaluated) and
     serialized along with the library.  When the library is later
     reloaded from fasl and before it is installed, the guard-expr
     is evaluated.  If guard-expr returns true, the fasl content is
     ignored and the library is recompiled afresh from source.
2009-05-28 09:02:47 +03:00
Abdulaziz Ghuloum f759815a8c - Ikarus now recognizes IKARUS_FASL_DIRECTORY (and the corresponding
fasl-directory parameter) that works as follows:
  - if IKARUS_FASL_DIRECTORY is set to "", no fasl files are produced.
  - if IKARUS_FASL_DIRECTORY is set to something other than "", the
    string is used as a directory in which fasl files are placed.
  - if IKARUS_FASL_DIRECTORY is unset, the directory 
    $HOME/.ikarus/precompiled is used for fasl output.
  - library file names are cannonicalized using file-real-path.
  - the fasl file (if produced) is the result of
     (string-append (fasl-directory) (file-real-path filename) ext)
    where ext is either ".ikarus-32bit-fasl" or ".ikarus-64bit-fasl".

- The old behavior (placing the fasl files in the same place as the
  library files) can be achieved by setting IKARUS_FASL_DIRECTORY='/'.
2009-05-26 13:39:32 +03:00
Abdulaziz Ghuloum a050e28633 new boot files 2009-05-26 13:00:03 +03:00
Abdulaziz Ghuloum 1d9a26cefd - changed fasl extension to be ".ikarus-32bit-fasl"/".ikarus-64bit-fasl"
(depending on the target processor) instead of just ".ikarus-fasl".
2009-05-26 12:04:55 +03:00
Abdulaziz Ghuloum 5e5cbfe18b - Added make-directory* (like make-directory, but builds the whole
directory structure recursively) 
- Added split-file-name (takes a string, returns two values: the
  substring before the final "/" and the string after it).
- Fixed a minor bug in file-directory?, file-exists?, etc. that were
  failing on OS X if part of the path given was not a directory.
  E.g., if /tmp/foo is a regular file, (file-directory? "/tmp/foo/bar")
  was raising an exception instead of returning #f.
2009-05-26 01:14:11 +03:00
Abdulaziz Ghuloum 9cb0945f1f - Added file-real-path which is identical to realpath(3). 2009-05-25 22:19:43 +03:00
Abdulaziz Ghuloum 27112fec4e fixed bug that produced an incorrect assertion violation for
(put-bytevector! port bv i j) where i = (bytevector-length bv).
Thanks to Andreas Rottmann.
2009-05-24 12:49:53 +03:00
Abdulaziz Ghuloum ec76547da0 - procedures made with defun-style definitions now have proper
source annotation (pointing to the identifier that's the name of
  the procedure, instead of the define keyword itself).
2009-05-24 12:34:39 +03:00
Abdulaziz Ghuloum f3b071548d - improved debugger speed when debug-calling a primitive operation.
Ack now runs only 80 times slower in debug mode (down from 360
  times), and bootstrapping is now done in 170 seconds instead of
  500 (nondebug time is still less than 8 seconds).
2009-05-24 11:59:18 +03:00