canonical writings of terms improved

parent 916d9e38
......@@ -29,8 +29,8 @@ Version 0.5,
* rational datastructures, experimental.
* scheme Keyword objects and logic values.
* GC of prolog variables
* Attributed variables / only one success / experimental
* corouttines / only one success, experimental.
* Attributed variables / only one success all forms/ experimental
* corouttines / experimental.
* tracing
* Better compilation error handling
* Support for namespaced operators in prolog (TODO)
......@@ -39,6 +39,9 @@ Version 0.5,
* fast math and guile featured operators for numerics added.
Version 0.6, TODO
* SWI Prolog namespacing
* if directives
* swi compability
* GC of the (almost) unreachable tail of a stream (all)
* Multi threading capabilities (all)
* Sandboxing (prolog)
......
......@@ -529,7 +529,7 @@
(format #f "~a@@~a"
n x))
((_ . _)
(format #f "~a@@(~a~{, ~a~})"
(format #f "~a@@('~a'~{, '~a'~})"
n (car ll) (cdr ll)))
(_
(format #f "~a" n)))))))
......@@ -650,7 +650,7 @@
(else
(let ((ll (map (lambda (x) (format #f "'~a'" x))
(get-attached-module f ns?))))
(format #f "~a@@(~a~{, ~a~})"
(format #f "~a@@('~a'~{, '~a'~})"
(gen@ ll f) (car ll) (cdr ll)))))))
((a . l)
......
......@@ -97,10 +97,12 @@
(let ((l (map
(lambda (x)
(match x
((#:atom a _ _ n m) a)
((#:atom a _ _ n m) a)
((#:string a n m)
(string->symbol a))
(_ (error "wrong @ argument in ~a" (get-refstr n m)))))
(_ (error (format #f
"wrong @ argument (~a) in ~a" x
(get-refstr n m))))))
(get.. "," l))))
#`(#,(datum->syntax stx amp) #,(datum->syntax stx l)
#,(datum->syntax stx f))))
......
......@@ -55,11 +55,12 @@
(apply oldwarn x)))
(define-syntax-rule (wrap@ u code)
(let ((r code)
(u (<scm> u)))
(if u
`(#:@ ,r ,@u)
r)))
(<scm>
(let ((r code)
(u (<scm> u)))
(if u
`(#:@ ,r ,@u)
r))))
(define % (f-char #\%))
(define precom (f-seq (f-char #\/) (f-char #\*)))
......@@ -297,18 +298,11 @@
(.. (c) (ws c))
(<p-cc> cx))
(<and>
(.. (cx) (atom c))
(.. (cx) ((f-or atom qstring dstring) c))
(<p-cc> (mk-list (mk-string "language")
(mk-string "prolog")
(mk-string "modules")
(mk-string (list-ref cx 1)))))
(<and>
(.. (cx) (qstring c))
(<p-cc> (mk-list (mk-string "language")
(mk-string "prolog")
(mk-string "modules")
(mk-string (list-ref cx 1)))))
(<p-cc> (module-name (current-module)))))))
(mk-string (list-ref cx 1)))))))))
(define @tag
(let* ((@ (f-tag "@"))
......@@ -345,11 +339,12 @@
(.. (c) (ws c))
(.. (u) (@tag c))
(.. (c) (ws u))
(<p-cc> (if u
`(#:atom ,(string->symbol c*)
,(car u) ,(cadr u) ,n ,m)
`(#:atom ,(string->symbol c*) #f #f
,n ,m))))))
(<p-cc> (<scm>
(if u
`(#:atom ,(string->symbol c*)
,(car u) ,(cadr u) ,n ,m)
`(#:atom ,(string->symbol c*) #f #f
,n ,m)))))))
mk-id))
(define dstring
......@@ -809,7 +804,7 @@
(define (prolog-read-token stx)
(let ((f (f-or 'statement (f-seq ws (f-read-1 stx expr)
ws (f-char #\.) ws)
ws (f-or (f-seq (f-char #\.) ws) f-eof))
ferr)))
(<p-lambda> (c)
(.. (d) (f '()))
......
......@@ -28,7 +28,8 @@
((#:atom a _ _ n m) a)
((#:string a . _) (string->symbol a))
(_
(error "wrong @ argument in ~a" (get-refstr n m)))))
(error (format #f "wrong @ argument (~a) in ~a"
x (get-refstr n m))))))
(get... l))))
(let ((mod (resolve-module l)))
(cond
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment