Jim's
Tutorials

Spring 2019
course
site

Nick Says

This week mostly involved debugging the undefined error that was occuring during the parsing step, and adding documentation to functions and files so that I could actually understand what I was doing...there was a moment where I had to reorient myself to my own code because I could not remember exactly what I had done and what each piece of code should do, so I'm glad to have gone through and given each function a readable description. This process also helped me find the reason why my code was skipping over every other value: I was calling reader_obj.next() and reaching the end of the token list too soon, and my parser was not analyzing all of the values stored in a list. Now that the parsing issue is fixed, there's still an issue with the pr_str function that I need to correct so that the entire list is printed when typed, but I think at this point i've finished step 1. At this point, I believe I will just do a writeup on what I've accomplished so far and what the next steps would be were I to continue with this project: I don't think I will be able to implement the evaluation step in the amount of time left in the semester...

here's the output of the code as it stands now. much better than last week.

hypatia@Yours-MacBook-Air:/mal/javascript$ node step1_read_print.js 
user> hello
Debug: Tokens = hello,
token =  hello
Typeof token is function
read_form returns function toString() { [native code] }
undefined
user> 1
Debug: Tokens = 1,
token =  1
read_form returns 1
undefined
user> (1 2 3)
Debug: Tokens = (,1, 2, 3,),
token =  1
token =   2
token =   3
read_form returns 3
undefined
user> (1 2 (3 4 (5 6 7)))
Debug: Tokens = (,1, 2, (,3, 4, (,5, 6, 7,),),),
token =  1
token =   2
token =   (
token =  3
token =   4
token =   (
token =  5
token =   6
token =   7
read_form returns 7
undefined
user> ^D
hypatia@Yours-MacBook-Air:/mal/javascript$ 

Jim says

We mentioned the kingdom of nouns.

In the news this week : Camille Paglia.

https://cs.marlboro.college /cours /spring2019 /jims_tutorials /ncreel /may2
last modified Sat April 27 2024 6:26 pm

attachments [paper clip]

  last modified size
TXT finalprojectprogramminglanguages.pdf Sat Apr 27 2024 06:26 pm 31K
TXT printer.js Sat Apr 27 2024 06:26 pm 1.0K
TXT reader.js Sat Apr 27 2024 06:26 pm 3.9K
TXT step0_repl.js Sat Apr 27 2024 06:26 pm 2.4K
TXT step1_read_print.js Sat Apr 27 2024 06:26 pm 3.2K