From 353e8bbc8f3966bbbc609dd06c3e162de1eb38f8 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 14 Mar 2012 18:38:57 -0400 Subject: [PATCH] another workaround for #577 --- jl/string.jl | 1 + src/julia-syntax.scm | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/jl/string.jl b/jl/string.jl index 8a8ccbca5004e..b2d66ee736c9f 100644 --- a/jl/string.jl +++ b/jl/string.jl @@ -23,6 +23,7 @@ print(x...) = for i=x; print(i); end println(args...) = print(args..., '\n') show(s::String) = print_quoted(s) +showln(x) = (show(x); println()) (*)(s::String...) = strcat(s...) (^)(s::String, r::Integer) = repeat(s,r) diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index a276afab0b901..be1b2d2c3d2f3 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -284,17 +284,19 @@ args field-names))) body))) - (pattern-replace - (pattern-set - (pattern-lambda (function (call name . sig) body) - `(function ,(cadr __) ,(ctor-body body))) - (pattern-lambda (= (call name . sig) body) - `(= ,(cadr __) ,(ctor-body body))) - (pattern-lambda (function (call (curly name . p) . sig) body) - `(function ,(cadr __) ,(ctor-body body))) - (pattern-lambda (= (call (curly name . p) . sig) body) - `(= ,(cadr __) ,(ctor-body body)))) - ctor)) + (let ((ctor2 + (pattern-replace + (pattern-set + (pattern-lambda (function (call name . sig) body) + `(function ,(cadr __) ,(ctor-body body))) + (pattern-lambda (= (call name . sig) body) + `(= ,(cadr __) ,(ctor-body body))) + (pattern-lambda (function (call (curly name . p) . sig) body) + `(function ,(cadr __) ,(ctor-body body))) + (pattern-lambda (= (call (curly name . p) . sig) body) + `(= ,(cadr __) ,(ctor-body body)))) + ctor))) + ctor2)) ;; remove line numbers and nested blocks (define (flatten-blocks e)