Billy Brown

Posts

Scheme Pattern Matching with @-binding

A simple implementation of basic pattern matching in Scheme, with @-bindings.

In my first post about pattern matching with Scheme, I mentioned that the main feature that I thought was missing was the ability to bind a pattern to an identifier, while still matching on the internals of that pattern.

Haskell has a way of doing it with an @ character, which might look this: func (Just x@[_]) = x. In this post I show how I added that functionality to my pattern matching code. Read More

Scheme Pattern Matching

A simple implementation of basic pattern matching in Scheme.

While writing an interpreter in Scheme that executes an Abstract Syntax Tree (AST), I sorely missed Haskell's pattern matching, which makes picking the code to run based on a node very simple.

Here follows the motivation for, explanation of and implementation of some simple Scheme code for basic pattern matching. Read More