This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket/base | |
(require racket/place racket/list racket/match) | |
(define (run-in-place) | |
(place ch | |
(define base-ns | |
(let () | |
(define ns (make-base-empty-namespace)) | |
(parameterize ([current-namespace ns]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hey everyone! | |
After yesterday's hangout someone pointed out that a participant's | |
background contained something not-safe for work, and which might make | |
others feel uncomfortable or unwelcome. I didn't notice this during | |
the hangout, or I would have said something. | |
I have make the video private, and will ask folks to please make sure | |
that their backgrounds, along with the rest of their conduct, is | |
welcoming to everyone. I have spoken with the person, who was very |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; run 1 terminates, run 2 diverges | |
(run 1 (q) | |
(evalo | |
`((lambda (append) | |
((append (quote ,q)) (quote (d e)))) | |
(lambda (l) | |
(lambda (s) | |
(fold (lambda (w) (lambda (v) (cons w v))) s l)))) | |
'(a b c d e))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(test "type-conflicto-1" | |
(run* (t1 t2 b) | |
(== t1 t2) | |
(type-conflicto t1 t2 b)) | |
'((_.0 _.0 #f) | |
(_.0 _.0 #f) | |
(_.0 _.0 #f))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; relational scheme interpreter | |
(define lookupo | |
(lambda (x env out) | |
(fresh (y val env^) | |
(== `((,y . ,val) . ,env^) env) | |
(symbolo x) | |
(symbolo y) | |
(conde | |
((== x y) (== val out)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; relational scheme interpreter | |
;; (currently without absento) | |
(define lookupo | |
(lambda (x env out) | |
(fresh (y val env^) | |
(== `((,y . ,val) . ,env^) env) | |
(symbolo x) | |
(symbolo y) | |
(conde |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; relational scheme interpreter | |
;; (currently without absento) | |
(define lookupo | |
(lambda (x env out) | |
(fresh (y val env^) | |
(== `((,y . ,val) . ,env^) env) | |
(symbolo x) | |
(symbolo y) | |
(conde |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function quote_desugar(exp) { | |
if (pairp(exp)) { | |
return list(intern("cons"), quote_desugar(exp.car), quote_desugar(exp.cdr)); | |
} else if (exp == null) { | |
return list(intern("quote"), null); | |
}else if(constantp(exp)) { | |
return exp; | |
} else { | |
return list(intern("quote"), exp); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns monstero.core) | |
;; Basically this is a change calculator that returns all possible combinations of change for a given | |
;; total. Instead of being about money its about monsters for tabletop RPGs. | |
(require '[clojure.core.logic :as l] | |
'[clojure.core.logic.fd :as fd]) | |
;; Andrew's definition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
(require "miniKanren/mk.rkt") | |
; changed name of goal to be more descriptive | |
(define (key-not-boundo key env) | |
(conde | |
[(== '() env)] ; swapped conde clauses to make the non-recursive | |
; clause come first; not necessary, but could | |
; improve efficiency | |
[(fresh (k v rest) |