# Q

`(qsym . sym) -> lst`
  Returns a cons pair of the value and property list of `sym`. See also `quote`, `val` and `getl`.

      : (setq A 1234)
      -> 1234
      : (put 'A 'a 1)
      -> 1
      : (put 'A 'b 2)
      -> 2
      : (put 'A 'f T)
      -> T
      : (qsym . A)
      -> (1234 f (2 . b) (1 . a))

`(quote . any) -> any`
  Returns `any` unevaluated. The reader recognizes the single quote char `'` as a macro for this function. See also `lit`.

      : 'a
      -> a
      : '(foo a b c)
      -> (foo a b c)
      : (quote (quote (quote a)))
      -> ('('(a)))

`(query 'lst ['lst]) -> flg`
  Handles an interactive Pilog query. The two `lst` arguments are passed to `prove`. `query` displays each result, waits for console input, and terminates when a non-empty line is entered. See also `?`, `pilog` and `solve`.

      : (query (goal '((append @X @Y (a b c)))))
       @X=NIL @Y=(a b c)
       @X=(a) @Y=(b c).   # Stop
      -> NIL

`(queue 'var 'any) -> any`
  Implements a queue using a list in `var`. The `any` argument is (destructively) concatenated to the end of the value list. See also `push`, `pop` and `fifo`.

      : (queue 'A 1)
      -> 1
      : (queue 'A 2)
      -> 2
      : (queue 'A 3)
      -> 3
      : A
      -> (1 2 3)
      : (pop 'A)
      -> 1
      : A
      -> (2 3)

`(quit ['any ['any]])`
  Stops current execution. If no arguments are given, all pending `finally` expressions are executed and control is returned to the top level read-eval-print loop. Otherwise, an error handler is entered. The first argument can be some error message, and the second might be the reason for the error. See also `Error Handling`.

      : (de foo (X) (quit "Sorry, my error" X))
      -> foo
      : (foo 123)                                  # 'X' is bound to '123'
      123 -- Sorry, my error                       # Error entered
      ? X                                          # Inspect 'X'
      -> 123
      ?                                            # Empty line: Exit
      :