(2009/12/21 4:43), Andrei Alexandrescu wrote:
> Speaking of isLazy - any fresh ideas on dissing lazy? FWIW we can
> replace it with the conversion of expressions to delegates. The
> resulting situation is liable to a few ambiguities but is much better
> than lazy.
Nobody seemed to mention in the
Hello downs,
Or are there any bugs/optimization opportunities I'm missing?
void qsort(T)(T[] array) {
if (array.length < 2) return;
static int i;
auto pivot = array[i++%$];
// from is base-0, to is base-1.
int from = 0, to = array.length;
while (from != to) {
if (array[from] >= pivot && array[t
Max Samukha Wrote:
> On 19.12.2009 23:00, Walter Bright wrote:
> > Andrei Alexandrescu wrote:
> >> I asked in vain for is(var == ref), is(var == out) etc.
> >
> > That's because 'is' works with types, not symbols. It didn't fit.
>
> Will there be a way to get storage classes from function symbols
4ybaka Wrote:
> Hi!
> I run code like this on linux (Arch and Kubuntu 9.04):
> TcpSocket socket = new TcpSocket(new InternetAddress("www.google.com",
> 80));
> socket.send("GET /intl/en_ALL/images/logo.gif HTTP/1.0\r\n\r\n");
> SocketStream socketStream = new SocketStream(socket
Hi!
I run code like this on linux (Arch and Kubuntu 9.04):
TcpSocket socket = new TcpSocket(new InternetAddress("www.google.com",
80));
socket.send("GET /intl/en_ALL/images/logo.gif HTTP/1.0\r\n\r\n");
SocketStream socketStream = new SocketStream(socket);
num = sock
On 19.12.2009 23:00, Walter Bright wrote:
Andrei Alexandrescu wrote:
I asked in vain for is(var == ref), is(var == out) etc.
That's because 'is' works with types, not symbols. It didn't fit.
Will there be a way to get storage classes from function symbols or types?
Currently, we have to use
Walter Bright wrote:
Chris Nicholson-Sauls wrote:
Walter Bright wrote:
Andrei Alexandrescu wrote:
I asked in vain for is(var == ref), is(var == out) etc.
That's because 'is' works with types, not symbols. It didn't fit.
is(typeof(var) == ref) ?
No, because ref is not part of the type. It
Chris Nicholson-Sauls wrote:
Walter Bright wrote:
Andrei Alexandrescu wrote:
I asked in vain for is(var == ref), is(var == out) etc.
That's because 'is' works with types, not symbols. It didn't fit.
is(typeof(var) == ref) ?
No, because ref is not part of the type. It's a storage class.
Sat, 19 Dec 2009 21:29:45 -0600, Andrei Alexandrescu wrote:
> dsimcha wrote:
>> == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s
>>> "This code is shown for its elegance rather than its efficiency. Using
>>> ++ in this way is not generally considered good programming practice."
Hello Lutger,
Yigal Chripun wrote:
The .Net implementation isn't perfect of course and has a few issues
that should be resolved, one of these is the problem with using
operators. requiring interfaces by itself isn't the problem though.
The only drawback in this case is verbosity which isn't re
Sun, 20 Dec 2009 18:53:56 +0100, Lutger wrote:
> I'm not sure, I don't think so. From what I understand, duck typing is
> supposed to be dynamic, while structural and nominative typing are part
> of a static type system. I meant the non-nominative kind of typing,
> whatever it is.
>
> fwiw, this
Nick Sabalausky wrote:
> "Lutger" wrote in message
> news:hgl440$tl...@digitalmars.com...
>> Yigal Chripun wrote:
>>>
>>> The .Net implementation isn't perfect of course and has a few issues
>>> that should be resolved, one of these is the problem with using
>>> operators. requiring interfaces by
"Lutger" wrote in message
news:hgl440$tl...@digitalmars.com...
> Yigal Chripun wrote:
>>
>> The .Net implementation isn't perfect of course and has a few issues
>> that should be resolved, one of these is the problem with using
>> operators. requiring interfaces by itself isn't the problem though
Sun, 20 Dec 2009 16:44:03 +0100, Don wrote:
> downs wrote:
>> according to
>> http://www.mail-archive.com/haskell-cafe%40haskell.org/msg63381.html
>>
>> I'll let this speak for itself.
>>
>> import Data.Array.Base (unsafeRead, unsafeWrite)
> [snip]
>
> Brilliant.
What is so brilliant? Referent
downs Wrote:
> Or are there any bugs/optimization opportunities I'm missing?
>
> void qsort(T)(T[] array) {
> if (array.length < 2) return;
> static int i;
> auto pivot = array[i++%$];
> // from is base-0, to is base-1.
> int from = 0, to = array.length;
> while (from != to) {
> i
You can try translating this in efficient, readable and short D2 code using
Phobos2 (the purpose is to find spots where Phobos2 may need improvements):
http://rosettacode.org/wiki/Hamming_numbers#Haskell
Haskell version:
hamming = 1 : map (2*) hamming `merge` map (3*) hamming `merge` map (5*) ha
downs wrote:
according to
http://www.mail-archive.com/haskell-cafe%40haskell.org/msg63381.html
I'll let this speak for itself.
import Data.Array.Base (unsafeRead, unsafeWrite)
[snip]
Brilliant.
On Sun, 20 Dec 2009 07:58:06 -0500, Jason House
wrote:
Steven Schveighoffer Wrote:
On Sat, 19 Dec 2009 18:35:13 -0500, Jason House
wrote:
> The meaning of inout by a nested function isn't obvious when the
> enclosing function is already using inout. Does inout of the nested
> function mat
downs wrote:
> Lutger wrote:
>> downs wrote:
>>
>>> Or are there any bugs/optimization opportunities I'm missing?
>>>
>>> void qsort(T)(T[] array) {
>>> if (array.length < 2) return;
>>> static int i;
>>> auto pivot = array[i++%$];
>>> // from is base-0, to is base-1.
>>> int from = 0,
Lutger wrote:
> downs wrote:
>
>> Or are there any bugs/optimization opportunities I'm missing?
>>
>> void qsort(T)(T[] array) {
>> if (array.length < 2) return;
>> static int i;
>> auto pivot = array[i++%$];
>> // from is base-0, to is base-1.
>> int from = 0, to = array.length;
>> wh
Steven Schveighoffer Wrote:
> On Sat, 19 Dec 2009 18:35:13 -0500, Jason House
> wrote:
>
> > The meaning of inout by a nested function isn't obvious when the
> > enclosing function is already using inout. Does inout of the nested
> > function match that of the enclosing function? Or are th
downs wrote:
> Or are there any bugs/optimization opportunities I'm missing?
>
> void qsort(T)(T[] array) {
> if (array.length < 2) return;
> static int i;
> auto pivot = array[i++%$];
> // from is base-0, to is base-1.
> int from = 0, to = array.length;
> while (from != to) {
> i
according to
http://www.mail-archive.com/haskell-cafe%40haskell.org/msg63381.html
I'll let this speak for itself.
import Data.Array.Base (unsafeRead, unsafeWrite)
import Data.Array.ST
import Control.Monad.ST
myqsort :: STUArray s Int Int -> Int -> Int -> ST s ()
myqsort a lo hi
| lo < hi
Or are there any bugs/optimization opportunities I'm missing?
void qsort(T)(T[] array) {
if (array.length < 2) return;
static int i;
auto pivot = array[i++%$];
// from is base-0, to is base-1.
int from = 0, to = array.length;
while (from != to) {
if (array[from] >= pivot && array[t
Yigal Chripun wrote:
> On 19/12/2009 01:31, Lutger wrote:
>> Yigal Chripun wrote:
>>
>>> On 18/12/2009 02:49, Tim Matthews wrote:
In a reddit reply: "The concept of templates in D is exactly the same
as in C++. There are minor technical differences, syntactic
differences, but it is
Walter Bright wrote:
Andrei Alexandrescu wrote:
I asked in vain for is(var == ref), is(var == out) etc.
That's because 'is' works with types, not symbols. It didn't fit.
is(typeof(var) == ref) ?
-- Chris Nicholson-Sauls
26 matches
Mail list logo