Path: csiph.com!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Patricia Ferreira Newsgroups: pt.comp.programacao Subject: Re: o resto =?utf-8?Q?=C3=A9?= Python Date: Fri, 08 Mar 2024 18:48:55 -0300 Organization: A noiseless patient Spider Lines: 33 Message-ID: <871q8kfl88.fsf@example.com> References: <87sf10flsh.fsf@example.com> 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/nT/Gtwdc/MwBvbyoyWuCF10gCjTXDHeM=" Cancel-Lock: sha1:uvKgM6YlI2V+YX/3F+3EAsaIrZg= sha1:Pj7SpmOyMYpdUIMnwhZ9oLq4nn0= Xref: csiph.com pt.comp.programacao:278 Patricia Ferreira writes: > 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. Mas, pra ser justo, isso não é Common Lisp. Isso é Alexandria. Alexandria: https://alexandria.common-lisp.dev/ --8<---------------cut here---------------start------------->8--- Alexandria is a project and a library. As a project Alexandria's goal is to reduce duplication of effort and improve portability of Common Lisp code according to its own idiosyncratic and rather conservative aesthetic. What this actually means is open to debate, but each project member has a veto on all project activities, so a degree of conservativism is inevitable. --8<---------------cut here---------------end--------------->8---