Section 4 CSE 341 – Konstantin Weitz.

Slides:



Advertisements
Similar presentations
Implementation options There are two basic approaches: –array-based –linked We will consider array-based implementation first Use a TDD approach: first.
Advertisements

CSE341: Programming Languages Lecture 12 Modules Dan Grossman Fall 2011.
CSE341: Programming Languages Lecture 7 Functions Taking/Returning Functions Dan Grossman Fall 2011.
Arrays An array is a collection of variables, all of the same type. An array is created with the new operator. The size of an array must be specified at.
Session Management A290/A590, Fall /25/2014.
Injection Attacks by Example SQL Injection and XSS Adam Forsythe Thomas Hollingsworth.
World Health Organization
Effectively Integrating Information Technology (IT) Security into the Acquisition Process Section 5: Security Controls.
Dividing by a Fraction. What does it mean to divide by a fraction?
1 Modular Software/ Component Software 2 Modular Software Code developed in modules. Modules can then be linked together to produce finished product/program.
Extreme Blue © 2004 IBM Corporation Eunomia HDB Compliance Auditing System Architecture.
MASTERING THE MANUAL MODE WHY IT’S IMPORTANT AND HOW TO USE IT.
Section 5Chapter 5. 1 Copyright © 2012, 2008, 2004 Pearson Education, Inc. Objectives 2 3 Dividing Polynomials Divide a polynomial by a monomial. Divide.
MAT 1234 Calculus I Section 2.5 Part II Chain Rule
PHP Open source language for server-side scripting Works well with many databases (e.g., MySQL) Files end in.php,.php3 or.phtml Runs on all major platforms.
Percents To Reduced Fractions Decimals To Percents.
Activity 4 Data flow diagram of a school attendance system
MCR 3U SECTION 3.4 REFLECTIONS OF FUNCTIONS. Example 1: Graph the functions and on a single grid.
M M M M 5. Not Listed
Query Module The Query module can be used to create complex queries (by algorithms) and get count for the given pattern in the following Grammar Syntax.
Fractions – Common Denominators When adding and subtracting fractions you need a common denominator. This section will focus on finding the lowest common.
Creating and Using Modules Sec 9-6 Web Design. Objectives The student will: Know how to create and save a module in Python Know how to include your modules.

19 March More on Sorting CSE 2011 Winter 2011.
Learning and remembering.
NOTES: Least Common Multiple Today, I will learn how to find the Lowest Common Multiple (LCM) for two numbers. I will do this by using the slide method.
CSE341: Programming Languages Lecture 10 ML Modules
CSE341: Programming Languages Lecture 7 First-Class Functions
Adding Fractions Instructions
Simplest Form of a Fraction
Server Concepts Dr. Charles W. Kann.
Purchasing Innovations 2017.
تحليل الحساسية Sensitive Analysis.
CSE341: Programming Languages Lecture 10 ML Modules
With thanks to Nick Mooney & Spencer Pearson
CSE 341 Section 4 Nick Mooney Spring 2017.
Addition and Subtraction of Fractions
CSE341: Programming Languages Lecture 7 First-Class Functions
FP Foundations, Scheme In Text: Chapter 14.
CSE341: Programming Languages Lecture 7 First-Class Functions
CSE341: Programming Languages Lecture 10 ML Modules
Functions, Patterns and Datatypes
CSE 341 Section 5 Winter 2018.
CSE341: Programming Languages Lecture 10 ML Modules
قوانين برگزاري مناقصات و آيين نامه مالي و معاملاتي دانشگاه علوم پزشكي و خدمات بهداشتي ،درماني تهران
CSE 341 Section 3 Nick Mooney Spring 2017.
341 midterm review Xinrong Zhao Autumn 2018.
CSE 341 Section 4.
Test123 blah. hjghgghhg.
CSE341: Programming Languages Lecture 10 ML Modules
CSE341: Programming Languages Lecture 7 First-Class Functions
This uses Knowledge Fusion Navigator and utilities
Announcements Quiz 5 HW6 due October 23
With thanks to Nick Mooney, Spencer Pearson & Alexander Lent
VBk Practical Mathematics and Microsoft Excel Course
Functions, Patterns and Datatypes
Concur Icons This document provides a listing of icons in the Concur Request, Travel, and Expense modules. The icons are listed in sections by module.
CSE341: Programming Languages Lecture 7 First-Class Functions
Nicholas Shahan Spring 2016
Module 3 Arithmetic and Geometric Sequences
With thanks to Alexander Lent, Nick Mooney, Spencer Pearson
CSE341: Programming Languages Lecture 7 First-Class Functions
Controlled Assessment Diary:
CSE341: Programming Languages Lecture 10 ML Modules
CSE341: Programming Languages Lecture 7 First-Class Functions
CSE341: Programming Languages Lecture 7 First-Class Functions
CSE341: Programming Languages Lecture 10 ML Modules
Name __________________ Class ___________________
Science is fun. Science is fun. Science is fun. Science is fun. Science is fun. Science is fun. Science is fun. Science is fun. Science is fun. Science.
Name __________________ Class ___________________
Presentation transcript:

Section 4 CSE 341 – Konstantin Weitz

What if we need function f to call g, Mutual Recursion What if we need function f to call g, and function g to call f?

Mutual Recursion Does this work? 1 fun f x = 5 fun g y = 2 ... 6 ... 3 g y 7 f x 4 ... 8 ...

Mutual Recursion We can employ higher order functions for a work around. fun earlier (f,x) = … f y … … fun later x = … earlier(later,y) fun earlier (f, x) = blah blah... f x ... fun later x = blah blah earlier (later, x)

Mutual Recursion But ML gives us special syntax for this 1 fun f x = 5 and g y = 2 ... 6 ... 3 g y 7 f x 4 ... 8 ...

Modules Remember that signatures are good both for organization and management and for maintaining invariants

Modules - Invariants Ordering of operations Data kept in good state e.g. insert, then query Data kept in good state e.g. fractions in lowest terms Policies followed e.g. don't allow shipping request without purchase order Sensitive information hidden e.g. force authentication for api use

Currying and Higher Order Functions Questions?