;;HACK (define-syntax-rule (define-module- name args ...) (cond-expand (guile-3 (define-module name #:declarative? #f args ...)) (guile (define-module name args ...)))) (setlocale LC_ALL "") (use-modules (system base language)) (use-modules (system repl repl)) (use-modules (system repl common)) (use-modules (ice-9 readline)) (activate-readline) (load (string-append (getenv "HOME") "/.guile")) (define f0 (string-append (getenv "HOME") "/guile-prolog-scratch")) (define f1 (string-append (getenv "HOME") "/guile-prolog-scratch/language")) (define f2 (string-append (getenv "HOME") "/guile-prolog-scratch/language/prolog")) (define f3 (string-append (getenv "HOME") "/guile-prolog-scratch/language/prolog/modules")) (if (not (file-exists? f0)) (mkdir f0)) (if (not (file-exists? f1)) (mkdir f2)) (if (not (file-exists? f2)) (mkdir f2)) (if (not (file-exists? f3)) (mkdir f3)) (set! %load-path (cons f0 %load-path)) (define (f) (set-current-module (resolve-module '(prolog-user))) (let ((lang (lookup-language 'prolog))) (let lp () (catch #t (lambda () (current-language lang) (let ((status (start-repl lang))) (if (null? status) (run-hook exit-hook) (lp)))) (lambda x (lp)))))) (f)