Skip to content

Instantly share code, notes, and snippets.


Lulu Cathrinus Grimalkin erkin

View GitHub Profile
aphyr /
Created October 12, 2020 22:10
Minikanren in Lisp in Prolog
:- use_module(library(pairs)).
:- use_module(library(reif)).
not_in_list(K, L) :-
if_((L = []),
([X | More] = L,
dif(K, X),
not_in_list(K, More))).
jackfirth /
Last active March 31, 2022 23:05
Examples of how to build control flow structures with continuations

Lessons in Using Continuations

This gist contains examples of how to build different kinds of control flow structures in Racket using macros and continuations. Examples include:

  • Early exit from functions using a return statement.
  • Early exit from arbitrary expressions using a simple exception system.
  • Temporarily interrupting execution in order to check permissions.
lwhjp / factorial.rkt
Created October 19, 2014 08:18
Factorials in Racket
View factorial.rkt
#lang racket
;; These are some examples of different ways to compute factorials
;; using various paradigms and features provided by Racket. There
;; are more options available in packages which are not imported
;; by default, but that rabbit hole goes very deep indeed.
;; Comments and suggestions welcome!