Groups | Search | Server Info | Login | Register


Groups > pt.comp.programacao > #276

o resto é Python

Path csiph.com!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Patricia Ferreira <pferreira@example.com>
Newsgroups pt.comp.programacao
Subject o resto é Python
Date Fri, 08 Mar 2024 18:36:46 -0300
Organization A noiseless patient Spider
Lines 17
Message-ID <87sf10flsh.fsf@example.com> (permalink)
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Injection-Info dont-email.me; posting-host="709217590c1a7d211dc83a3985170039"; logging-data="2027570"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+AQmfWh4CqAZ4h4jY3qTnh7bifUJNDnU8="
Cancel-Lock sha1:yd/m855aoUH7PEvnStnQmDQ1I3o= sha1:nYJFr4UmrousQAT0aghp/GnZUA0=
Xref csiph.com pt.comp.programacao:276

Show key headers only | View raw


Preciso de um procedimento que testa (sem sequência) se dois valors u, s
são nulos.  Se forem, retorne NIL.  Se não for, obtenha uns valores.
Eis como fazer:

(defun last-time-seen (username)
  (let ((u (get-account username)))
    (and u (let ((s (account-seen u)))
             (and s (universal-to-human s))))))

Moleza.  Mas eis como um Lisper realmente faz:

(defun last-time-seen (username)
  (when-let* ((u (get-account username))
              (s (account-seen u))
    (universal-to-human s)))

When-let*.  Isso é linguagem de /programação/.  O resto é Python.

Back to pt.comp.programacao | Previous | NextNext in thread | Find similar


Thread

o resto é Python Patricia Ferreira <pferreira@example.com> - 2024-03-08 18:36 -0300
  Re: o resto é Python Patricia Ferreira <pferreira@example.com> - 2024-03-08 18:48 -0300
  Re: o resto é Python Daniel Cerqueira <dan.list@lispclub.com> - 2024-03-08 22:13 +0000

csiph-web