Welcome to the CHICKEN Scheme pasting service

HN Headlines minimal added by C-Keen on Thu Oct 9 09:33:52 2014

(use http-client rest-bind medea)
(define-method (item id ".json" #!key print)
  "https://hacker-news.firebaseio.com/v0/item/"
  #f
  read-json)
(define-method (topstories #!key print)
  "https://hacker-news.firebaseio.com/v0/topstories.json"
  #f
  read-json)
(define (frontpage-stories #!optional (number-of-articles 30))
  (map item (take (vector->list (topstories)) number-of-articles)))
(for-each (lambda (s)
            (printf "~s by ~s~%" (alist-ref 'title s) (alist-ref 'by s)))
          (frontpage-stories))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the R5RS procedure to access the second element of a pair?
Visually impaired? Let me spell it for you (wav file) download WAV