diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2015-12-13 22:15:48 +0000 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2015-12-14 03:49:33 +0100 |
commit | faa5da7c249ced4434020619e890f44190caef8a (patch) | |
tree | bf3bc2b3098fd5389286d2d321d70727d52cf337 /scheme/guile | |
parent | b662276623dbfdcd2542af932f2bc0c5eb2d97b1 (diff) | |
download | geiser-guile-faa5da7c249ced4434020619e890f44190caef8a.tar.gz geiser-guile-faa5da7c249ced4434020619e890f44190caef8a.tar.bz2 |
Support for guile-2.2
Using cond-expand to provide support for the new world of guile 2.2
Diffstat (limited to 'scheme/guile')
-rw-r--r-- | scheme/guile/geiser/evaluation.scm | 64 |
1 files changed, 44 insertions, 20 deletions
diff --git a/scheme/guile/geiser/evaluation.scm b/scheme/guile/geiser/evaluation.scm index 4c87532..eab98b6 100644 --- a/scheme/guile/geiser/evaluation.scm +++ b/scheme/guile/geiser/evaluation.scm @@ -1,6 +1,6 @@ ;;; evaluation.scm -- evaluation, compilation and macro-expansion -;; Copyright (C) 2009, 2010, 2011, 2013 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009, 2010, 2011, 2013, 2015 Jose Antonio Ortega Ruiz ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the Modified BSD License. You should @@ -9,22 +9,42 @@ ;; Start date: Mon Mar 02, 2009 02:46 -(define-module (geiser evaluation) - #:export (ge:compile - ge:eval - ge:macroexpand - ge:compile-file - ge:load-file - ge:set-warnings - ge:add-to-load-path) - #:use-module (geiser modules) - #:use-module (srfi srfi-1) - #:use-module (language tree-il) - #:use-module (system base compile) - #:use-module (system base message) - #:use-module (system base pmatch) - #:use-module (system vm program) - #:use-module (ice-9 pretty-print)) +(cond-expand + (guile-2.2 + (define-module (geiser evaluation) + #:export (ge:compile + ge:eval + ge:macroexpand + ge:compile-file + ge:load-file + ge:set-warnings + ge:add-to-load-path) + #:use-module (geiser modules) + #:use-module (srfi srfi-1) + #:use-module (language tree-il) + #:use-module (system base compile) + #:use-module (system base message) + #:use-module (system base pmatch) + #:use-module (system vm program) + #:use-module (ice-9 pretty-print) + #:use-module (system vm loader))) + (else + (define-module (geiser evaluation) + #:export (ge:compile + ge:eval + ge:macroexpand + ge:compile-file + ge:load-file + ge:set-warnings + ge:add-to-load-path) + #:use-module (geiser modules) + #:use-module (srfi srfi-1) + #:use-module (language tree-il) + #:use-module (system base compile) + #:use-module (system base message) + #:use-module (system base pmatch) + #:use-module (system vm program) + #:use-module (ice-9 pretty-print)))) (define compile-opts '()) @@ -70,11 +90,15 @@ (ev (lambda () (call-with-values (lambda () - (let* ((o (compile form - #:to 'objcode + (let* ((to (cond-expand (guile-2.2 'bytecode) + (else 'objcode))) + (cf (cond-expand (guile-2.2 load-thunk-from-memory) + (else make-program))) + (o (compile form + #:to (if bytcode? 'bytecode 'objcode) #:env module #:opts opts)) - (thunk (make-program o))) + (thunk (cf o))) (start-stack 'geiser-evaluation-stack (eval `(,thunk) module)))) (lambda vs vs))))) |