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

Multidocument files with mixed exec-mode #41

Open
kyleect opened this issue Sep 15, 2023 · 0 comments
Open

Multidocument files with mixed exec-mode #41

kyleect opened this issue Sep 15, 2023 · 0 comments

Comments

@kyleect
Copy link
Owner

kyleect commented Sep 15, 2023

(exec-mode 'module)

(export sum)
(define sum (lambda (a b) (+ a b)))

(sum 5 5) ;; Errors! Modules can only have defines, imports and exports
---
(exec-mode 'test)

(test "adds two numbers together" (lambda ()
  (assert (sum 5 5) 10)))

(test "should error is missing arguments" (lambda ()
  (assert-throws (sum) "Required 2 arguments but got 0")))
---
(exec-mode 'script)

(define a 10)
(define b 30)

(display (string-append "When you add " a " and " b " you get " (sum a b)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant