Re: Does functional programming work?

2010-01-03 Thread grauzone
Walter Bright wrote: retard wrote: Fri, 01 Jan 2010 12:19:25 -0800, Walter Bright wrote: When I then picked up K+R C, I never wrote another line of Pascal. It so soured me on Pascal that I never got on the later bandwagons of Modula II, Delphi, TurboPascal, etc. Never even looked at them. The

Re: Does functional programming work?

2010-01-03 Thread Walter Bright
retard wrote: Fri, 01 Jan 2010 12:19:25 -0800, Walter Bright wrote: When I then picked up K+R C, I never wrote another line of Pascal. It so soured me on Pascal that I never got on the later bandwagons of Modula II, Delphi, TurboPascal, etc. Never even looked at them. The programming-language-

Re: Does functional programming work?

2010-01-03 Thread Walter Bright
retard wrote: Regarding Smalltalk, its syntax is weird for people that come from C/C++ I claim that currently this is the main reason for people not adopting Smalltalk or any other language. Even if smalltalk was 50% faster than C+ + and 100% safer, there would be legions of morons how still w

Re: Does functional programming work?

2010-01-03 Thread retard
Fri, 01 Jan 2010 12:19:25 -0800, Walter Bright wrote: > Nick Sabalausky wrote: >> "Walter Bright" wrote in message >> news:hhgvqk$8c...@digitalmars.com... >>> An interesting counterpoint to the usual FP hype: >>> >>> http://prog21.dadgum.com/55.html >> >> Didn't read the original article, but th

Re: Does functional programming work?

2010-01-03 Thread retard
Fri, 01 Jan 2010 22:23:03 +, dsimcha wrote: > == Quote from Nick Sabalausky (a...@a.a)'s article >> "Walter Bright" wrote in message >> news:hhgvqk$8c...@digitalmars.com... >> > An interesting counterpoint to the usual FP hype: >> > >> > http://prog21.dadgum.com/55.html >> Didn't read the ori

Re: Does functional programming work?

2010-01-03 Thread retard
Sat, 02 Jan 2010 12:23:36 -0800, Walter Bright wrote: > yigal chripun wrote: >> Have you ever actually used Smalltalk?? I have used it and it's the >> easiest language to use by far, having conditionals as methods of >> Boolean is much better, easier to read and more flexiable. >> >> The beauty o

Re: Does functional programming work?

2010-01-03 Thread retard
Sun, 03 Jan 2010 09:00:53 -0500, bearophile wrote: > yigal chripun: > The Windows95 OS may be worse, but the GUI of XP was much more refined > and usable for non-guru-level users. Things are slowly changing, as > Ubuntu GUI gets a bit better, it eventually will become about as good as > Windows95

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread Steven Schveighoffer
On Sun, 03 Jan 2010 06:53:53 -0500, Trass3r wrote: Am 03.01.2010, 12:33 Uhr, schrieb bearophile : // alternative 1: enum RGBA[] data1 = [{0x00, 0x10, 0x20, 0x30}, {0x40, 0x50, 0x60, 0x70}]; // alternative 2: enum RGBA[] data2 = [RGBA(0x00, 0x10, 0x20, 0x30), RGBA(0x40, 0x50, 0x60, 0x70)

Re: output ranges: by ref or by value?

2010-01-03 Thread Steven Schveighoffer
We are arguing in circles, so I will just stop :) I'll address the one point I think we both feel is most important below On Sun, 03 Jan 2010 17:19:52 -0500, Andrei Alexandrescu wrote: Steven Schveighoffer wrote: On Sun, 03 Jan 2010 09:25:25 -0500, Andrei Alexandrescu wrote: Steven S

Re: Concurrency architecture for D2

2010-01-03 Thread Andrei Alexandrescu
Graham St Jack wrote: On Sun, 27 Dec 2009 14:32:52 -0600, Andrei Alexandrescu wrote: I think we are now in the position of defining a solid set of concurrency primitives for D. This follows many months of mulling over models and options. It would be great to open the participation to the desig

Re: Concurrency architecture for D2

2010-01-03 Thread Graham St Jack
On Sun, 27 Dec 2009 14:32:52 -0600, Andrei Alexandrescu wrote: > I think we are now in the position of defining a solid set of > concurrency primitives for D. This follows many months of mulling over > models and options. > > It would be great to open the participation to the design as broadly as

Re: output ranges: by ref or by value?

2010-01-03 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Sun, 03 Jan 2010 09:25:25 -0500, Andrei Alexandrescu wrote: Steven Schveighoffer wrote: Not having opSlice be part of the interface itself does not preclude it from implementing opSlice, and does not preclude using ranges of it in std.algorithm. If I'm not m

Re: output ranges: by ref or by value?

2010-01-03 Thread Steven Schveighoffer
On Sun, 03 Jan 2010 09:25:25 -0500, Andrei Alexandrescu wrote: Steven Schveighoffer wrote: Not having opSlice be part of the interface itself does not preclude it from implementing opSlice, and does not preclude using ranges of it in std.algorithm. If I'm not mistaken, all functions in

Re: Concurrency mailing list

2010-01-03 Thread Justin C Calvarese
== Quote from Jason House (jason.james.ho...@gmail.com)'s article > Andrei Alexandrescu wrote: > > Brad Roberts graciously accepted to set up the dmd-concurrency mailing > > list on his server. The enrollment is open, please visit > > http://lists.puremagic.com if you are interested in participatin

Re: Concurrency mailing list

2010-01-03 Thread Jason House
Andrei Alexandrescu wrote: > Brad Roberts graciously accepted to set up the dmd-concurrency mailing > list on his server. The enrollment is open, please visit > http://lists.puremagic.com if you are interested in participating. > > Andrei I can't seem to configure my news reader to point to list

Re: restrict in practice

2010-01-03 Thread Don
bearophile wrote: This is a paper by Markus Mock is about the usefulness of the "restrict" annotation in medium-sized C programs: http://www.cs.pitt.edu/~mock/papers/clei2004.pdf The author finds that restrict is not significantly useful in the bulk of programs, while it can be useful in compu

restrict in practice

2010-01-03 Thread bearophile
This is a paper by Markus Mock is about the usefulness of the "restrict" annotation in medium-sized C programs: http://www.cs.pitt.edu/~mock/papers/clei2004.pdf The author finds that restrict is not significantly useful in the bulk of programs, while it can be useful in computational kernels (sm

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread Trass3r
Am 03.01.2010, 14:00 Uhr, schrieb bearophile : Trass3r: Alternative 1: I heard struct literals could be removed. I haven't heard that. They are recently changed a little, but you already know that from another thread. I read somewhere it might conflict with function literals: {...} A

Re: output ranges: by ref or by value?

2010-01-03 Thread Andrei Alexandrescu
Steven Schveighoffer wrote: On Sun, 03 Jan 2010 00:49:08 -0500, Andrei Alexandrescu wrote: Steven Schveighoffer wrote: My theory is, given this list of ranges, if you pair them with an algorithm that requires save capability, you wouldn't want to use that algorithm on it anyways (kinda like

Re: Does functional programming work?

2010-01-03 Thread bearophile
yigal chripun: > Compare to cars - the most popular and successful design is that of the > internal combustion engine yet it's the worst design in technical terms, > there are more effecient and much cleaner designs. Most of those alternative designs have one or more flaws, or used to have in t

Re: output ranges: by ref or by value?

2010-01-03 Thread Steven Schveighoffer
On Sun, 03 Jan 2010 00:49:08 -0500, Andrei Alexandrescu wrote: Steven Schveighoffer wrote: My theory is, given this list of ranges, if you pair them with an algorithm that requires save capability, you wouldn't want to use that algorithm on it anyways (kinda like the consume example). W

Re: output ranges: by ref or by value?

2010-01-03 Thread Michel Fortin
On 2010-01-03 00:51:46 -0500, Andrei Alexandrescu said: First, opening files silently whenever an algorithm feels the need to save its state is just madness. What if the operating system decide to pop a security window when opening a restricted file? What if the file has been deleted or repl

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread bearophile
Trass3r: > Alternative 1: I heard struct literals could be removed. I haven't heard that. They are recently changed a little, but you already know that from another thread. > Alternative 2: > 1) it's cumbersome, especially if you got a huge array But it's clean & readable, and more flexible be

Re: Does functional programming work?

2010-01-03 Thread yigal chripun
Andrei Alexandrescu Wrote: > yigal chripun wrote: > > Walter Bright Wrote: > > > >> yigal chripun wrote: > >>> Have you ever actually used Smalltalk?? I have used it and it's the > >>> easiest language to use by far, having conditionals as methods of > >>> Boolean is much better, easier to read a

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread Trass3r
Am 03.01.2010, 12:33 Uhr, schrieb bearophile : // alternative 1: enum RGBA[] data1 = [{0x00, 0x10, 0x20, 0x30}, {0x40, 0x50, 0x60, 0x70}]; // alternative 2: enum RGBA[] data2 = [RGBA(0x00, 0x10, 0x20, 0x30), RGBA(0x40, 0x50, 0x60, 0x70)]; Alternative 1: I heard struct literals could be r

Concurrency mailing list

2010-01-03 Thread Andrei Alexandrescu
Brad Roberts graciously accepted to set up the dmd-concurrency mailing list on his server. The enrollment is open, please visit http://lists.puremagic.com if you are interested in participating. Andrei

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread Trass3r
Am 03.01.2010, 12:20 Uhr, schrieb bearophile : It's not supposed to work, "dup" allocated memory with malloc, so it's (currently) a run time thing (in future this may change). So how to "create" an array expression at compile-time to enforce reinterpret_cast instead of conversion? //

Re: Does functional programming work?

2010-01-03 Thread Andrei Alexandrescu
yigal chripun wrote: Walter Bright Wrote: yigal chripun wrote: Have you ever actually used Smalltalk?? I have used it and it's the easiest language to use by far, having conditionals as methods of Boolean is much better, easier to read and more flexiable. The beauty of smalltalk is that you c

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread bearophile
Trass3r: > > What's wrong with just (D2 code): > > short[] a3 = [5, 3]; > Nothing, but it's just the stripped down example. I was not answering you, but what Denis Koroskin has written. This thread is getting too much confused. And I think I have already seen a very similar thread elsewhere.

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread bearophile
Trass3r: > > short[] t = cast(short[])[5,3]; > > short[] t2 = cast(short[])[5,3].dup; > > > > Second one still doesn't work at compile-time. It's not supposed to work, "dup" allocated memory with malloc, so it's (currently) a run time thing (in future this may change). Bye, bearophile

Re: Does functional programming work?

2010-01-03 Thread yigal chripun
Walter Bright Wrote: > yigal chripun wrote: > > Have you ever actually used Smalltalk?? I have used it and it's the > > easiest language to use by far, having conditionals as methods of > > Boolean is much better, easier to read and more flexiable. > > > > The beauty of smalltalk is that you can

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread Trass3r
Trass3r schrieb: Any reason for defining the behavior like that? I mean converting an array to an array of structs doesn't make sense as soon as you have multiple struct members cause cast(Foo[])[0,1,2,3,4] gets rewritten as [cast(Foo) 0, cast(Foo) 1, cast(Foo) 2, cast(Foo) 3, cast(Foo) 4]

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread Trass3r
Steven Schveighoffer schrieb: if you cast an array literal, then it reinterprets each element as if each element were cast to that type. otherwise, it's a reinterpret_cast as you say. Any reason for defining the behavior like that? The problem is forcing the compiler to reinterpret_cast at

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread Trass3r
Denis Koroskin schrieb: thus doing at runtime something I'd like to be done at compile-time. I feel so as well.

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread Trass3r
Steven Schveighoffer schrieb: short[] t = cast(short[])[5,3]; short[] t2 = cast(short[])[5,3].dup; Second one still doesn't work at compile-time.

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread Trass3r
bearophile schrieb: What's wrong with just (D2 code): short[] a3 = [5, 3]; Nothing, but it's just the stripped down example. auto t = [0xFF, 0x00]; yields int[] so for struct Foo { ...} auto x = cast(Foo[]) [0x00, 0x01,...]; you need an additional cast(ubyte[]). Yet this doesn't work: h

Re: casting array literals doesn't work as stated in the docs

2010-01-03 Thread bearophile
Denis Koroskin: > "Proper" code should look like this: > short[] t = [cast(short) 5, cast(short)3]; > which is err... I'll let someone else to decide. Just imagine there are > ten (or more) values in an array literal. What's wrong with just (D2 code): short[] a3 = [5, 3]; Bye, bearophile