Commit Graph

673 Commits

Author SHA1 Message Date
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 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 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
Abdulaziz Ghuloum ae136274ed - the source-level optimizer now optimizes (inlining,
constant-folding, etc.) across debug-calls.
2009-05-21 18:43:28 +03:00
Abdulaziz Ghuloum b35f5a9e1d - trace-lambda and debug-call now interact properly and do not lose
tail calls.
2009-05-21 11:47:24 +03:00
Abdulaziz Ghuloum 8ef5eaeca2 - better error message for using make-c-callout and make-c-callback
when ffi support is not enabled.
2009-05-20 09:58:03 +03:00
Abdulaziz Ghuloum beb3845e9d - modified the ikarus debugger to use the same continuation frame
structure as the one the tracer uses.
2009-05-19 19:46:23 +03:00
Abdulaziz Ghuloum 1781866f1c - small change to how the tracer works internally and how it keeps
track of continuation frames and trace depths.
2009-05-19 13:16:59 +03:00
Abdulaziz Ghuloum a489f169ee - added trace-let 2009-05-18 11:14:17 +03:00
Abdulaziz Ghuloum ff25a484fb - Added -d (--debug) flag that enables debugging at the repl, r6rs
scripts, and compiling dependencies.  This is the first stab at
  the debugger.  It's SLOW!
2009-05-18 02:08:02 +03:00
Abdulaziz Ghuloum dbf0b07f13 - added lab/ikarus.debugger.ss which is more usable (faster) than
the interpreter and is closer to how the compiler would handle
  debugging calls.
2009-05-17 12:50:16 +03:00
Abdulaziz Ghuloum 2929379460 - debugging in interpreter is changed to use continuation frames
dynamically instead of performing context-sensitive transformation
  to determine tail/nontail calls.
- interpreter now has options to reraise, continue, or quit.
2009-05-17 06:51:09 +03:00
Abdulaziz Ghuloum 391e2fa87b - ikarus interpreter improvements:
- shows prettier traces (frame and reduction numbers, chopped
    strings, etc)
  - can be resumed after being suspended with ^C
2009-05-16 09:57:37 +03:00
Abdulaziz Ghuloum fda2817a73 - ikarus interpreter (in lab directory) is now capable of
bootstrapping ikarus
2009-05-14 10:18:45 +03:00
Abdulaziz Ghuloum 3207e14fca - psyntax now produces
`(annotated-call ,annotation ,rator ,rands ...)
   form for cases when there is an annotation attached to the procedure
   call.  The compiler just stripps it out and makes no use of it.
2009-05-14 09:52:05 +03:00
Abdulaziz Ghuloum 39c8e8e23f removed source annotation from primitive procedures (which were not
supposed to be there in the first place)
2009-05-14 09:09:58 +03:00
Abdulaziz Ghuloum 370454e4fc - fixed a small bug in the compile. [use of struct-ref with an
index out of range, generated by improper use of struct-match]
2009-05-14 08:59:41 +03:00
Abdulaziz Ghuloum 1a738c2a8d - Added skeleton of an interpreter that accepts the same language as
the compiler (i.e., the one produced by psyntax).
2009-05-11 02:21:19 +03:00
Abdulaziz Ghuloum 7002046c8e - added a way of making annotated procedures without invoking the
compiler.   (useful for a future project)
- refershed all boot files (because of added primitives)
- regenerated some autoconf files (to use newer version)
2009-05-11 01:35:38 +03:00
Abdulaziz Ghuloum 7e965758cf Added memcpy (courtesy of Andreas Rottmann).
The `memcpy' procedure allows to copy memory from bytevectors to
  unmanaged (malloc'ed) memory and vice-versa.
2009-04-30 12:35:49 +03:00
Abdulaziz Ghuloum 2f4a2f3895 The code for converting signed long long numbers to scheme bignums
was broken (on 32-bits, the 64-bit value was put in a bignum of 1
limb instead of 2).  Thanks to Andreas Rottmann for reporting it.
2009-04-30 12:25:17 +03:00
Abdulaziz Ghuloum a7f544a4b8 Added a test (thanks to Michele Simionato) that exhibits the
previous bug.
2009-04-27 10:15:35 +03:00
Abdulaziz Ghuloum 5b2fca49e6 fixed bug in expansion of expressions in interaction environment
where id->label was prematurely interning identifiers in the
environment.  Now, there is id->label/intern that does that and it's
only used when an identifier's type is resolved and not at other
times (like in free-id=? and bount-id=?).
2009-04-27 09:59:23 +03:00
Abdulaziz Ghuloum 2924c91788 fixed bug in ypsilon-compat where char** pointers were not
initialized properly in 64-bit.  Thanks to Tristan Ravitch.
2009-04-13 16:43:20 +03:00
Abdulaziz Ghuloum 810fe75fa1 - hashtable-hash-function used to return an incorrect hash function
that the one supplied to make-hashtable; fixed.
- div and mod raise an error, rather than an assertion when given 
  zero second argument; fixed.
2009-04-11 21:39:53 +03:00
Abdulaziz Ghuloum 6bab4af5b4 Added [un]signed-long-long types as valid parameter types to
callouts and callbacks (in both 32 and 64 bit modes). (UNTESTED)
2009-04-11 02:16:00 +03:00
Abdulaziz Ghuloum a44a00b405 Applied patch that fixes bug: dirent->d_namlen not available on
linux.  Thanks Derick Eddington.
2009-04-09 23:55:44 +03:00
Abdulaziz Ghuloum d63a9c1f51 Added open-directory-steam, directory-stream?, read-directory-stream,
and close-directory-stream as per bug 315804.
2009-04-09 12:29:50 +03:00
Abdulaziz Ghuloum 72b86818f0 = now handles complex numbers properly. 2009-04-07 12:05:03 +03:00
Abdulaziz Ghuloum ffb5a815f8 fixed copyright year in banner. 2009-04-07 02:36:53 +03:00
Abdulaziz Ghuloum bcff57fa52 fixed a bug in internal definitions of with-syntax (again). 2009-04-07 02:33:09 +03:00
Abdulaziz Ghuloum 56ec093e05 make distcheck now works. Many thanks to Andreas Rottmann (rotty)
for the patches.
2009-04-07 02:15:32 +03:00
Abdulaziz Ghuloum 3aad0fbe0b inexact->exact and exact now hangle compnums and cflonums properly. 2009-04-06 17:41:28 +03:00
Abdulaziz Ghuloum 65dc2bc40d trace-define now does not raise an error when given a non-procedure 2009-04-06 17:21:56 +03:00
Abdulaziz Ghuloum 7d6316f723 fixed error in division in (/ 0 <bignum>) 2009-04-06 17:14:57 +03:00
Abdulaziz Ghuloum 4ca8b1add2 fixed bugs in format when given inexact and complex arguments to ~d,
~b, ~x, and ~o.
2009-04-06 16:52:11 +03:00
Abdulaziz Ghuloum 0c96321f20 fixed definitions of last clauses in cond and case macros. 2009-04-06 16:36:07 +03:00
Abdulaziz Ghuloum af46220d64 fixed definition of with-syntax to allow internal definitions. 2009-04-06 16:30:23 +03:00
Abdulaziz Ghuloum 5e1066170e changed definition of ref in order to work around a bug in gcc-4.2.2
at -O3 that was computing incorrect addresses for ref(x, -n).
2009-04-06 16:24:12 +03:00
Abdulaziz Ghuloum 230b5186d6 fixed a bug in converting out parameters in the ypsilon-compat
layer.  Thanks to Ed Cavazos for the patch.
2009-04-06 10:14:33 +03:00
Abdulaziz Ghuloum b97cbf1688 Fixed environ. The procedure environ takes no arguments and returns
an association list where both keys and values and strings found in
the posix environment.
2009-04-06 09:59:07 +03:00
Abdulaziz Ghuloum 1d25a3db07 fixed rounding error for flonums (now rounding to even as required). 2009-02-06 23:46:12 +03:00
Abdulaziz Ghuloum a59aede042 removed streams and pregexp libraries from lib directory 2009-01-09 11:46:52 +03:00
Abdulaziz Ghuloum 0ec9c9536e added missing copyrights from scheme files. 2009-01-09 11:40:55 +03:00
Abdulaziz Ghuloum f6333ff13b - added (ikarus ipc) library
- added copyright notices for (ikarus foreign) and (ikarus ipc).
2009-01-09 10:53:39 +03:00
Abdulaziz Ghuloum a28e67c7c2 - completed section on IPC.
- changed the order of returned values for tcp-connect[-nonblocking]
  and accept-connection[-nonblocking] so that you get an input and
  output ports in that order (making it a little easier to rememeber).
2009-01-09 10:45:27 +03:00
Abdulaziz Ghuloum 735803a312 fixed a bug in parsing UnicodeData.txt (not accounting for <First>
and <Last> special tokens.
2009-01-05 06:21:02 +03:00
Abdulaziz Ghuloum 2adc9cb85d Applied patch for "make-hard-link". Thanks to Andreas Rottmann. 2009-01-03 20:36:53 -05:00
Abdulaziz Ghuloum 71c707df50 missing library file errors now print import trace. 2009-01-03 20:23:33 -05:00
Abdulaziz Ghuloum 1ebd4f4d9a fixed minor bug in "->inexact" helper. 2009-01-03 20:03:04 -05:00
Abdulaziz Ghuloum 6dca996f3a fixed bug in fasl-reading unicode chars in 64-bit mode. 2009-01-03 19:57:19 -05:00
Abdulaziz Ghuloum f5f6af8bd7 fixed compile error for (vector-set! (vector 0) 0.0 'foo). 2009-01-03 19:48:23 -05:00
Abdulaziz Ghuloum 5946459630 fixed bug in guard (now allowing definitions and expressions in <body>) 2009-01-02 17:55:01 -05:00
Abdulaziz Ghuloum 2658e6395d made apropos symbols come out in order (as in symbol<? order) 2008-12-27 13:48:49 -05:00
Abdulaziz Ghuloum 264156f305 added an apropos command 2008-12-27 13:13:45 -05:00
Abdulaziz Ghuloum ce4dc64e0d made public source-position conditions and load-r6rs-script. 2008-12-27 00:36:13 -05:00
Abdulaziz Ghuloum 930c713b76 added missing assertion check for (fxdiv (least-fixnum) -1)
and (fxdiv-and-mod (least-fixnum) -1).
2008-12-25 21:00:14 -05:00
Abdulaziz Ghuloum 2be7d93637 - Added (syntax-transpose syntax-object base-id new-id-object).
It returns syntax-object wrapped with the marks and substitutions
  that have been added to new-id since its introduction as base-id.
  The new-id and base-id should be free-identifier=? and new-id
  should have the same (or more) marks as base-id.
2008-12-25 16:33:50 -05:00
Abdulaziz Ghuloum 788762da44 eq- and eqv-hashtables are now fasl-writable. 2008-12-23 21:40:09 -05:00
Abdulaziz Ghuloum 4918b0e965 added setenv and unsetenv to (ikarus). 2008-12-23 20:58:46 -05:00
Abdulaziz Ghuloum 05180035f2 fixed &who for the error condition when uint-list->bytevector is
given a nonpositive size.
2008-12-23 20:44:47 -05:00
Abdulaziz Ghuloum 82b7edcf14 fixed fprintf line in scheme-script.c 2008-12-23 20:41:12 -05:00
Abdulaziz Ghuloum 0bd854dedf fixed bug where put-bytevector was advancing the port index twice as
far as needed.
2008-12-17 15:42:28 -05:00
Abdulaziz Ghuloum c2047badb9 - fixed problem where interned symbols were being gc-ed incorrectly 2008-12-17 14:59:03 -05:00
Abdulaziz Ghuloum e8d727c8a5 added printing of progress for guardians test (which takes along time) 2008-12-13 07:33:25 -05:00
Abdulaziz Ghuloum 3ad5c2fc80 fixed the &who in error of [us]int-list->bytevector. 2008-12-13 07:02:17 -05:00
Abdulaziz Ghuloum 818d15a080 fixed a bug in ffi callouts when the type is [un]signed-long on 32-bit. 2008-12-13 06:34:01 -05:00
Abdulaziz Ghuloum f8efdfc848 fixed buffer overrun problem when printing a char to an unbuffered
port is interrupted.
2008-12-12 16:03:10 -05:00
Abdulaziz Ghuloum 026fd6f446 added tests to ensure that symbols are gcable. 2008-12-10 03:18:33 -05:00
Abdulaziz Ghuloum 279618fde2 added simple regression test for guardians. 2008-12-10 03:03:49 -05:00
Abdulaziz Ghuloum e315324cbf added set-port-position! for string and bytevector input ports. 2008-12-09 05:27:50 -05:00
Abdulaziz Ghuloum eec9567014 - added "output-port-buffer-mode" which returns "none" or "block".
(there is no line buffering yet)
- updated error message when using unimplemented features.
2008-12-09 04:46:43 -05:00
Abdulaziz Ghuloum b31454d592 added more tests for set/get position 2008-12-09 03:47:08 -05:00