function_005FCFFI-UTIL_003A_003AFLAG-LIST.html 1.15 KB
Newer Older
-urso-'s avatar
-urso- committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<html
  ><head
    ><title
      >Function FLAG-LIST</title
    ><link href="../style.css" rel="stylesheet"
    /><link title="Print" href="../print.css" rel="alternate stylesheet"
    /></head
  ><body
    ><div class="qbook"
      ><div class="computational-element"
        ><h1
          >Function: FLAG-LIST</h1
        ><div class="contents"
          ><h2
  >Documentation</h2
><blockquote
17
  ><p>returns a list of flags, which byte pattern is found in value </p></blockquote
-urso-'s avatar
-urso- committed
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
><h2
            >Source</h2
          ><pre class="code"
            >(defun flag-list (value &amp;key
		  (flag-system *current-flag-system*)
		  flags)
  &quot;returns a list of flags, which byte pattern is found in value&quot;
  (let ((ret (list)))
    (if flags
	(mapc (lambda (key)
		(when (has-flag value key flag-system)
		  (push key ret)))
	      flags)
	(maphash (lambda (key val)
		   (when (= val (logand val value))
		     (push key ret)))
		 (flag-system-flags flag-system)))
    ret))</pre
          ><a href="../Flag_0020Systems.html#function_005FCFFI-UTIL_003A_003AFLAG-LIST"
            >Source Context</a
          ></div
        ></div
      ></div
    ></body
  ></html
>