ln008 - ML ML is a functional programming language the ML...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
ML ML is a functional programming language the ML environment runs in an interactive mode C:\> sml Standard ML of New Jersey v110.49 [FLINT v1.5], September 13, 2004 - At the prompt the system expects a valid sentence in ML ML System Prompt
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ML – Constant Exressions The simplest sentence in the ML language is a constant expression Standard ML. .. - 1234; val it = 1234 : int - Sentence Delimiter Internal Variable Value Type of the Value Other Constants: real 123.4 bool true/false string “Susan” char #”Q”
Background image of page 2
ML – Operators and Simple Expressions Example: - ~ 1 + 2 – 3; val it = ~2 : int ~ is the unary -, here -2. orelse (logical or) Low andalso (logical and) < > <= >= = <> + - ^ * / div mod not ~ High Operators Precedence string concatenation; “abc” ^ “def” - (4 > 0) andalso (4 mod 2 = 0); val it = true : bool
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ML – Conditional Expressions if – then – else or if – then -if 1 < 2 then #”x” else #”y”; val it = #”x” : char
Background image of page 4
ML – Type Conversions Most programming languages we are used to allow
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/03/2011 for the course CSC 301 taught by Professor Hamel during the Spring '08 term at Rhode Island.

Page1 / 8

ln008 - ML ML is a functional programming language the ML...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online