racket/lazy

placeholder appears in result

Offen

#3 geöffnet am 19.02.2016

 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Racket (7 Forks)github user discovery
good first issuehelp wanted

Repository-Metriken

Stars
 (7 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

This program, due to @jasonhemann, produces the output '((constant) . #<placeholder>).

#lang lazy
(require lazy/force)

(define (pull t$) (if (eq? (car t$) 'tag1) (pull (cdr t$)) t$))
(define (relρ a) (cons 'tag1 (cons 'tag2 (cons a (relρ a)))))
;; change either a in the body to 'const 

(!! 
 (let (($ (cdr (pull (relρ '(constant)))))) ;; s/'(constant)/'constant/
   (cons (car $) (cadr (pull (cdr $)))))) ;; change (car $) to 'other-constant
      ;; or replace the above with (cadr (pull (cdr $)))
      ;; or in-line the let in both places
      ;; also interesting, swap the order of args to cons

Contributor Guide