okdistribute / mags

Automated grading DSL for teachers
9 stars 4 forks source link

Overriding predefined functions #4

Closed okdistribute closed 12 years ago

okdistribute commented 13 years ago

If a student redefines a built-in program in their file, then mags runs the original, not their new definition. We had a situation where a student defined a helper named find. Mags tries to call the built-in find.

okdistribute commented 12 years ago

A test for this can be seen in tests/ now.

okdistribute commented 12 years ago

This has been fixed. Order of definitions in the student code was mattering. If the student redefined a built-in function after using it, the sandbox would use the definition of the procedure with the built-in function instead of the student's definition. To fix, we now call revert-interaction-semantics on the current-sandbox before evaling the student code. Now, order does not matter in the sandbox.