From: Amit D. <ami...@gm...> - 2005-11-24 15:57:30
|
William writes: ---------- Forwarded message ---------- From: William Neumann <wne...@cs...> Date: Nov 24, 2005 2:58 PM Subject: Re: [Ocaml-lib-devel] ExtArray? To: Amit Dubey <ami...@gm...> On Nov 24, 2005, at 7:16 AM, Amit Dubey wrote: > Array.find > > Will this return the element or an index? If I were writing it (and I'm sure I have at some point) I'd have Array.find return the element, but I'd also have an Array.findi that returned the element and it's index (and just define Array.find as snd (Array.findi ...) ). > Array.filter > Array.find_all > Array.partition > > Would these return lists or arrays? I'd have them return arrays, myself. Less efficient, perhaps, but certainly more consistent. And if I wanted lists back, I'd just use List.XXX (Array.to_list arr). William D. Neumann "I eat T-bone steaks, I lift barbell plates, I'm sweeter than a German chocolate cake. I'm the reflection of perfection, the number one selection. I'm the man of the hour, the man with the power, too sweet to be sour. The ladies' pet, the men's regret, where what you see is what you get, and what you don't see, is better yet." --Superstar Billy Graham |