mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
fixing path resolution for include-library-declarations
This commit is contained in:
parent
2735b36c87
commit
302ee50075
6 changed files with 37 additions and 10 deletions
|
@ -206,7 +206,12 @@
|
||||||
(append (map resolve includes) files)
|
(append (map resolve includes) files)
|
||||||
chibi-ffi?))
|
chibi-ffi?))
|
||||||
(('include-library-declarations includes ...)
|
(('include-library-declarations includes ...)
|
||||||
(lp (append (append-map file->sexp-list includes) (cdr ls))
|
(lp (append (append-map
|
||||||
|
(lambda (inc)
|
||||||
|
(file->sexp-list
|
||||||
|
(path-resolve inc (path-directory file))))
|
||||||
|
includes)
|
||||||
|
(cdr ls))
|
||||||
info
|
info
|
||||||
deps
|
deps
|
||||||
(append (map resolve includes) files)
|
(append (map resolve includes) files)
|
||||||
|
|
2
tests/snow/repo3/takakazu/bernoulli-includes.sld
Normal file
2
tests/snow/repo3/takakazu/bernoulli-includes.sld
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
(import (scheme base) (pingala binomial))
|
||||||
|
(include "bernoulli.scm")
|
7
tests/snow/repo3/takakazu/bernoulli-test.scm
Normal file
7
tests/snow/repo3/takakazu/bernoulli-test.scm
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
(import (scheme base) (takakazu bernoulli) (pingala test-map))
|
||||||
|
|
||||||
|
(test-map (1 -1/2 1/6 0 -1/30 0 1/42 0 -1/30 0 5/66)
|
||||||
|
(lambda (m) (bernoulli m))
|
||||||
|
(0 1 2 3 4 5 6 7 8 9 10))
|
||||||
|
|
||||||
|
(test-exit)
|
10
tests/snow/repo3/takakazu/bernoulli.scm
Normal file
10
tests/snow/repo3/takakazu/bernoulli.scm
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
;; first bernoulli numbers
|
||||||
|
(define (bernoulli m)
|
||||||
|
(do ((k 0 (+ k 1))
|
||||||
|
(sum 0 (do ((v 0 (+ v 1))
|
||||||
|
(sum sum (+ sum
|
||||||
|
(* (expt -1 v)
|
||||||
|
(binomial k v)
|
||||||
|
(/ (expt v m) (+ k 1))))))
|
||||||
|
((> v k) sum))))
|
||||||
|
((> k m) sum)))
|
3
tests/snow/repo3/takakazu/bernoulli.sld
Normal file
3
tests/snow/repo3/takakazu/bernoulli.sld
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
(define-library (takakazu bernoulli)
|
||||||
|
(export bernoulli)
|
||||||
|
(include-library-declarations "bernoulli-includes.sld"))
|
|
@ -40,6 +40,7 @@
|
||||||
;; run snow-chibi command as a separate process with test defaults
|
;; run snow-chibi command as a separate process with test defaults
|
||||||
(define chibi-path "./chibi-scheme")
|
(define chibi-path "./chibi-scheme")
|
||||||
(define (snow-command . args)
|
(define (snow-command . args)
|
||||||
|
;;(write `(snow ,@args)) (newline)
|
||||||
`("./tools/snow-chibi"
|
`("./tools/snow-chibi"
|
||||||
--verbose
|
--verbose
|
||||||
--always-no
|
--always-no
|
||||||
|
@ -189,21 +190,20 @@
|
||||||
--description "Pythagoran Theorem"
|
--description "Pythagoran Theorem"
|
||||||
--test "tests/snow/repo3/pythagoras/hypotenuse-test.sch"
|
--test "tests/snow/repo3/pythagoras/hypotenuse-test.sch"
|
||||||
tests/snow/repo3/pythagoras/hypotenuse.sch)
|
tests/snow/repo3/pythagoras/hypotenuse.sch)
|
||||||
;; (snow package --output-dir tests/snow/repo3/
|
(snow package --output-dir tests/snow/repo3/
|
||||||
;; --version 1.0 --authors "Seki Takakazu"
|
--version 1.0 --authors "Seki Takakazu"
|
||||||
;; --description "Bernoulli Numbers"
|
--description "Bernoulli Numbers"
|
||||||
;; --test "tests/snow/repo3/takakazu/bernoulli-test.scm"
|
--test "tests/snow/repo3/takakazu/bernoulli-test.scm"
|
||||||
;; tests/snow/repo3/takakazu/bernoulli.sld)
|
tests/snow/repo3/takakazu/bernoulli.sld)
|
||||||
(snow index ,(cadr repo3))
|
(snow index ,(cadr repo3))
|
||||||
(snow ,@repo3 install pingala.binomial)
|
(snow ,@repo3 install pingala.binomial)
|
||||||
(snow ,@repo3 install euler.totient)
|
(snow ,@repo3 install euler.totient)
|
||||||
|
(snow ,@repo3 install takakazu.bernoulli)
|
||||||
(let ((status (snow-status)))
|
(let ((status (snow-status)))
|
||||||
(test-assert (installed-version status '(pingala binomial)))
|
(test-assert (installed-version status '(pingala binomial)))
|
||||||
(test-assert (installed-version status '(pingala factorial)))
|
(test-assert (installed-version status '(pingala factorial)))
|
||||||
(test "2.7.1" (installed-version status '(euler totient))))
|
(test "2.7.1" (installed-version status '(euler totient)))
|
||||||
;; (snow ,@repo3 install takakazu.bernoulli)
|
(test-assert (installed-version status '(takakazu bernoulli))))
|
||||||
;; (let ((status (snow-status)))
|
|
||||||
;; (test-assert (installed-version status '(takakazu bernoulli))))
|
|
||||||
|
|
||||||
;; programs
|
;; programs
|
||||||
(snow ,@repo3 install pingala.triangle)
|
(snow ,@repo3 install pingala.triangle)
|
||||||
|
|
Loading…
Add table
Reference in a new issue