Skip to content

Commit

Permalink
explicit error reporting in step8
Browse files Browse the repository at this point in the history
  • Loading branch information
fabjan authored and kanaka committed May 2, 2021
1 parent 79962a1 commit e0d52ca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions impls/sml/step8_macros.sml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,11 @@ fun print f =

fun rep e s =
s |> read |> eval e |> print
handle Nothing => ""
| e => "ERROR: " ^ (exnMessage e)
handle Nothing => ""
| SyntaxError msg => "SYNTAX ERROR: " ^ msg
| NotApplicable msg => "CANNOT APPLY: " ^ msg
| NotDefined msg => "NOT DEFINED: " ^ msg
| e => "ERROR: " ^ (exnMessage e)

val initEnv = ENV (NS (ref [])) |> bind identity coreNs

Expand Down

0 comments on commit e0d52ca

Please sign in to comment.