bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] How do you handle the contents of POST in a CGI script


From: Kacper Gutowski
Subject: Re: [Bug-apl] How do you handle the contents of POST in a CGI script
Date: Mon, 12 Oct 2015 12:18:15 +0200

On Mon, Oct 12, 2015 at 5:48 AM,  <address@hidden> wrote:
> Why do you choose to write it like this?:
> ContentsOfPOST←{⍵, FIO∆fread 0}⍣{⍺⊢FIO∆feof 0}''
>
> This method (in my limited knowledge) seems equivalent:
> ContentsOfPOST←(FIO∆feof 0) FIO∆fread 0

I don't think it is.
FIO∆fread takes as its left argument a number of bytes to read or
assumes 5000 when called monadically.  FIO∆feof returns either 1
when end-of-file indicator for the stream is set and 0 otherwise.
So (FIO∆feof 0) FIO∆fread 0 would try to read zero bytes when EOF
is not reached or one byte if it is, and in result it should always
return 0 without reading anything.

The idea was to read and catenate default-sized blocks until FIO∆feof
says we hit the end-of-file and ⍣ allows me to write this succinctly
(forgive me if not very readably).

-k



reply via email to

[Prev in Thread] Current Thread [Next in Thread]