add != to honu. start making some tests

svn: r13372
This commit is contained in:
Jon Rafkind 2009-02-03 01:47:33 +00:00
parent e092884415
commit 6ebd445726
3 changed files with 23 additions and 2 deletions

View File

@ -1396,6 +1396,10 @@
(syntax-case stx ()
[(_ a b) #'(and a b)]))
(define-syntax (!= stx)
(syntax-case stx ()
[(_ a b) #'(not (equal? a b))]))
(define-syntax (\|\| stx)
(syntax-case stx ()
[(_ a b) #'(or a b)]))
@ -2064,7 +2068,7 @@
(rename honu-class class)
(rename honu+ +) (rename honu- -) (rename honu* *)
/ (rename modulo %)
< > <= >= (rename equal? ==)
< > <= >= (rename equal? ==) !=
&& \|\|
(rename string->number stringToNumber)
(rename number->string numberToString)

View File

@ -0,0 +1,17 @@
#lang honu
obj test(t, a, b){
if (a != b){
display(t);
display(" failed!");
newline();
display("Got ");
display(a);
display(". Expected ");
display(b);
newline();
}
}
var x = 3;
test("x = 3", x, 4);

View File

@ -1,4 +1,4 @@
#honu
#lang honu
/*
<a>a f(a x, a b) { return (obj)x; }