Commit Graph

106 Commits

Author SHA1 Message Date
Abdulaziz Ghuloum 06fd988a17 C callbacks now reach the C point where they should make the call
back into Scheme land.
2008-09-20 01:58:57 -04:00
Abdulaziz Ghuloum 30cd6a2de8 made environment-symbols work on the interaction-environment. 2008-09-10 11:02:42 -07:00
Abdulaziz Ghuloum 0b017898a8 - minor change to how export (with renaming) is parsed. When you
rename from-name to to-name, the from-name is now treated as an
  identifier while the to-name is treated as a symbol.
2008-09-10 08:17:18 -07:00
Abdulaziz Ghuloum fcef21c693 - Added (environment-symbols <env>) which returns a list of symbols
exported by the environment.  Try 
  > (environment-symbols (environment '(rnrs)))

- Added an internal export mechanism so that identifiers can be
  exported from within a library.  The syntax is the same:
    (export export-spec* ...) 
  when appears in a library's top level, adds the export specs to
  the set of exported identifiers.  So, one can do:
    (library (A) 
      (export)
      (import (ikarus))
      (export a)
      (define a 17))
  When appearing in non-library definition context, the export form
  is ignored.
2008-09-10 06:35:18 -07:00
Abdulaziz Ghuloum 814c797633 - removed bset/h instruction from the compiler (it was rarely used
and not implemented 100% correctly)
- fixed parameterize to allow (parameterize () def ... exp exp ...)
2008-09-06 04:17:20 -07:00
Abdulaziz Ghuloum b9085e15da - more work on trig functions
- mkstx now checks that double wraps are not merged incorrectly
2008-08-12 01:17:04 -07:00
Abdulaziz Ghuloum 2b4e89bcf0 - fixed a minor import subversion bug.
- added 2-argument version of fllog.
2008-08-04 16:44:24 -07:00
Abdulaziz Ghuloum 0da4e99a12 simplified when, unless, and case macros and added better handler
for (if (not e) e e).
2008-08-02 11:09:22 -07:00
Abdulaziz Ghuloum 39e84d1395 simplified parameterize macro. 2008-08-02 10:11:04 -07:00
Abdulaziz Ghuloum 959082d12d assert now gives source information when available. 2008-07-29 11:04:52 -07:00
Abdulaziz Ghuloum 4ee88498a9 fixes quasisyntax bugs, making them more conforming to the r6rs test
suite.
2008-07-26 14:11:22 -07:00
Abdulaziz Ghuloum 3b80d4f321 fixed a bug in quotient and div when given (least-fixnum) and -1. 2008-07-26 12:28:51 -07:00
Abdulaziz Ghuloum 7db56cf76e - bytevector-ieee-[single|double]-[ref|set!] now accept unaligned
indices (r6rs requirement).
- file-options are now represented as enum-sets (r6rs requirement)
- odd?, even?, lcm, remainder, etc., now accept inexact integers.
2008-07-24 18:58:53 -07:00
Abdulaziz Ghuloum 59b9d28001 guard expressions now re-raise unhandled conditions using
raise-continuable (as per the R6RS errata page, part 7.1)
2008-07-20 02:51:14 -07:00
Abdulaziz Ghuloum a9657c4642 define-record-type now understands parent-rtd (used to ignore it). 2008-07-13 11:25:46 -07:00
Abdulaziz Ghuloum eccca7f4ea - Added trace-let-syntax, trace-letrec-syntax, as well as fixed
trace-define-syntax to handle variable transformers.

- added primops for fx comparison functions.
2008-07-11 22:31:40 -07:00
Abdulaziz Ghuloum 2c8cb7dda2 fixed a bug in matching library subversion in psyntax. 2008-06-28 03:16:21 -07:00
Abdulaziz Ghuloum 45346ef865 - Added cp0! including:
- (optimize-level [0,1,2])  and  ikarus -O[0,1,2]
       where -O0 = no optimizations
             -O1 = using old optimizer
             -O2 = using the new cp0 optimizer
       defaults to -O1 for now.
   - (cp0-size-limit n) which is the limit of the residual size for
     each inlining attempt
   - (cp0-effort-limit n) which is the limit on the effort expended 
     for each inlining attempt
   
- Rewrote the syntax-match macro to make use of the same technology
  used in syntax-case itself resulting in reduced code size.

- Added (system-value <symbol>) which returns the system value.
  E.g., (system-value 'car) => #<procedure car>
  This is pretty much the same as 
    (eval <symbol> (environment '(ikarus)))
  except that it does not involve compiling the expression or 
  consulting the library/expander systems.

- Fixed the fasl loader to make it understand complex numbers.
2008-06-28 02:25:44 -07:00
Abdulaziz Ghuloum 0939370a07 suppressing printing of file names during bootstrap. 2008-06-10 13:21:00 -07:00
Abdulaziz Ghuloum fe1f7077ff fixed minor bug in syntax-case where the wraps and marks of
top-marked wrapped syntax objects were incorrectly combined.
E.g., it used to be that:

  (syntax-case (datum->syntax #'foo #'(x y)) ()
    [(x y) 'shouldntmatch] [_ 'ok])

yields shouldntmatch; it's now ok.
2008-06-10 12:35:56 -07:00
Abdulaziz Ghuloum 6741ac2817 better error message when a library file "foo.ss" does not contain
the expected library name (foo).
2008-06-05 00:58:04 -07:00
Abdulaziz Ghuloum 71640d11bf Fixed a problem with forward references in the repl which used to
get a location different from the one assigned when the variable is
defined.
2008-05-15 06:40:07 -07:00
Abdulaziz Ghuloum f8b0e949d9 - syntax-case now raises a syntax violation when _ appears in the
literals
- syntax-rules points to the invalid literal when raising an
  exception.
2008-05-10 19:05:40 -04:00
Abdulaziz Ghuloum 5c21f9995e source annotations for r6rs-script and r6rs-libraries are now in
chars instead of bytes.
2008-05-06 15:38:05 -04:00
Abdulaziz Ghuloum b5fc5624ec Fixed a bug in enum-set-universe not returning an enum type. 2008-05-05 23:53:48 -04:00
Abdulaziz Ghuloum c3b8e50b23 Fixed a minor exposure of annotation records. 2008-05-03 06:49:36 -04:00
Abdulaziz Ghuloum 3f9b567a5b with-syntax now gives more informative error messages:
> (with-syntax ([(x y) #'(a 1)] [(q) #'(a b c)]) 12)
Unhandled exception
 Condition components:
   1. &assertion
   2. &who: with-syntax
   3. &message: "pattern does not match value"
   4. &irritants: ((q) #<syntax (a b c)>)

instead of the previous behavior:

> (with-syntax ([(x y) #'(a 1)] [(q) #'(a b c)]) 12)
Unhandled exception
 Condition components:
    1. &message: "invalid syntax"
    2. &syntax:
        form: ((a 1) (a b c))
        subform: #f
2008-05-03 06:23:35 -04:00
Abdulaziz Ghuloum 7e5d053fb2 Fixed a bug causing syntax-error traces to print as
#[annotation ---]
instead of
  #<syntax --- [position ---]>
2008-05-02 14:34:03 -04:00
Abdulaziz Ghuloum b56b0fbd85 fixed a problem causing free-id=? to intern unbound identifiers
into the interaction environment.
2008-05-01 15:04:43 -04:00
Abdulaziz Ghuloum d49aed209a Added (interaction-environment). 2008-05-01 06:02:36 -04:00
Abdulaziz Ghuloum e7386cd7d7 Major changes to the interactive repl:
- We can now redefine imported identifiers.
- We can now use let-syntax, letrec-syntax, and modules at
  top-level.

Hand-wavey Repl Semantics:
- Imported identifiers mean what they meant previously.  In
  particular, you cannot set! imported identifiers.
- An imported identifier may be redefined using define.  Once
  something is defined at the top-level, a specific location for it
  is created, and all definitions, references, and set!s to that
  variable go through the top-level location.
- Re-importing an identifier shadows the top-level location.
- Redefining re-exposes the top-level location.
- and do on.
- A reference to an unbound variable also fabricates a top-level
  location for that variable.

Let's see how this goes.
2008-05-01 04:21:07 -04:00
Abdulaziz Ghuloum 89def78c3c Fixed the definition of identifier? and id? in expander so that only
top-make-wrapped (possibly annotated) symbols are identifiers.  It
used to be that symbols were considered identifiers by the previous
definition.
2008-04-28 14:01:49 -04:00
Abdulaziz Ghuloum 3ce6d037e4 Fixed a bug in module imports where some marks were missing in action.
(Note from Kent, extracted from chez scheme release notes, follows)

This always worked:

(let ()
  (define-syntax from
    (syntax-rules ()
      [(_ m v) (let () (import m) v)]))
  (module a (x) (define x 'x-of-a))
  (from a x))

Didn't work before this change:

(let ()
  (define-syntax x-from-a
    (syntax-rules ()
      [(_) (let () (import a) x)]))
  (module a (x) (define x 'x-of-a))
  (x-from-a))
2008-04-19 17:55:30 -04:00
Abdulaziz Ghuloum c01f3049e4 Fixes bug 206842: syntax tracing not working by default when
syntax-case fenders fail
2008-03-25 21:23:23 -04:00
Abdulaziz Ghuloum 48f7c88e2d made time macro not depend on format. 2008-03-24 21:50:37 -04:00
Abdulaziz Ghuloum 81c17da20b Fixes bug 190373: `time' macro's "running stats for" can be misleading 2008-03-24 21:45:36 -04:00
Abdulaziz Ghuloum d35566081b import now recognizes and ignore ``for'' spec. 2008-03-15 21:00:16 -04:00
Abdulaziz Ghuloum a3f6e3e039 Cut down bootstrap time by 10% by caching the values of scheme-stx.
Macroexpansion time is reduced by 25%.
2008-03-12 18:12:57 -04:00
Abdulaziz Ghuloum c8f9b1dc3d Added fluid-let-syntax.
See http://www.scheme.com/csug7/syntax.html#./syntax:s15
for details.
2008-02-25 02:15:51 -05:00
Abdulaziz Ghuloum e751c15bc4 library record now contains original file name for libraries loaded
from files.
2008-02-18 20:39:42 -05:00
Abdulaziz Ghuloum c430a91bb8 more preparations for separate compilation 2008-02-18 20:28:54 -05:00
Abdulaziz Ghuloum fa08c543bb library records now cache expanded code. 2008-02-18 19:15:47 -05:00
Abdulaziz Ghuloum 314f80eee9 include now attached annotations to read files (using read-annotated
instead of read).
2008-02-17 02:29:36 -05:00
Abdulaziz Ghuloum 19e5d2bacd Fixes bug 192222: Quasiquote broken 2008-02-15 15:25:20 -05:00
Abdulaziz Ghuloum f4fb08adba Added an experimental macro expansion stack trace that looks like:
Unhandled exception:
 Condition components:
    1. &who: let
    2. &message: "not an identifier"
    3. &syntax:
        form: (let ((12 a)) (printf "a=~s\n" a)) 
        subform: 12
    4. &trace: #<syntax (let ((12 a)) (printf "a=~s\n" a))>
    5. &trace: #<syntax (right 12 a (printf "a=~s\n" a))> 
    6. &trace: #<syntax (wrong a 12 (printf "a=~s\n" a)) [byte 216 of test.ss]>


For a file containing:

(define-syntax right
  (syntax-rules ()
    [(_ a b c) (let ([a b]) c)]))
 
(define-syntax wrong
  (syntax-rules ()
    [(_ a b c) (right b a c)]))

(right x 17 (wrong a 12 (printf "a=~s\n" a)))
2008-02-14 04:01:09 -05:00
Abdulaziz Ghuloum a43177d399 Fixed some of bug 186155: Incorrect syntax errors for define 2008-01-27 19:12:20 -05:00
Abdulaziz Ghuloum 6018e2200d Made (define foo) expand to (define foo (void)). 2008-01-18 22:18:26 -05:00
Abdulaziz Ghuloum 4444496609 Fixes bug 181105: syntax pattern variable list length mismatch error
is obscure
2008-01-09 08:47:48 -05:00
Abdulaziz Ghuloum 62765c2885 Fixes bug 180895: letrec error message not as helpful as let 2008-01-09 08:37:46 -05:00
Abdulaziz Ghuloum 797897cc01 Fixes bug 180455: raw symbols in output of macro are not detected 2008-01-04 20:53:59 -05:00