🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Przepe³nienie stosu w Ocamlu.

#30
From: Tomek Czajka
Date: Fri, 06 Dec 2002 20:22
19 lines
1212 bytes
> let rec f a =
>   if a == 1 then
>     1
>   else
>     1 + f (a - 1)
> in
>   f 100000

Jak programowac funkcyjnie, to tylko leniwie! W jezyku leniwym odpowiednikiem

takiego for-a jest fold. Dodawanie w kolko jedynki zapiszemy jakos tak:

( "\" to lambda)
fold ( \a \i a+1) 0 [1..100000]

W jezyku funkcyjnym leniwym bedzie to sie odbywalo w pamieci stalej.

Pozdrawiam,
Tomek
Technical Details
Message-ID: <3DF10715.9A91D4D8@mimuw.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!mimuw.edu.pl!news.mimuw.edu.pl!not-for-mail
References: <asg3hf$25q$1@kenny.mimuw.edu.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!mimuw.edu.pl!news.mimuw.edu.pl!not-for-mail
From: Tomek Czajka <tczajka@mimuw.edu.pl>
Newsgroups: pl.comp.lang.funkcyjne
Subject: Re: Przepe³nienie stosu w Ocamlu.
Date: Fri, 06 Dec 2002 21:22:45 +0100
Organization: MIMUW
Lines: 21
Message-ID: <3DF10715.9A91D4D8@mimuw.edu.pl>
References: <asg3hf$25q$1@kenny.mimuw.edu.pl>
NNTP-Posting-Host: ds146.ds2.uw.edu.pl
Mime-Version: 1.0
X-Trace: kenny.mimuw.edu.pl 1039206228 8375 193.0.110.32 (6 Dec 2002 20:23:48 GMT)
X-Complaints-To: abuse@news.mimuw.edu.pl
NNTP-Posting-Date: Fri, 6 Dec 2002 20:23:48 +0000 (UTC)
X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.19 i586)
X-Accept-Language: en
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit