User Tools

Site Tools


cs330_f2016:julia

Differences

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

Link to this comparison view

cs330_f2016:julia [2019/01/07 19:02]
wingated
cs330_f2016:julia [2021/06/30 23:42]
Line 1: Line 1:
-====Julia==== 
-We are using Julia V 1.0\\ 
- 
-https://​learnxinyminutes.com/​docs/​julia/​ 
- 
-https://​docs.julialang.org/​en/​v1.0/​ 
- 
-====Julia IDE==== 
- 
-In class, I've been using the 
-[[https://​github.com/​JunoLab/​uber-juno/​blob/​master/​setup.md|uber-juno]] IDE. 
- 
-Note that on a Mac, you need to have the xcode command line developer tools installed (and you need to have accepted the license agreement). 
- 
-===Provided tools=== 
-Three modules are provided. 
- 
-The Error module defines a single type, lisp Error that is a sub-type of Julia'​s Exception. Use it when your interpreter or parser encounters an error. 
- 
-The Lexer module exports a single function lex. Lex accepts a string and outputs an array of reals, symbols or another array. The output of the lexer should be fed into the parser. 
- 
-The repl module exports a single function repl(Source) which takes the name of the modle you wish to test. For example to test the Rudimentary interpreter If i had named my moudle RudInt I would call Repl.repl("​RudInt"​). It also allows you interp expressions,​ parse expressions,​ test single cases, test multiple exprs using files, and reload your module after making changes. Run help to get further information. ​ 
- 
-===Test Files=== 
-Test: 
-<code lisp> 
-(+ 1 2); 
-(* 1 2); 
-(- 1 2); 
-(with 3); 
-parse(+ 1 2); 
-</​code>​ 
-Answers: 
-<code lisp> 
-3; 
-2; 
--1; 
-error:​REGEX_FOR_ERROR_MSG;​ 
-Binop(op(+),​ Num(1), Num(2); 
-</​code>​ 
- 
-To test errors, simply use error:​EXPECTED_MESSAGE,​ where expected_message is a regular expression to match to. 
- 
-When returning custom defined types, like in the line above, the testing function automatically removes module namespace. So RudInt.Binop(....) would fail. 
  
cs330_f2016/julia.txt ยท Last modified: 2021/06/30 23:42 (external edit)