Skip to content

Instantly share code, notes, and snippets.

@chansey97
chansey97 / uniq.rkt
Created October 9, 2021 19:15 — forked from soegaard/uniq.rkt
Uniq for Racket lists
#lang racket/base
(provide uniq)
;;;
;;; Uniq
;;;
; The function uniq takes a list as input and returns a new list:
; adjacent elements are compared and omits any repeated elements.
; In other words, uniq works like the Unix utility uniq, but on list.
@chansey97
chansey97 / introrx.md
Created October 9, 2021 19:23 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@chansey97
chansey97 / gist:86b9d854336f34d371543e3519009162
Created May 2, 2022 14:32 — forked from osallou/gist:7988178
Sample C foreign interface for SWI-Prolog called with my_function('6',N) loaded with :-use_foreign_library(foreign('test.so')). compile: swipl-ld -shared -o test test.c
#include <SWI-Prolog.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct context /* define a context structure */
{
int max;
} context;
foreign_t
@chansey97
chansey97 / compile.ss
Created June 27, 2022 02:13 — forked from swatson555/compile.ss
nanopass compiler for r0 language
#!/usr/bin/env scheme --script
(import (nanopass))
(define unique-var
(let ()
(define count 0)
(lambda (name)
(let ([c count])
(set! count (+ count 1))