unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Macro for Python-style debugging output
@ 2022-03-28 19:22 Jean Abou Samra
  2022-03-30 19:08 ` Liliana Marie Prikler
  0 siblings, 1 reply; 3+ messages in thread
From: Jean Abou Samra @ 2022-03-28 19:22 UTC (permalink / raw)
  To: guile-devel

The following macro is a variant of peek that mimics Python's = format
specifier (e.g. print(f"{a=} {a+b=}")) by printing expressions and the
values they evaluate to.

(define-syntax-rule (db arg ...)
   (begin
     (let ((evaluated-arg arg))
       (format (current-error-port) ";;; ~s => ~s\n" (quote arg) 
evaluated-arg)
       evaluated-arg)
     ...))

Am I reinventing the wheel? Does anyone see value in this
being added to Guile?

Thanks,
Jean




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-31  2:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-28 19:22 Macro for Python-style debugging output Jean Abou Samra
2022-03-30 19:08 ` Liliana Marie Prikler
2022-03-31  2:38   ` Thien-Thi Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).