scsh-users
[Top] [All Lists]

Re: eyes-saver in scsh

To: scsh@zurich.csail.mit.edu
Subject: Re: eyes-saver in scsh
From: stktrc <stktrc@yahoo.com>
Date: 05 Nov 2003 01:30:24 +0100
Sender: news <news@sea.gmane.org>
Random assorted comments follow.

ZHAO Wei <zhaoway@public1.ptt.js.cn> writes:

> (define (make-locker val)
>    (list (make-lock) val))

If you simply want to create a structure that associates two values, a
pair would suffice: (cons (make-lock) val)

> (define (iconv str)
>    (let ((ret (run/string (| (begin (display-line str))
>                           (iconv -f gb2312 -t utf8)))))

Input to a process can be directed from the printed representation of
a Scheme object, such as a string, allowing the following
simplification (omitting the newline):

(run/string (iconv -f gb2312 -t utf8) (<< 0 ,str))

>      (substring ret 0 (- (string-length ret) 1))))

Using string-drop-right from list-lib (SRFI-13), the equivalent can be
expressed a little simpler:

(string-drop-right ret 1)


<Prev in Thread] Current Thread [Next in Thread>