Penguin

Differences between current version and revision by previous author of ML.

Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History

Newer page: version 25 Last edited on Tuesday, November 9, 2004 1:13:56 am by AristotlePagaltzis
Older page: version 21 Last edited on Friday, September 12, 2003 7:06:47 pm by GlynWebster Revert
@@ -1,31 +1,36 @@
-__ML__ is a family of StaticallyTyped [FunctionalLanguage] s with StrictEvaluation, PolymorphicTypes, HigherOrderFunctions, a higher-order module system. ML can be used interactively for learning, experimentation and testing, or it can be compiled. The two major dialects of ML are [Ocaml ] and [SML]. SML is a standardised language with several implementations. Ocaml has a single open source implementation, it extends ML with an [OOP] system. Both major dialects have compilers that produce native code that rival the speed of C++, and extensive standard and third-party libraries. 
+__ML__ is a family of StaticallyTyped functional ProgrammingLanguage~ s with StrictEvaluation, PolymorphicTypes, HigherOrderFunctions, a higher-order module system. [ ML] can be used interactively for learning, experimentation and testing, or it can be compiled. The two major dialects of [ ML] are [OCaml ] and [SML]. [ SML] is a standardised language with several implementations. [OCaml] has a single OpenSource implementation, it extends [ ML] with an [OOP] system. Both major dialects have compilers that produce native code that rival the speed of [ C++] , and extensive standard and third-party libraries. 
  
-[Why YOU want to program in ML | http://www.schizomaniac.net/ml.html] gives you a tour of the features of ML that make it a good general-purpose programming language. It talks about [SML], but what it says applies to [Ocaml ] as well. 
+[Why YOU want to program in ML | http://www.schizomaniac.net/ml.html] gives you a tour of the features of [ ML] that make it a good general-purpose programming language. It talks about [SML], but what it says applies to [OCaml ] as well. 
  
-!!!An example of ML code: 
+!!!An example of [ ML] code: 
  
- __fun__ interpret_functionally (program : opcode list) : unit =  
- (* Interprets a parsed [Brainf*ck] program using integers  
- on a strip of TuringMachine tape as the memory. *)  
- __let__  
- __val__ fresh_tape = Tape.make()  
- __fun__ step (tape, op) =  
- __let__ byte = Tape.read(tape) __in__  
- __case__ op __of__  
- Inc_ptr n => times(n, Tape.forward, tape)  
- | Dec_ptr n => times(n, Tape.back, tape)  
- | Inc_byte n => Tape.write(byte + n, tape)  
- | Dec_byte n => Tape.write(byte - n, tape)  
- | Putchar => ( putchar(byte) ; tape )  
- | Getchar => Tape.write(getchar(), tape)  
- | Loop body =>  
- __if__ byte = 0 __then__ tape  
- __else__ step (step_sequence (tape, body), op)  
- __end__  
- __fun__ step_sequence (tape, oplist) =  
- List.foldl(step, tape, oplist)  
- __in__  
- ignore (step_sequence(fresh_tape, program))  
- __end__ 
+<pre>  
+ __fun__ interpret_functionally (program : opcode list) : unit =  
+ (* Interprets a parsed [Brainf*ck] program using integers  
+ on a strip of TuringMachine tape as the memory. *)  
+ __let__  
+ __val__ fresh_tape = Tape.make()  
+ __fun__ step (tape, op) =  
+ __let__ byte = Tape.read(tape) __in__  
+ __case__ op __of__  
+ Inc_ptr n => times(n, Tape.forward, tape)  
+ | Dec_ptr n => times(n, Tape.back, tape)  
+ | Inc_byte n => Tape.write(byte + n, tape)  
+ | Dec_byte n => Tape.write(byte - n, tape)  
+ | Putchar => ( putchar(byte) ; tape )  
+ | Getchar => Tape.write(getchar(), tape)  
+ | Loop body =>  
+ __if__ byte = 0 __then__ tape  
+ __else__ step (step_sequence (tape, body), op)  
+ __end__  
+ __fun__ step_sequence (tape, oplist) =  
+ List.foldl(step, tape, oplist)  
+ __in__  
+ ignore (step_sequence(fresh_tape, program))  
+ __end__  
+</pre>  
  
-(This is in SML.) 
+(This is in [ SML] .)  
+  
+----  
+CategoryProgrammingLanguages, CategoryFunctionalProgrammingLanguages