04/02/26 00:12
>>201
$| = 1 と $! の例を強引に考えてみた(dup は不明)。詳しい人のフォロー希望。
(with-error-handler
(lambda (e) ;; e は例外オブジェクト($! のようなもの)
(format (current-error-port) "ERROR: ~a¥n" (ref e 'message)))
(lambda ()
;;(with-input-from-file *program-name* ;; 正常パターン
(with-input-from-file "nowhere file" ;; エラーパターン
(lambda ()
(set! (port-buffering (current-output-port)) :full) ;; $| = 1 ?
(port-for-each
(lambda (line)
(display line)
(newline))
read-line)))))
C がわかるなら、リファレンスの C と Scheme の対応一覧が役に立つかも。