mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-25 04:55:04 +02:00
Adding new script as a possible new tool
This commit is contained in:
parent
678d84e358
commit
964ccfc361
1 changed files with 40 additions and 0 deletions
40
api-testing.scm
Normal file
40
api-testing.scm
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
(import
|
||||||
|
(scheme base)
|
||||||
|
(scheme file)
|
||||||
|
(scheme read)
|
||||||
|
(scheme write)
|
||||||
|
(scheme cyclone util)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; TODO: this was not working in icyc - wtf?
|
||||||
|
;(let ((tmp (call-with-input-file "../scheme/base.sld"
|
||||||
|
; (lambda (fp)
|
||||||
|
; (read-all fp)))))
|
||||||
|
; (write
|
||||||
|
; (cdar
|
||||||
|
; (filter
|
||||||
|
; (lambda (l)
|
||||||
|
; (tagged-list? 'export l))
|
||||||
|
; (car tmp)))))
|
||||||
|
|
||||||
|
(define (read-exports filename)
|
||||||
|
(let* ((tmp (call-with-input-file filename
|
||||||
|
(lambda (fp)
|
||||||
|
(read-all fp))))
|
||||||
|
(exports (cdar
|
||||||
|
(filter
|
||||||
|
(lambda (l)
|
||||||
|
(tagged-list? 'export l))
|
||||||
|
(car tmp)))))
|
||||||
|
(write
|
||||||
|
(map
|
||||||
|
(lambda (e)
|
||||||
|
(system
|
||||||
|
(string-append
|
||||||
|
;; TODO: not good enough, what about define-syntax?
|
||||||
|
"grep -n \"define[ ]*[ \\(]"
|
||||||
|
(symbol->string e)
|
||||||
|
" \" " filename)))
|
||||||
|
exports)))
|
||||||
|
)
|
||||||
|
(read-exports "../scheme/file.sld")
|
Loading…
Add table
Reference in a new issue