added !eval and documented it

svn: r11873
This commit is contained in:
Eli Barzilay 2008-09-25 19:17:50 +00:00
parent 77e9b026b3
commit 7695ee44e3
2 changed files with 10 additions and 2 deletions

View File

@ -692,6 +692,9 @@
(syntax-rules () (syntax-rules ()
[(_ expr) (begin (!defined expr) (!integer* expr))])) [(_ expr) (begin (!defined expr) (!integer* expr))]))
(provide !eval)
(define-syntax-rule (!eval expr) ((submission-eval) `expr))
(provide !test) (provide !test)
(define-syntax !test (define-syntax !test
(syntax-rules () (syntax-rules ()

View File

@ -213,8 +213,8 @@ Within the body of @scheme[check:], @scheme[users] and
@scheme[submission] will be bound to the checker arguments---a @scheme[submission] will be bound to the checker arguments---a
(sorted) list of usernames and the submission as a byte string. In (sorted) list of usernames and the submission as a byte string. In
addition to the functionality below, you can use addition to the functionality below, you can use
@scheme[((submission-eval) expr)] to evaluate expressions in the @scheme[(!eval _expr)] (or @scheme[((submission-eval) '_expr)]) to
submitted code context, and you can use evaluate expressions in the submitted code context, and you can use
@scheme[(with-submission-bindings (id ...) body ...)] to evaluate the @scheme[(with-submission-bindings (id ...) body ...)] to evaluate the
body when @scheme[id]'s are bound to their values from the submission body when @scheme[id]'s are bound to their values from the submission
code.} code.}
@ -354,6 +354,11 @@ code.}
@scheme[equal?] forms are @italic{not} evaluated in the submission @scheme[equal?] forms are @italic{not} evaluated in the submission
context.} context.}
@defform[(!eval expr)]{
Evaluate an arbitrary expession in the submission context. This is
a simple shorthand for @scheme[((submission-eval) `expr)].}
@defproc*[([(!all-covered) void?] @defproc*[([(!all-covered) void?]
[(!all-covered [proc (string? . -> . any)]) void?])]{ [(!all-covered [proc (string? . -> . any)]) void?])]{