CMPT 383 Study Guide - Midterm Guide: Imperative Programming, Boolean Expression, Declarative Programming

364 views25 pages

Document Summary

We will be expressing programs very differently than you"re used to: requires rethinking our definition a little. Some languages don"t specify steps at all (as we will see)(also sql) : c, c++, java, c++, python . E. g. written in haskell: half x = x/2. X is not quite a variable there recursion can take the place of loops. No variable should mean easier debugging: results of a function determined entirely by its arguments. Purely functional language i. e doesn"t allow you t sneak imperative tricks in: it"s very functional. Our compiler will be ghc: but there are others, including hugs. [3,2,1] to load code from a . hs file : :l code. hs to reload changes. Arithmetic operators are as you probably expect: In functions, there are no parens around arguments, just use spaces: e. g. Most languages f(a,b) f(a, b+1) f(a,b) +1 f(g(a)) Strings are a shorthand for a list of characters: e. g. Basic list operations : concatenate and cons.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents