[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] [PATCH] use write-string port method in write-string
From: |
Felix |
Subject: |
[Chicken-hackers] [PATCH] use write-string port method in write-string |
Date: |
Tue, 25 Oct 2011 13:07:49 +0200 (CEST) |
The attached patch optimizes "write-string" slightly by using
the appropriate port-class method instead of falling back to
the generic "display".
cheers,
felix
>From 2d2dfeb4463ba445f9707cf2f4e665b06546a2db Mon Sep 17 00:00:00 2001
From: felix <address@hidden>
Date: Tue, 25 Oct 2011 13:06:47 +0200
Subject: [PATCH] use write-string port-class method
---
extras.scm | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/extras.scm b/extras.scm
index c5c9160..c01c0f3 100644
--- a/extras.scm
+++ b/extras.scm
@@ -245,11 +245,11 @@
(let-optionals more ([n #f] [port ##sys#standard-output])
(##sys#check-output-port port #t 'write-string)
(when n (##sys#check-exact n 'write-string))
- (display
+ ((##sys#slot (##sys#slot port 2) 3) ; write-string
+ port
(if (and n (fx< n (##sys#size s)))
(##sys#substring s 0 n)
- s)
- port) ) ) )
+ s)))))
;;; Binary I/O
--
1.6.0.4
- [Chicken-hackers] [PATCH] use write-string port method in write-string,
Felix <=