Skip to content

Instantly share code, notes, and snippets.

View golotap's full-sized avatar

Damian Mazurkiewicz golotap

  • Mazur Labs
  • New Zealand
View GitHub Profile
;Any arbitrary list s can be transformed into a key-list by transforming each item in s
;into a key-element (choosing appropriate keys in the process).
;Write a function (make-key-list s) that returns a key-list based on its list argument s.
;2009 Paper
(define (m-k-l s)
(define (m-k-l-tr s id)
(if (null? s) '()
(cons(cons id (list (car s)))(m-k-l-tr (cdr s) (add1 id)))))
(m-k-l-tr s 1))