Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler Env Warning Attempt to use global X in compile scope #16

Closed
rktjmp opened this issue Aug 5, 2021 · 2 comments
Closed

Compiler Env Warning Attempt to use global X in compile scope #16

rktjmp opened this issue Aug 5, 2021 · 2 comments

Comments

@rktjmp
Copy link
Owner

rktjmp commented Aug 5, 2021

Attempt to use global vim in compile scope.

In future versions of Fennel this will not be allowed without the
--no-complier-sandbox flag or passing a :compilerEnv global table in the
options.

@rktjmp
Copy link
Owner Author

rktjmp commented Aug 5, 2021

Fennel bug with macros or missing setting?

;;
;; won't work
;; fennel --globals vim --compile macro.fnl
;;

(macro my-mac []
  (assert vim.xyz "this is in a macro"))
(my-mac)

;;
;; does work
;; fennel --compile macro.fnl
;;

;; (fn my-mac []
;;   (assert vim.xyz "this is in a macro"))
;; (my-mac)

@rktjmp rktjmp closed this as completed Aug 5, 2021
@rktjmp
Copy link
Owner Author

rktjmp commented Aug 5, 2021

Was not quoting the macro.

Fix:

(macro my-mac []
  '(assert vim.xyz "this is in a macro"))
(my-mac)

@rktjmp rktjmp changed the title Compiler Env Warning Compiler Env Warning Attempt to use global X in compile scope Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant