CommonLisp Scheme Part10at TECH
CommonLisp Scheme Part10 - 暇つぶし2ch206:デフォルトの名無しさん
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 の対応一覧が役に立つかも。


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch