Logo

Programming-Idioms

  • Lisp

Idiom #3 Create a procedure

Like a function which doesn't return any value, thus has only side effects (e.g. Print to standard output)

def finish(name):
    print(f'My job here is done. Goodbye {name}')

Variable name inside curly braces will be replaced by its value. This is called "f-strings" introduced in Python version 3.6
f = lambda: print('abc')
f()
(defun show (message)
  (format t "Hello: ~a" message)
  (values))
procedure Finish (Name : String) is
begin
   Put_Line ("My job here is done. Goodbye " & Name);
end Finish;

New implementation...
< >
programming-idioms.org