User Tools

Site Tools


cs330_f2016:labw

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
cs330_f2016:labw [2018/10/07 05:14]
morse
cs330_f2016:labw [2021/06/30 23:42] (current)
Line 112: Line 112:
 **Remember to throw errors, not simply print error messages.** **Remember to throw errors, not simply print error messages.**
  
-Your parser and interpreter must detect errors and explicitly signal them by calling throw(LispError(Reason). We will consider an error raised internally by julia to be a bug in your code.+Your parser and interpreter must detect errors and explicitly signal them by calling throw(LispError(Reason). ​**We will consider an error raised internally by julia to be a bug in your code.**. Think how you'd feel as a programmer if an error in your source code caused your compiler to crash instead of telling you what was wrong.
  
 To include LispError put "using Error" after the module declaration of you code. Error is a module containing LispError. To include LispError put "using Error" after the module declaration of you code. Error is a module containing LispError.
- 
-For example, Julia signals a “divide by zero” error if you attempt to evaluate (/ 1 0). Since we use Julia'​s division function to implement division in OWL, you may be tempted to leave it to Julia to signal division by zero errors for you. However, you must signal the error yourself by explicitly testing for division by zero before calling Julia'​s division procedure. 
  
 ---- ----
cs330_f2016/labw.txt · Last modified: 2021/06/30 23:42 (external edit)