From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA17521; Tue, 20 Jan 2004 13:31:09 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA17908 for ; Tue, 20 Jan 2004 13:31:07 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from eposta.kablonet.com.tr ([62.248.102.66]) by concorde.inria.fr (8.11.1/8.11.1) with SMTP id i0KCV4P09358 for ; Tue, 20 Jan 2004 13:31:06 +0100 (MET) Received: (qmail 26959 invoked by uid 0); 20 Jan 2004 12:37:49 -0000 Received: from unknown (HELO 195.174.173.82) (exa@kablonet.com.tr@195.174.173.82) by 0 with SMTP; 20 Jan 2004 12:37:49 -0000 From: Eray Ozkural Reply-To: erayo@cs.bilkent.edu.tr Organization: Bilkent University CS Dept. To: Ocaml Mailing List Subject: Re: [Caml-list] ANNOUNCE: mod_caml 1.0.6 - includes security patch Date: Tue, 20 Jan 2004 14:30:35 +0200 User-Agent: KMail/1.5.94 References: <20040116093454.GA23909@redhat.com> <200401192345.10735.exa@kablonet.com.tr> <20040120113108.GB13600@fichte.ai.univie.ac.at> In-Reply-To: <20040120113108.GB13600@fichte.ai.univie.ac.at> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200401201430.35033.exa@kablonet.com.tr> X-Loop: caml-list@inria.fr X-Spam: no; 0.00; eray:01 ozkural:01 caml-list:01 2004:99 scopes:01 semantically:01 foldl:01 fromintegral:01 fromintegral:01 eray:01 ozkural:01 erayo:01 bilkent:01 bilkent:01 ankara:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tuesday 20 January 2004 13:31, Markus Mottl wrote: > "where" is one keyword, which I might find useful. Code can be made much > more readable if function applications come first and values used in it > are defined further below. Otherwise, the user may have to scan large > portions of value definitions before getting to the "core" of a function. Absolutely! It looks much better than 5 nested let scopes (although they are semantically identical). Where was this inefficient DFT function I had written. Ah, here it is: dft :: (RealFloat a) => (SampleVector (Complex a)) -> Int -> (SampleVector (Complex a)) dft x n = listArray (0, (n-1)) [transform f | f <- [0..(n-1)]] where transform f = scale * (foldl1 (+) [freqcomp f k | k <- [0..(n-1)]]) freqcomp f k = (x!k) * (exp_polar (-(2 * (fromIntegral k) * pi * (fromIntegral f) ) / (fromIntegral n)) ) scale = 1/(fromIntegral n) I find use of where keyword much more readable in many places. Cheers, -- Eray Ozkural (exa) Comp. Sci. Dept., Bilkent University, Ankara KDE Project: http://www.kde.org www: http://www.cs.bilkent.edu.tr/~erayo Malfunction: http://mp3.com/ariza GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners