From 49f674933eb63fda89a262a4678f07f854cb4fc7 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Tue, 18 Jun 2019 19:46:45 -0400 Subject: hn/g: Add fmt. * hn/g (fmt): New function. --- hn/g | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hn/g b/hn/g index 57d9fa3..c7360c1 100755 --- a/hn/g +++ b/hn/g @@ -9,6 +9,7 @@ (require racket/list) (require racket/port) +(require racket/format) (require net/http-client) (require openssl) @@ -20,6 +21,9 @@ (define HOST "news.ycombinator.com") + +(define (fmt n w) (~a n #:width w #:align 'right #:pad-string "0")) + (define (fp) "Fetch HN Front Page." (let ((hc (http-conn-open HOST #:ssl? (ssl-make-client-context 'secure) -- cgit v1.2.3