Skip to content

Instantly share code, notes, and snippets.

View mistivia's full-sized avatar

小葉薜荔 mistivia

View GitHub Profile
from warnings import catch_warnings, filterwarnings # this is always nice to see at the top of a file
class Primitive:
__slots__ = ["args"]
def __init__(self, *args): self.args = args
def __await__(self): return (yield self.args) # also a fun sight to see
async def eof(): return await Primitive("eof")
async def munch(): return await Primitive("munch")
async def choice(*args): return await Primitive("choice", args)
@yuhr
yuhr / macro.ss
Last active March 7, 2024 11:05
macro.ss: Defining macros simply on chez scheme.
#|
macro.ss
Defining macros simply on chez scheme. This code is in the public domain.
|#
(import (scheme))
(define-syntax macro
(syntax-rules ()
((k (name . args) body ...)