Add OCaml parrot.
This commit is contained in:
		
							parent
							
								
									6711eb6e5b
								
							
						
					
					
						commit
						c37eb1088e
					
				
					 1 changed files with 12 additions and 0 deletions
				
			
		
							
								
								
									
										12
									
								
								ocaml/main.ml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								ocaml/main.ml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,12 @@
 | 
			
		|||
let evaluate str =
 | 
			
		||||
  str;;
 | 
			
		||||
 | 
			
		||||
try
 | 
			
		||||
  while true do
 | 
			
		||||
    print_string "> ";
 | 
			
		||||
    let line = read_line () in
 | 
			
		||||
    let answer = evaluate line in
 | 
			
		||||
    print_endline answer
 | 
			
		||||
  done;
 | 
			
		||||
with
 | 
			
		||||
  End_of_file -> print_endline "Bye!";;
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue