-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from drym-org/lets-write-a-qi-compiler
Let's Write a Qi Compiler!
- Loading branch information
Showing
72 changed files
with
4,569 additions
and
1,678 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#lang racket/base | ||
|
||
(provide make-eval-for-docs) | ||
|
||
(require racket/sandbox) | ||
|
||
(define (make-eval-for-docs . exprs) | ||
;; The "trusted" sandbox configuration is needed possibly | ||
;; because of the interaction of binding spaces with | ||
;; sandbox evaluator. For more context, see the Qi wiki | ||
;; "Qi Compiler Sync Sept 2 2022." | ||
(call-with-trusted-sandbox-configuration | ||
(lambda () | ||
(parameterize ([sandbox-output 'string] | ||
[sandbox-error-output 'string] | ||
[sandbox-memory-limit #f]) | ||
(apply make-evaluator | ||
'racket/base | ||
'(require qi | ||
qi/probe | ||
(only-in racket/list range first rest) | ||
racket/format | ||
racket/string | ||
(only-in racket/function curry) | ||
(for-syntax syntax/parse | ||
racket/base)) | ||
'(define (sqr x) | ||
(* x x)) | ||
'(define ->string number->string) | ||
exprs))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.