.guile: Add mytime macro.

master
Pierre Neidhardt 2020-08-10 12:02:38 +02:00
parent 7b1fdbca20
commit 9c6926584b
1 changed files with 26 additions and 0 deletions

26
.guile Normal file
View File

@ -0,0 +1,26 @@
;;; -*- mode: scheme; -*-
(cond ((false-if-exception (resolve-interface '(ice-9 readline)))
=>
(lambda (module)
;; Enable completion and input history at the REPL.
((module-ref module 'activate-readline))))
(else
(display "Consider installing the 'guile-readline' package for
convenient interactive line editing and input history.\n\n")))
(unless (getenv "INSIDE_EMACS")
(cond ((false-if-exception (resolve-interface '(ice-9 colorized)))
=>
(lambda (module)
;; Enable completion and input history at the REPL.
((module-ref module 'activate-colorized))))
(else
(display "Consider installing the 'guile-colorized' package
for a colorful Guile experience.\n\n"))))
;; TODO: Import (debugging time)
(use-modules (debugging time))
(define-macro (mytime expr . others)
`(let ((internal-time-units-per-second 1000000000.))
(time ,expr ,@others)))