Skip to content

Commit cb1c196

Browse files
committed
fix env for apropose procedure
1 parent bbee96d commit cb1c196

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

dist/std.min.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
(set-special! "" (quote warn-quote))
8787
(define-macro (warn-quote) "(warn-quote)\u000A\u000ASimple macro that throw error, when you try to use ’ symbol as quote in code" (throw (new Error (string-append "You're using invalid quote character run: " "(set-special! \"\" 'quote)" " to allow running this type of quote"))))
8888
(define-macro (let-env-values env spec . body) "(let-env-values env ((name var)) . body)\u000A\u000AMacro add mapping for variables var from specified env,\u000AMacro work similar to let-env but lexical scope is working with it." (let ((env-name (gensym (quote env)))) (quasiquote (let (((unquote env-name) (unquote env))) (let (unquote (map (lambda (pair) (quasiquote ((unquote (car pair)) (--> (unquote env-name) (get (quote (unquote (cadr pair)))))))) spec)) (unquote-splicing body))))))
89-
(define (apropos name) "(apropos name)\u000A\u000ASearch environment and display names that match the given name.\u000Aname can be regex, string or symbol." (typecheck "apropos" name (quote ("string" "regex" "symbol"))) (let ((regex (lambda (string) (new RegExp (escape-regex string))))) (filter (cond ((string? name) (regex name)) ((symbol? name) (regex (symbol->string name))) (else name)) (env))))
89+
(define (apropos name) "(apropos name)\u000A\u000ASearch environment and display names that match the given name.\u000Aname can be regex, string or symbol." (typecheck "apropos" name (quote ("string" "regex" "symbol"))) (let ((regex (lambda (string) (new RegExp (escape-regex string))))) (filter (cond ((string? name) (regex name)) ((symbol? name) (regex (symbol->string name))) (else name)) (env (interaction-environment)))))
9090
(define (promisify fn) "(promisify fn)\u000A\u000ASimple function for adding promises to NodeJS callback based function.\u000AFunction tested only with fs module." (lambda args (new Promise (lambda (resolve reject) (apply fn (append args (list (lambda (err data) (if (null? err) (resolve data) (reject err))))))))))
9191
(define-macro (list* . args) "(list* arg1 ...)\u000A\u000AParallel version of list." (let ((result (gensym "result"))) (quasiquote (let (((unquote result) (vector))) (unquote-splicing (map (lambda (arg) (quasiquote (--> (unquote result) (push (quote-promise (unquote arg)))))) args)) (map await (vector->list (unquote result)))))))
9292
(define-macro (%not-implemented name) "(not-implemented name)\u000A\u000AReturns new function taht throw exception that function is not implmeneted" (let ((str-name (symbol->string name))) (quasiquote (lambda () (unquote (string-append "(" str-name ")\u000A\u000AThis function is not yet implemented.")) (throw (new Error (unquote (string-append str-name " has not beed implemented"))))))))

dist/std.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@
11361136
(filter (cond ((string? name) (regex name))
11371137
((symbol? name) (regex (symbol->string name)))
11381138
(else name))
1139-
(env))))
1139+
(env (interaction-environment)))))
11401140

11411141
;; -----------------------------------------------------------------------------
11421142
(define (promisify fn)

dist/std.xcb

26 Bytes
Binary file not shown.

lib/bootstrap.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@
11361136
(filter (cond ((string? name) (regex name))
11371137
((symbol? name) (regex (symbol->string name)))
11381138
(else name))
1139-
(env))))
1139+
(env (interaction-environment)))))
11401140

11411141
;; -----------------------------------------------------------------------------
11421142
(define (promisify fn)

0 commit comments

Comments
 (0)