From 2f2e1e6a035415881b9a40705b2dcbcfbc4984b6 Mon Sep 17 00:00:00 2001 From: Jon Rafkind Date: Tue, 9 Aug 2011 16:09:30 -0600 Subject: [PATCH] [honu] add :: as the infix cons operator --- collects/honu/core/main.rkt | 1 + collects/honu/core/private/honu2.rkt | 1 + collects/honu/core/read.rkt | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/collects/honu/core/main.rkt b/collects/honu/core/main.rkt index 00336ca1ac..46924cbc4e 100644 --- a/collects/honu/core/main.rkt +++ b/collects/honu/core/main.rkt @@ -17,6 +17,7 @@ [honu-+ +] [honu-- -] [honu-* *] [honu-/ /] [honu-^ ^] + [honu-cons ::] [honu-and and] [honu-or or] [literal:honu-= =] diff --git a/collects/honu/core/private/honu2.rkt b/collects/honu/core/private/honu2.rkt index ac15ba3eed..b56b855bda 100644 --- a/collects/honu/core/private/honu2.rkt +++ b/collects/honu/core/private/honu2.rkt @@ -91,3 +91,4 @@ (define-binary-operator honu-^ 2 expt) (define-binary-operator honu-and 0.5 and) (define-binary-operator honu-or 0.5 or) +(define-binary-operator honu-cons 0.1 cons) diff --git a/collects/honu/core/read.rkt b/collects/honu/core/read.rkt index 298e558fc1..e1c7365b83 100644 --- a/collects/honu/core/read.rkt +++ b/collects/honu/core/read.rkt @@ -23,7 +23,8 @@ (define-lex-abbrev digit (:/ #\0 #\9)) (define-lex-abbrev identifier-first-character (:or (:/ #\a #\z) - (:/ #\A #\Z))) + (:/ #\A #\Z) + ":")) (define-lex-abbrev identifier-character (:or identifier-first-character digit)) (define-lex-abbrev identifier (:: identifier-first-character