... Nice explanation. I think it would have been easier to follow if you would have used sequential addresses 0, 1, 2, 3, ... or maybe a_0, a_1, a_2, ... ....
Hello, after I have learned to write tail-rec code I have forgotten how to write these direct style, somtimes called "silly style" or "stupid style", or "naive...
Oliver Bandel
oliver@...
Oct 1, 2005 10:37 am
4643
... I doubt it is. It explains what is going on internally with memory allocation and so on. But it does not explain why it is allowed to do such definitions...
Oliver Bandel
oliver@...
Oct 1, 2005 1:47 pm
4644
... [...] Which style best using for automatically closing e.g. filedescriptors after read was completed? Using closures, CPS, Monads, .... ? Isn't CPS-style...
Oliver Bandel
oliver@...
Oct 1, 2005 1:48 pm
4645
... let rec suf = function [] -> [] | h :: t -> (h :: t) :: (suf t);; __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 ...
Hi everybody, this is my first post and I'm a VERY beginner of ml programming :-) So, let's start: # function x -> function y->x y;; - : ('a -> 'b) -> 'a ->...
... Well, did you try to put parenthesis to see what realy happen? The code you give us is equivalent to fun x -> fun y -> (x y) and (x y) mean that y is given...
... (x y) mean x is a function with y as argument???? ... mmm... my mind was born with imperative languages, so I think that something like this: fun x...
... The application of the function f to 10 is wrote f 10 so the application of the function x to y is wrote x y then you can put parenthesis around this. ... ...
. . . ... Interesting. I hacked around more than I expected, too :-). Here's what I came up with: # let suffixes list = let rec suffixes_aux li = match li...
... ooops: ============================================================= suf = function [] -> [] | h :: t -> (h :: t) :: (suf t);; val suf : 'a list -> 'a list...
Oliver Bandel
oliver@...
Oct 1, 2005 5:49 pm
4652
On Sat, Oct 01, 2005 at 01:23:42PM +0200, Oliver Bandel wrote: [...] ... Ciao, Oliver...
Oliver Bandel
oliver@...
Oct 1, 2005 5:49 pm
4653
... [...] thanks. Oliver...
Oliver Bandel
oliver@...
Oct 1, 2005 5:50 pm
4654
. . . ... Almost, I think. To get [] at the end, tails have to be accumulated: let rec suf = function [] -> [] | h :: t -> t :: (suf t) But then we need the...
... I'm not sure why would you want that empty list: it caries no information since it will always be there. let rec suf = function [] -> [[]] | h :: t -> (h...
Hello, look at this example with lesser types... ...it was what I first thought could be a possible problem, and it seems it is one: ...
Oliver Bandel
oliver@...
Oct 2, 2005 10:30 am
4657
... These aren't syntatic constructs, they are semantic ones. And, IMO, using the idea of 'locations' in semantics is perfectly valid. For OCaml it is even...
... I am not certain what the difference is between closures and CPS. CPS, in OCaml, is implemented using closures. I'll also note that CPS can be considered a...
... Because this is, what the execise is looking for a s a result. (Okasaki-Book). ... Yes, now it's correct. ;-) Ciao, Oliver...
Oliver Bandel
oliver@...
Oct 2, 2005 8:40 pm
4660
. . . No, the behavior is /very/ well defined. Just not terribly useful. I gotta put my $.02 in here (I think there was a brief mention of cyclic lists in this...
... Well, I stand gladly corrected. ... These shouldn't be terribly hard to rewrite this way... it's a bit of a strange way of thinking about them, but it's...
. . . ... Well, I'm glad to hear it :-) . . . ... It depends on what you get used to, I guess. Common Lisp supports variable-arity functions, so mapping a...
... No, they're not: let rec fold_left2' f init alist blist = match alist, blist with ... ;; let rec fold_right2' f alist blist init = (* NOT tail recursive *)...
... This works: # let rec suf = function | [] -> [ [] ] | (_ :: t) as e -> e :: (suf t);; val suf : 'a list -> 'a list list = <fun> # suf [1;2;3;4];; - : int...
Shalom, Oliver. OB> I doubt it is. OB> It explains what is going on internally with memory allocation and so on. OB> But it does not explain why it is allowed...
... Well we can assure you that OCaml certainly does support native TCP/IP sockets through the Unix module in the standard library. Could somebody introduce a...
Ok, it looks like we always have more than 2 choices ;) Thanks you Richard for so sufficient response. At this point we can go ahead. The issue is resolved....
... Exactly, yes. You can write in conventional mathematical notation like this: # let f(x) = x+1;; val f : int -> int = <fun> # f(3);; - : int = 4 But the...
thanks for all the help you give me! now i'm starting to understand and ca say fun x -> fun y ->(x y);; - : ('a -> 'b) -> 'a -> 'b = <fun> I can say first...