* unified the two library-expanders into one procedure
* made boot-library-expander install the library in the current-library-collection.
This commit is contained in:
		
							parent
							
								
									6922733809
								
							
						
					
					
						commit
						8d19b91270
					
				
							
								
								
									
										
											BIN
										
									
								
								src/ikarus.boot
								
								
								
								
							
							
						
						
									
										
											BIN
										
									
								
								src/ikarus.boot
								
								
								
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -19,7 +19,7 @@
 | 
				
			||||||
  (primitive-set! 'string->flonum string->flonum)
 | 
					  (primitive-set! 'string->flonum string->flonum)
 | 
				
			||||||
))
 | 
					))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(library (ikarus flonums)
 | 
					(library (ikarus generic-arithmetic)
 | 
				
			||||||
  (export)
 | 
					  (export)
 | 
				
			||||||
  (import (scheme))
 | 
					  (import (scheme))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,15 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#| current-library-collection   procedure
 | 
				
			||||||
 | 
					  Calling (current-library-collection) returns a procedure that:
 | 
				
			||||||
 | 
					    - when called with no arguments, it returns a list of the set
 | 
				
			||||||
 | 
					      of
 | 
				
			||||||
 | 
					      libraries in the collection.
 | 
				
			||||||
 | 
					    - when called with a single argument, it adds that library to
 | 
				
			||||||
 | 
					      the set of libraries in the collection.
 | 
				
			||||||
 | 
					  Calling (current-library-collection f) sets the current library 
 | 
				
			||||||
 | 
					   collection to be the procedure f which must follow the protocol
 | 
				
			||||||
 | 
					   above.
 | 
				
			||||||
 | 
					|#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2023,8 +2023,7 @@
 | 
				
			||||||
                          name imp* (rtc)
 | 
					                          name imp* (rtc)
 | 
				
			||||||
                          (build-letrec no-source lex* rhs* body)
 | 
					                          (build-letrec no-source lex* rhs* body)
 | 
				
			||||||
                          export-subst export-env))))))))))))
 | 
					                          export-subst export-env))))))))))))
 | 
				
			||||||
  (define run-library-expander
 | 
					  (define (library-expander x)
 | 
				
			||||||
    (lambda (x) 
 | 
					 | 
				
			||||||
    (let-values ([(name imp* run* invoke-code export-subst export-env)
 | 
					    (let-values ([(name imp* run* invoke-code export-subst export-env)
 | 
				
			||||||
                    (core-library-expander x)])
 | 
					                    (core-library-expander x)])
 | 
				
			||||||
      (let ([id (gensym)]
 | 
					      (let ([id (gensym)]
 | 
				
			||||||
| 
						 | 
					@ -2036,12 +2035,12 @@
 | 
				
			||||||
        (install-library id name ver
 | 
					        (install-library id name ver
 | 
				
			||||||
           imp* vis* inv* export-subst export-env
 | 
					           imp* vis* inv* export-subst export-env
 | 
				
			||||||
           void ;;; FIXME
 | 
					           void ;;; FIXME
 | 
				
			||||||
             (lambda () (eval-core invoke-code)))))))
 | 
					           (lambda () (eval-core invoke-code)))
 | 
				
			||||||
  (define boot-library-expander
 | 
					 | 
				
			||||||
    (lambda (x)
 | 
					 | 
				
			||||||
      (let-values ([(name imp* run* invoke-code export-subst export-env) 
 | 
					 | 
				
			||||||
                    (core-library-expander x)])
 | 
					 | 
				
			||||||
        (values invoke-code export-subst export-env))))
 | 
					        (values invoke-code export-subst export-env))))
 | 
				
			||||||
 | 
					  (define (boot-library-expander x)
 | 
				
			||||||
 | 
					    (let-values ([(invoke-code export-subst export-env)
 | 
				
			||||||
 | 
					                  (library-expander x)])
 | 
				
			||||||
 | 
					      (values invoke-code export-subst export-env)))
 | 
				
			||||||
  (define build-export
 | 
					  (define build-export
 | 
				
			||||||
    (lambda (x)
 | 
					    (lambda (x)
 | 
				
			||||||
      ;;; exports use the same gensym
 | 
					      ;;; exports use the same gensym
 | 
				
			||||||
| 
						 | 
					@ -2091,7 +2090,9 @@
 | 
				
			||||||
      (unless (pair? x)
 | 
					      (unless (pair? x)
 | 
				
			||||||
        (error #f "invalid expression at top-level ~s" x))
 | 
					        (error #f "invalid expression at top-level ~s" x))
 | 
				
			||||||
      (case (car x)
 | 
					      (case (car x)
 | 
				
			||||||
        [(library) (run-library-expander x)]
 | 
					        [(library) 
 | 
				
			||||||
 | 
					         (library-expander x)
 | 
				
			||||||
 | 
					         (void)]
 | 
				
			||||||
        [(invoke)
 | 
					        [(invoke)
 | 
				
			||||||
         (syntax-match x ()
 | 
					         (syntax-match x ()
 | 
				
			||||||
           [(_ (id** ...) ...)
 | 
					           [(_ (id** ...) ...)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue