Let val x = 3 val y = x val z = 3 val u = ref x val v = ref 3. Top x y z u v 3 3 3.

Slides:



Advertisements
Similar presentations
Windows and Macintosh Operating System Environments Demonstration of the Features and Functions of the Windows and Macintosh Systems DIG Introduction.
Advertisements

We are learning To convert a mixed fraction into an improper fraction and vice versa.
Programming with Lists
Modern Programming Languages, 2nd ed.
Homework What we have learnt Variable binding: val x = e; Conditionals: if e1 then e2 else e3 Function binding:fun x0 (x1 : t1,..., xn :
1 OCAML §nucleo funzionale puro l funzioni (ricorsive) l tipi e pattern matching l primitive utili: liste l trascriviamo pezzi della semantica denotazionale.
A little bit on Class-Based OO Languages CS153: Compilers Greg Morrisett.
Introduction to OCaml Slides prepared by Matt Gruskin Some material borrowed from the CIS 500 lecture notes.
Type Variables in ML Until we know the type of a value (perhaps never!), we use a variable for its type Book uses, e.g., t1, tx, tf PL literature uses.
If R = {(x,y)| y = 3x + 2}, then R -1 = (1) x = 3y + 2 (2) y = (x – 2)/3 (3) {(x,y)| y = 3x + 2} (4) {(x,y)| y = (x – 2)/3} (5) {(x,y)| y – 2 = 3x} (6)
ML Exceptions.1 Standard ML Exceptions. ML Exceptions.2 Exceptions – The Need  An extensive part of the code is error handling  A function can return.
Writing functions in OCaml. Defining a simple function # let add (x, y) = x + y;; val add : int * int -> int = Notice what this says: –add is a value.
The Little Buffer PCB C3 TIP GND R4 R3 R1 R3 R2 R6K J L +V 0V –V–V A D C E F A1 A3 H BRI03 TL071 C2C1.
(define (f x) (if (< x 0) (lambda (y) (- y x)) (lambda (y) (- x y)))) GE f: P1 para:x body:(if … )
ML Exceptions.1 Standard ML Exceptions. ML Exceptions.2 Exceptions – The Need  An extensive part of the code is error handling  A function F can return.
ML Exceptions.1 Standard ML Exceptions. ML Exceptions.2 Exceptions – The Need  An extensive part of the code is error handling  A function can return.
Father Abraham Father Abraham had many kids. Many kids had Father Abraham. And I am one of them, And so are you, So let's all praise the Lord: right arm.
If H is the subgroup in Z 12, then H2 = (a) 5(b) 14 (c) {3, 6, 9, 0}  {2}(d) {5, 8, 11, 2} (e) {5, 6, 9, 0}(f) {3, 2, 5}
CS 312 Spring 2004 Lecture 18 Environment Model. Substitution Model Represents computation as doing substitutions for bound variables at reduction of.
ML: a quasi-functional language with strong typing Conventional syntax: - val x = 5; (*user input *) val x = 5: int (*system response*) - fun len lis =
CS 312 Spring 2002 Lecture 16 The Environment Model.
1 Functional Programming and ML. 2 What’s wrong with Imperative Languages? State State Introduces context sensitivity Introduces context sensitivity Harder.
Cs776 (Prasad)L15strm1 Reasoning with Functional Programs Optimization by source to source transformation Well-founded induction Streams : Infinite lists.
LETS GET STARTED! Fractions for 2 nd graders By Rebecca Gotz.
Accounting Practices 501 Chapter 8 Reversing entries Cathy Saenger, Senior Lecturer, Eastern Institute of Technology © Pearson 2011.
Fractions and Decimals 5.2. Writing a Fraction as a decimal Divide the numerator by the denominator.
Determinants. Determinant - a square array of numbers or variables enclosed between parallel vertical bars. **To find a determinant you must have a SQUARE.
Roman Numerals Northern Computer Lab. The Roman Numeral System is based on 7 different symbols. This system was developed in ancient Rome.
Summer Assignment Review
Training begins in… 15:00 minutes Training begins in… 14:00 minutes.
Let’s learn about it. 10.
Know the best feature in all our solutions? Understanding. Total Technology Solutions “A head for your business. A heart for your ministry.”
An alternative subtraction algorithm. In order to subtract, the top number must be larger than the bottom number To make the top number.
CS April 2002 Lazy Evaluation, Thunks, and Streams.
Divisibility.
GAD Online Essay Online Software Overview Created by A. Tait 2014.
Fractions, Decimals, and Percents 9.1 Nils Gombas.
SIZE - Top SERVER ROOM Designed by – openbox |
1.SML Docs Standard Basis 2.First-Class Functions Anonymous Style Points Higher-Order 3.Examples Agenda.
Create a grid. Write one factor (in expanded notation) along the top. Multiply each expanded number in the top factor by each expanded number in the.
Exponents & Order of Operations
Programming Languages Dan Grossman 2013
Programming Languages Dan Grossman 2013
ML Again ( Chapter 7) Patterns Local variable definitions
Effect-driven CPS transformation in interpreters
Π: nil d: 0 π: nil d: ∞ 2 A B -1 π: nil d: ∞ C D E 4 π: nil d: ∞ π: nil d: ∞
הנעה והטמעה של שימוש במערכות BI בקרב דרגי הניהול הארגוני
Top 6 Strategies of Digital Marketing.
IEP - h2dcounseling.com
This Little Light of Mine
FlipShare 5.0 Part 1 You should be able to: Add a folder
Objective caml Daniel Jackson MIT Lab for Computer Science 6898: Advanced Topics in Software Design March 18, 2002.
Create and distinguish different types of graphs.
Determinants.

Agenda SML Docs First-Class Functions Examples Standard Basis
Agenda SML Docs First-Class Functions Examples Standard Basis

10:00.
Webropol Getting started- 1
مؤلف : اتكينسون و همكاران
РЕПУБЛИКА БЪЛГАРИЯ МИНИСТЕРСТВО НА ЗЕМЕДЕЛИЕТО, ХРАНИТЕ И ГОРИТЕ
Dividing a Whole Number by a fraction
Constructors Construct a value of a given type.
Which graph should I use?
CSE 341 Section 3 Nick Mooney Spring 2017.
x > Array.new(5) [nil, nil, nil, nil, nil] > x = Array.new(5)
HD target Grass
Presentation transcript:

Let val x = 3 val y = x val z = 3 val u = ref x val v = ref 3. Top x y z u v 3 3 3

Let val x = 3 val y = x val z = 3 val u = ref x val v = ref 3 val _ = u := 42 Top x y z u v

Let val x = 3 val y = x val z = 3 val u = ref x val v = ref 3 val _ = u := 42 val _ = v := !u Top x y z u v

val a = (1, 2) val b = (a, a) val c = (42, ref b, a) Top a b c

val a = (1, 2) val b = (a, #2(a)) val c = (42, ref b, a) Top a b c

val a = (1, 2) val b = (a, #2(a)+5) val c = (42, ref b, a) Top a b c

val a = 2 val b = (a, a+5) Top a b 27

Let val s = BAR val t = BAZ 312 val u = QUX (42, ref 211, ref s) val v = nil val w = BAR :: s :: nil Top s t u u w 42 BAR BAZ 3 QUX 211 :: BAR :: nil

Val arr = Array.fromList([3, fn(x) => x+1]) 3 Top arr p: x p: x+1

Val x = [ref 1, ref 2, ref 3] Val a = hd x Val b = tl x Top a b x :: 1 23 nil