FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

with-at-most-one-form

Arguments: (&key if-null-body) &body body

The purpose of this macro is to ensure that one and only one of a set of conditionalized forms results from the evaluation of body. So in an example below, we conditionalize for Linux and Windows. If later we start running on a Mac, the with-at-most-one-form will error because we forgot to add a mac-conditionalized form.

When a with-at-most-one-form is macroexpanded, the result is either:

Examples

;; This would signal an error at macroexpand time if run on a
;; non-Linux or non-Windows version of Allegro CL:
(with-at-most-one-form ()
  #+linux (do-linux-stuff)
  #+mswindows (do-windows-stuff))

;; The result of this form would be 10 on Windows and 11 elsewhere:
(with-at-most-one-form (:if-null-body 11)
  #+mswindows 10)

;; This call will always error (at macroexpand time) as body has
;; two forms:
(with-at-most-one-form ()
  (setq author "Bill")
  (setq editor "Helen"))
-> ERROR

Copyright (c) 1998-2017, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2017.2.15.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version