From f3d24c7d46e1817d6f7d9aaae268441867e65a96 Mon Sep 17 00:00:00 2001 From: Carl Eastlund Date: Tue, 4 Oct 2005 22:01:03 +0000 Subject: [PATCH] Honu: - doc.txt, documented the sqrt() function - typecheck-expression.ss, line-wrapped to <100 columns - type-utils.ss, changed printout for void type from "<>" to "void" svn: r980 --- collects/honu/doc.txt | 5 +++++ collects/honu/private/typechecker/type-utils.ss | 2 +- collects/honu/private/typechecker/typecheck-expression.ss | 8 +++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/collects/honu/doc.txt b/collects/honu/doc.txt index 81ecba86d2..d6172a94e1 100644 --- a/collects/honu/doc.txt +++ b/collects/honu/doc.txt @@ -95,6 +95,11 @@ String operations: - The zero-based index cannot be negative and must be less than the string length. +Numeric operations: + +> sqrt(float f) => float + - Produces the square root of its argument. + _Operators_ Unary operators: diff --git a/collects/honu/private/typechecker/type-utils.ss b/collects/honu/private/typechecker/type-utils.ss index 43b541c8c4..04c7fe72b5 100644 --- a/collects/honu/private/typechecker/type-utils.ss +++ b/collects/honu/private/typechecker/type-utils.ss @@ -57,7 +57,7 @@ (symbol->string name)] [(struct honu:type-tuple (_ args)) (if (null? args) - "<>" + "void" (string-append "<" (fold (lambda (t i) (string-append i ", " (printable-type t))) diff --git a/collects/honu/private/typechecker/typecheck-expression.ss b/collects/honu/private/typechecker/typecheck-expression.ss index 140c83c8cd..29e35fec03 100644 --- a/collects/honu/private/typechecker/typecheck-expression.ss +++ b/collects/honu/private/typechecker/typecheck-expression.ss @@ -536,9 +536,11 @@ [honu:let-body e1]) t1))] [(struct honu:seq (_ effects value)) - (let-values ([(effects _) (map-two-values (lambda (e) - (typecheck-expression lenv (make-void-type (honu:ast-stx e)) e)) - effects)] + (let-values ([(effects _) + (map-two-values + (lambda (e) + (typecheck-expression lenv (make-void-type (honu:ast-stx e)) e)) + effects)] [(e1 t1) (typecheck-expression lenv ctype value)]) (values (copy-struct honu:seq expr [honu:seq-effects effects]