alvatar / spheres

Spheres - A set of tools and libraries for practical Scheme. Multiplatform and Mobile.
MIT License
69 stars 10 forks source link

fmt package not loading #10

Closed ovenpasta closed 8 years ago

ovenpasta commented 8 years ago

(load "~~/lib/spheres/spheres/string/fmt/fmt.scm") *\ ERROR -- Syntax expansion failure: "invalid context for definition" '(define (write-digit d) (display (vector-ref digit-vec (inexact->exact (truncate d))) port))

<syntax #2

     expression: (define (write-digit d) (display (vector-ref digit-vec (inexact->exact (truncate d))) port))
     wrap: ((top)
            #<ribcage #3 symnames: () marks: () labels: ()>
            #<ribcage #4 symnames: #(port) marks: #((top)) labels: #("i")>
            #<ribcage #5 symnames: () marks: () labels: ()>
            #<ribcage #6 symnames: #(opt st n) marks: #((top) (top) (top)) labels: #("i" "i" "i")>
            #<top-ribcage #7 key: *top* mutable?: #t>)>
ovenpasta commented 8 years ago

It seems that let-optionals* doesn't allow the (define ) construct

ovenpasta commented 8 years ago

ok I found the reason. before loading fmt I need to load the following

;; Otherwise *** ERROR -- Syntax expansion failure: "invalid context for definition" '(define (write-digit d) ...
(load "~~/lib/spheres/spheres/string/fmt/let-optionals.scm")

;; Otherwise *** ERROR -- Unbound variable: string-upcase
(load (spheres/string string)) 

Maybe this should be loaded automatically by fmt.scm?

ovenpasta commented 8 years ago

Heh there is also fmt.sld ... I didn't see before! (load (spheres/string fmt)) did it!