Functional programming in Maple =============================== Function composition and application ------------------------------------ @, @@, x -> x curry, rcurry apply, unapply ' (uneval) Basic list operations --------------------- cons := (x, xs) -> [x, op(xs)]; first := xs -> if xs = [] then [] else op(1, xs) end if; rest := xs -> if xs = [] then [] else op(2..nops(xs), xs) end if; Sequence comprehensions ----------------------- seq, $ Filtering --------- select, remove, selectremove Iteration --------- map, zip Catamorphisms ------------- foldr, foldl, add, mul, andmap, ormap Lexical scoping --------------- use ... in ... end use (but see its help page for possible misunderstandings with regard to simplification). What you print is what you read ------------------------------- This is not related to functional programming but Lisp has this capability of printing data types in a format (s-expressions) that can be read back at the REPL (prompt) and which is very amenable for debugging purposes, etc. The analogous functionality in Maple can be enabled with: interface('prettyprint' = 0):