For each expression, write down its type. Give the most specific type you
can: for the expression 8
, number is a better
answer than word.
x
-- Symbol, atom or word(x)
-- List'(x y z)
-- List 8
-- Number or integer (symbol etc. are less specific)+
-- Procedure (symbol etc. are less specific)(+ 9 10)
-- List (lambda (x) (word 'super- x))
-- ListFor each procedure, write down the types of its arguments and its result. Give the most specific types you can.
+
-- Arguments: number, Result: numberword
-- Arguments: word, Result: wordsentence
-- Arguments: word or sentence, Result: sentenceevery
-- Argument 1: procedure, Argument 2: List, Result: ListFor each expression, write down whether it can be evaluated or not (do not write down the value).
(+ 1 2)
-- Yes(+ 1 'two)
-- No, second argument is not a number, it's just a symbol(+ 1 (2))
-- No, second argument is not a number, it's a list(word 1 2)
-- Yes(word 'super 'stitious)
-- Yes(word '(super stitious))
-- No, argument is not a word, it's a list(every 'super '(duper sonic))
-- No, first argument is not a procedcure(every (lambda (x) (word 'super- x)) '(duper sonic))
-- Yes(every '(lambda (x) (word 'super- x)) '(duper sonic))
-- No, first argument is not a procedure, it's just a list