test/symbol∼subscripts: pass
(define (test/symbol∼subscripts _) (⊦= 'g₁₂₃ (symbol∼subscripts 'g123)))
((eta 0.0) (memory #(6291456 1956912 1048576)) (stdout "") (stderr ""))
test/variable-printer: pass
(define (test/variable-printer _)
(⊦= "g₁₂₃" (display->string (V 'g123)))
(⊦= "(g₁ hello)" (display->string (list (V 'g1) (V 'hello)))))
((eta 0.0) (memory #(6291456 1958504 1048576)) (stdout "") (stderr ""))
test/fresh₁: pass
(define (test/fresh₁ _)
(let ((g₁ (with-output-to-string (τ (fresh₁ display))))
(g₂ (with-output-to-string (τ (fresh₁ display)))))
(⊨ (gensym-subscripted? g₁))
(⊨ (gensym-subscripted? g₂))
(⊭ (equal? g₁ g₂)))
(fresh₁
(λ (v)
(⊨ (variable? v))
(⊦= (symbol->string (symbol∼subscripts (variable-s v)))
(display->string v)))))
((eta 0.001) (memory #(6291456 1959936 1048576)) (stdout "") (stderr ""))
test/fresh: pass
(define (test/fresh _)
(let1 (vs (fresh (v w z) (list v w z)))
(⊦= 3 (length vs))
(⊨ (pairwise-different? vs))
(let1 (str (with-output-to-string (τ (display vs))))
(⊦= (string-append
"("
(display->string (car vs))
" "
(display->string (cadr vs))
" "
(display->string (caddr vs))
")")
str)
(⊨ (and (gensym-subscripted? (display->string (car vs)))
(gensym-subscripted? (display->string (cadr vs)))
(gensym-subscripted? (display->string (caddr vs))))))))
((eta 0.0) (memory #(6291456 1960968 1048576)) (stdout "") (stderr ""))
test/variable-equal?: pass
(define (test/variable-equal? _)
(let ((one (V (gensym))) (two (V 'hello)) (three (V 'hello)))
(⊦= #f (equal? one two))
(⊦= #f (equal? one three))
(⊦= #t (equal? two three))))
((eta 0.0) (memory #(6291456 1962136 1048576)) (stdout "") (stderr ""))
test/V-rejects-non-symbols: pass
(define (test/V-rejects-non-symbols _)
(⊦= 'rejected (condition-case (begin (V 42) 'accepted) ((exn) 'rejected)))
(⊦= 'rejected (condition-case (begin (V "g1") 'accepted) ((exn) 'rejected))))
((eta 0.0) (memory #(6291456 1968800 1048576)) (stdout "") (stderr ""))
Categories: scheme
See also
The (aux anthropic) module
The Anthropic Messages API, offline
The (aux cml) module
Events, threads, synchronous variables, the library and I/O
The (aux hakaru10) modules
Random sources, distributions, the language, exact inference and examples
The (aux kanren) modules
Arithmetic, dates, presentation of answers and a union-find miniKanren
The (aux games dice-of-doom) module
Dice of Doom
The (aux machine) modules
Environments, the SC machine and the SECD machine
The (aux schemer seasoned) module
The Seasoned Schemer
The (aux continuation) modules
Classic operators, escapers, amb and Collatz sequences
The (aux category) modules
Monads: list, maybe, probability, ziplist, difference lists and state
The (aux timsort) module
Sorting and the trace buffer
The (aux fds) modules
Functional queues and union-find
The (aux sxml) module
Rendering SXML to HTML
The (aux tabling) module
Memoization and tabled definitions
The (aux commons) module
Learning tests for CHICKEN Scheme
Promises
delay and make-promise
The Ackermann function
On unary numbers, as lists
Concurrent ML for CHICKEN Scheme
Porting SML/NJ CML as the (aux cml) library
CHICKEN Scheme
Versions and implementation notes
The SBRAL data structure
Skew Binary Random-Access Lists
Pattern matching
Scheme macrology: a generalized pattern matcher
The (aux hansei) modules
Inference, random sources, lazy lists, logic programming and example models
The (aux nondeterministic) module
Learning tests for Scheme
The (aux stream) modules
Streams, streams after SICP, and sequences and power series
The (aux unittest) module
Bootstrapping a unittest framework
Scheme lang: Chez, 48 and Chicken
Some docs, refs and containers, respectively.
The Reasoned Schemer
miniKanren, microKanren and some implementations
Aggregation predicates for µkanren
Groups, window functions, sets and enumerations
miniKanren, live and untagged
Quine generation via relational interpreters
Pure, declarative, and constructive arithmetic relations
A declarative pearl
Final shift for call/cc
Direct implementation of shift and reset
Call with Current Continuation Patterns
Cogen in six lines
The Seasoned Schemer
The Little Schemer
Adding generic functions to Scheme
Handling control