Paste number 68454: returns

Index of paste annotations: 1

Paste number 68454: returns
Pasted by: fugue88
When:3 years, 3 months ago
Share:Tweet this! | http://paste.lisp.org/+1GTI
Channel:#lispcafe
Paste contents:
Raw Source | XML | Display As
(defun my-func ()
  (if cond1
    (return-from my-func (calc-a-return-value)))
  (if cond2
    (return-from my-func (calc-a-different-one)))
  (if cond3
    (return-from my-func (foo)))
  (bar))

;; same as previous, if returning from a func

Annotations for this paste:

Annotation number 1: get-neighbors-info
Pasted by: Serva
When:3 years, 3 months ago
Share:Tweet this! | http://paste.lisp.org/+1GTI/1
Paste contents:
Raw Source | Display As
(setq maxrow 2)

(setq maxcol 4)

(defun get-neighbors-info (entire-graph row column)
  (let ((neighbors-exist nil))
    (if (> (- row 1) 0)
        (cons neighbors-exist T)
      (cons neighbors-exist F))
    (if (> (+ row 1) maxrow)
        (cons neighbors-exist T)
      (cons neighbors-exist F))
    (if (> (- col 1) 0)
        (cons neighbors-exist T)
      (cons neighbors-exist F))
    (if (> (+ col 1) 0)
        (cons neighbors-exist T)
      (cons neighbors-exist F))))

(get-neighbors-info graph 0 0)

Colorize as:
Show Line Numbers
Index of paste annotations: 1

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.