🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.funkcyjne
Article #451

Re: czemu tu taka cisza?

#451
From: Przemek Wiśniewski
Date: Fri, 10 Oct 2003 10:39
35 lines
1990 bytes
DecatonE wrote:
> Przemek Wiśniewski...
> 
> 
>>paskudny: for (i=0; i<10; ++i) / for i = 0 to 9
>>ciekawszy: for x in [3,4,5,6,7]
> 
> 
> A listę może zwrócić dowolna funkcja, więc wariant ciekawszy jest 
> jednocześnie bardziej elastyczny.
> 
> W Oz:
> {ForAll [3 4 5 6] P}
> 
> ForAll jest chyba wbudowany, ale implementacja i tak byłaby prosta:
> proc {ForAll Xs P}
>    case Xs
>    of nil then skip 
>    [] X|Xr then 
>       {P X}
>       {ForAll Xr P}
>    end 
> end
> 
> adam

Za duzo pisania, w haskellu to bedzie wygladalo jakos podobnie:

iter [] f = return ()
iter (e:es) f = do
	f e
	iter es f

-- 
Przemek Wiśniewski
Technical Details
Message-ID: <12737-1065782463@gw.magellan.net.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!newsfeed.gazeta.pl!news.internetia.pl!not-for-mail
References: <Xns940C7E860B845dupajasio@127.0.0.1> <87he2m8vkq.fsf@hector.domek> <Xns940C891076596dupajasio@127.0.0.1> <s99y8vytfl4.fsf@localhost.localdomain> <Xns940CD6EFCBADzdomu@127.0.0.1> <s99y8vxt6i7.fsf@localhost.localdomain> <87d6d8kisy.fsf@hector.domek> <3045-1065776488@gw.magellan.net.pl> <Xns94107A9EA8791dupajasio@127.0.0.1>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!newsfeed.gazeta.pl!news.internetia.pl!not-for-mail
From: Przemek Wiśniewski <przemekw@becomo.usunto.com>
Newsgroups: pl.comp.lang.funkcyjne
Subject: Re: czemu tu taka cisza?
Date: Fri, 10 Oct 2003 12:39:17 +0200
Organization: Netia Telekom S.A.
Lines: 36
Message-ID: <12737-1065782463@gw.magellan.net.pl>
References: <Xns940C7E860B845dupajasio@127.0.0.1> <87he2m8vkq.fsf@hector.domek> <Xns940C891076596dupajasio@127.0.0.1> <s99y8vytfl4.fsf@localhost.localdomain> <Xns940CD6EFCBADzdomu@127.0.0.1> <s99y8vxt6i7.fsf@localhost.localdomain> <87d6d8kisy.fsf@hector.domek> <3045-1065776488@gw.magellan.net.pl> <Xns94107A9EA8791dupajasio@127.0.0.1>
NNTP-Posting-Host: gw.magellan.net.pl
Mime-Version: 1.0
X-Trace: nefryt.internetia.pl 1065782463 12737 213.17.131.34 (10 Oct 2003 10:41:03 GMT)
X-Complaints-To: abuse@inetia.pl
NNTP-Posting-Date: Fri, 10 Oct 2003 10:41:03 +0000 (UTC)
In-Reply-To: <Xns94107A9EA8791dupajasio@127.0.0.1>
X-Accept-Language: pl
X-Tech-Contact: usenet@internetia.pl
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030930 Debian/1.4-5
X-Server-Info: http://www.internetia.pl/news/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit