Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
To: caml-list@inria.fr
Subject: Re: Language Design
Date: 6 Sep 2000 06:33:45 GMT	[thread overview]
Message-ID: <slrn8rbpa9.qhn.qrczak@qrnik.knm.org.pl> (raw)
In-Reply-To: <39B5DD81.E2500203@maxtal.com.au>

Wed, 06 Sep 2000 17:00:33 +1100, John Max Skaller <skaller@maxtal.com.au> pisze:

> A smarter implementation would be lazy, and buffer all data which
> was actually read, until it could no longer be accessed.

Assuming that primitive tape reading lives in the IO monad,
implementation of this reading would have to rely on unofficial
constructs that allow escaping from IO, or at least delaying
an IO action until a value is evaluated.

The function would no longer be pure, even though its type says so.
Examining its result causes a side effect of reading the tape further.
This light effect may nevertheless matter.

This is the case of Haskell's reading of whole files, which is lazy and
unimplementable using official single-character IO primitives. It has
its problems, recently discussed: what if I later write to that file
back? The meaning may depend on how much of the input was evaluated.
Implementations should probably detect this case and read the remaining
input immediately...

Providing input from I/O as a lazy list is very convenient but
unfortunately tricky.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



  parent reply	other threads:[~2000-09-06 19:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-01 11:57 Dave Berry
2000-09-01 17:48 ` Markus Mottl
2000-09-01 19:12 ` Marcin 'Qrczak' Kowalczyk
     [not found]   ` <39B5DD81.E2500203@maxtal.com.au>
2000-09-06  6:33     ` Marcin 'Qrczak' Kowalczyk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-08-21 21:44 David McClain
2000-08-23  5:55 ` John Max Skaller
2000-08-24  9:12   ` Francois Pottier
2000-08-24 20:16     ` John Max Skaller
2000-08-25  9:52       ` Andreas Rossberg
2000-08-27 22:00         ` John Max Skaller
2000-08-28 23:11           ` Daan Leijen
2000-08-25 15:41       ` Jerome Vouillon
2000-08-27 22:21         ` John Max Skaller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slrn8rbpa9.qhn.qrczak@qrnik.knm.org.pl \
    --to=qrczak@knm.org.pl \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox