summaryrefslogtreecommitdiffstatshomepage
path: root/tekuti
diff options
context:
space:
mode:
authorGravatar Andy Wingo2010-11-13 18:58:36 +0100
committerGravatar Andy Wingo2010-11-13 18:58:36 +0100
commit5d85d1b7fe6ccf72578a3c02caabd9623c16a76c (patch)
tree4a5d358427f06c3e18630d86efc1ba868223d057 /tekuti
parenta8c28da20b58701083cc788eb714e34e6740ab34 (diff)
downloadtekuti-5d85d1b7fe6ccf72578a3c02caabd9623c16a76c.tar.gz
tekuti-5d85d1b7fe6ccf72578a3c02caabd9623c16a76c.zip
remove with-backtrace definition; add date->timestamp
* tekuti/util.scm: Remove with-backtrace definition. Add date->timestamp definition.
Diffstat (limited to 'tekuti')
-rw-r--r--tekuti/util.scm26
1 files changed, 5 insertions, 21 deletions
diff --git a/tekuti/util.scm b/tekuti/util.scm
index 9b86a30..e7bba1c 100644
--- a/tekuti/util.scm
+++ b/tekuti/util.scm
@@ -34,8 +34,8 @@
call-with-temp-file emailish? urlish?
date-increment date-comparator date-before? date-after? compose1
rfc822-date->timestamp timestamp->rfc822-date timestamp->atom-date
- timestamp->date string-split/trimming
- list-intersperse with-backtrace with-time-debugging))
+ date->timestamp timestamp->date string-split/trimming
+ list-intersperse with-time-debugging))
(define (emailish? x)
(match-bind "^([a-zA-Z0-9._+-]+)@([a-zA-Z0-9-]+\\.)+[a-zA-Z]+$"
@@ -157,25 +157,6 @@
(if (null? l) (reverse dest)
(loop (cdr l) (cons (car l) (cons elem dest)))))))
-(define (with-backtrace* proc)
- (let ((cep (current-error-port)))
- (start-stack
- 'with-backtrace
- (with-throw-handler
- #t
- proc
- (lambda (k . args)
- (newline cep)
- (format cep "Throw to `~a', args: ~s\n" k args)
- (display "Backtrace:\n" cep)
- (display-backtrace (make-stack #t) cep)
- (newline cep))))))
-
-(define-syntax with-backtrace
- (syntax-rules ()
- ((_ form0 forms ...)
- (with-backtrace* (lambda () form0 forms ...)))))
-
(define (gettimeofday-diff prev)
(let ((now (gettimeofday)))
(+ (- (car now) (car prev))
@@ -248,6 +229,9 @@
(define (timestamp->date timestamp)
(time-utc->date (make-time time-utc 0 timestamp) 0))
+(define (date->timestamp date)
+ (time-second (date->time-utc date)))
+
(define (timestamp->atom-date timestamp)
(date->string (timestamp->date timestamp)
"~Y-~m-~dT~H:~M:~SZ"))