|
Re: ANNOUNCE ex11 release two: msg#00280lang.erlang.general
Joe Armstrong <joe@xxxxxxx> wrote: > To answer this you need to understand what a fun really is: Excellent explanation of a fun, and is more or less what I knew of how funs work. I think what I was going for was more to make it easier for the developer to write the messages... > The point to note is that code like > > B ! {onClick, fun(X) -> S ! {wrapper, X} end} > and > B ! {onClick, {S, Wrapper}} The first line is much longer to write than the second. So I think my comment was largely written because I found the second form to be shorter to type. > This isn't really true, sending a fun in a message *is* just sending > a tagged message and because of the way this message is represented > internally it might even use less space and be more efficient. This I didn't realize, and now that you make the point, I can see how a fun might in fact take up less space than a tuple. Saving a few bytes or a few machine instructions to make it 'faster' is really not all that important, as the X server alone must be chewing up a good amount of resources, let alone the ex11 code. I think I just threw that in as another excuse for why I suggested the second form above. What a waste of bytes this message is. But we're not counting bytes are we? :-) -- Shawn. Calm down, it's *____only* ones and zeroes. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: How do I find my own IP address?: 00280, Shawn Pearce |
|---|---|
| Next by Date: | Re: anti-spam measures: 00280, Joachim Durchholz |
| Previous by Thread: | Re: ANNOUNCE ex11 release twoi: 00280, Joe Armstrong |
| Next by Thread: | Stripped down Erlang?: 00280, Joe Armstrong |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |