racket/lazy

placeholder appears in result

开放

#3 创建于 2016年2月19日

 (5 条评论) (0 个反应) (0 位负责人)Racket (7 个派生)github user discovery
good first issuehelp wanted

仓库指标

星标
 (7 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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

贡献者指南