Re: Opposite of ~^ FORMAT Directive



Hi,

On Apr 29, 7:25 am, Kent M Pitman <pit...@xxxxxxxxxxx> wrote:
vy <volkan.yaz...@xxxxxxxxx> writes:
Is it possible to make FORMAT print a phrase just in the first element
of a ~{...~} list iteration. (Like opposite of ~^.)
...
If the case of (foo '()) is something you worry about, then use:

(defun foo (x) (format t "~:[None~;~:*First ~{~A~^, then ~}~]." x))
=> FOO

(foo '())
None.
=> NIL

Yep, this is what I was looking for. Thanks so much for your detailed
answer.


Regards.

.



Relevant Pages

  • Re: popold
    ... NIL ... FOO ... Elapsed time = 0:00:01 ... Page faults ...
    (comp.lang.lisp)
  • Re: NIL as :key to ASSOC, INTERSECTION, POSITION, &c.
    ... I wouldn't have thought think that providing NIL as a:key ... (defun foo (&key bar) ... Above you would need to check for each keyword argument ...
    (comp.lang.lisp)
  • Re: Scoping Question
    ... * (setf foo 3) ... Warning: This variable is undefined: ... WARN is an external symbol in the KEYWORD package. ... NIL -- Never declare the variable, ...
    (comp.lang.lisp)
  • Re: Why if 0 succeeds in Ruby
    ... Every *comparison* with nil does fail. ... "unless foo" is not a comparison of foo with false, ... His code sample showed what he meant! ...
    (comp.lang.ruby)
  • Re: new block notation
    ... difference easy and clean, the way that it is now. ... irb:036:0> task foo do |t| p t end ...
    (comp.lang.ruby)