"A Conversation with Steve Jenson, Alex Payne, and Robey Pointer" by Bill
Venners, April 3, 2009, about the Scala language:
http://www.artima.com/scalazine/articles/twitter_on_scala.html
Scala is one of the few modern languages (like C#, F#, Clojure) that deserve to
be followed by D designers.
of course my example makes no sense
try
pure float square(float x, invariant roundingMode round = default)
{
return x*x;
}
in case that helps
Phil
Walter Bright wrote:
Don wrote:
That's true, but if you're in a floatingpoint module, and you call a
non-floatingpoint module, it's your responsibility to make sure that
the rounding mode is back to normal. You're saying that you don't care
about the status flags. So it's your own fault if you
Andrei Alexandrescu Wrote:
> > I grant that it would be quicker and clearer to write:
> > interface Foo
> > {
> >static void stuff();
> >this (int);
> > }
> > template Template(Arg : Foo) {}
> >
> > than to write:
> > template Template(Arg) if (is (typeof (new Arg(0)) &&
> > isStaticFunc
Walter Bright wrote:
Georg Wrede wrote:
OTOH, to make things really happen, we need the other kind of guys.
Those of us who want to understand. They're the ones who advance the
state of the art, and without that, we'd still be traveling on steam
trains. I just wish there were more schools and
Kagamin Wrote:
> 1. If template constraints suck, why not fixing *them*?
There were so many proposals...
For example my :) compile time reflection api will be much more flexible and
readable than any declarational syntax and with it you can throw away that
declarational burden from parser.
TomD Wrote:
> After a couple of miniutes googling around this seems
> to be a bug in ld. Some aritlcles from 2007 or so
> recommend to downgrade to binutils 2.15 from 2.16.
> *If* your installed binutils is 2.16, you may give it a try.
>
> Ciao
> Tom
After a bit harder googling I found
http://
On Sat, 04 Apr 2009 16:49:23 +0400, Kagamin wrote:
Andrei Alexandrescu Wrote:
> I grant that it would be quicker and clearer to write:
> interface Foo
> {
>static void stuff();
>this (int);
> }
> template Template(Arg : Foo) {}
>
> than to write:
> template Template(Arg) if (is (typeo
Kagamin wrote:
Andrei Alexandrescu Wrote:
I grant that it would be quicker and clearer to write:
interface Foo
{
static void stuff();
this (int);
}
template Template(Arg : Foo) {}
than to write:
template Template(Arg) if (is (typeof (new Arg(0)) &&
isStaticFunction!(Arg, "stuff")) {}
Ya
Walter Bright wrote:
dsimcha wrote:
== Quote from Walter Bright ([email protected])'s article
Nick Sabalausky wrote:
If there's one thing my
school experience taught me, it's that teachers are only interested in
focusing on the low-to-mid-range students.
That wasn't my college experi
Walter Bright wrote:
Nick Sabalausky wrote:
Well, when it comes to college, what you're paying for are the classes
and the degree (and, of course, books/room/board). So I'm certainly
going to measure it's worth with that in mind. Having a dinner with
Carl Segan, as great as he was, is hardly w
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Fawzi Mohamed wrote:
> On 2009-04-02 21:18:55 +0200, Sean Kelly said:
>
>> == Quote from Georg Wrede ([email protected])'s article
>>> Fawzi Mohamed wrote:
The tracing of tango svn version (that uses libc backtrace) seems to
work rath
Sean Kelly wrote:
Walter Bright wrote:
Multiple choice exams were against the rules at Caltech (even though
we did have a few huge lecture-based classes).
I'll still hold forth, however, that you're going to get out of it
what you are willing to put into it. If you're only going to target
Andrei Alexandrescu Wrote:
> > 1. If template constraints suck, why not fixing *them*?
>
> That's a fix.
This is a fix to interfaces, not to template constraints. If template
constraints fail to serve their purpose, what are they for? Make them work, not
others to work for them.
On Sat, 04 Apr 2009 01:13:09 +0400, Andrei Alexandrescu
wrote:
Christopher Wright wrote:
Andrei has put up a few enhancement requests in the bugzilla:
http://d.puremagic.com/issues/show_bug.cgi?id=2784
http://d.puremagic.com/issues/show_bug.cgi?id=2785
http://d.puremagic.com/issues/show_bug.c
Denis Koroskin Wrote:
> interface Foo
> {
> this(int i);
> typedef Bar;
> }
>
> Foo foo = new Foo(42); // huh?
> Foo.Bar x; //what's x.typeof?
I think, template will accept type T:Foo that satisfies concept Foo and
T foo=new T(42);
T.Bar x;
grauzone wrote:
But my point was that variadic templates can be ideal wrappers for the
non-templated variadics, which can be virtual. It's the best of both
worlds, you get no bloating and comfortable calling syntax too.
The problem is: you can't go back. Here I use runtime as synonym for
pass
Very funny.
On Sat, 04 Apr 2009 15:19:46 +0400, Philip Miess wrote:
of course my example makes no sense
try
pure float square(float x, invariant roundingMode round = default)
{
return x*x;
}
in case that helps
Phil
I don't see roundingMode used anywhere in your example.
Andrei Alexandrescu wrote:
void foo_templated(T...)(T args)
{
Variant[args.length] dynatyped;
foreach (i, arg; args) dynatyped[i] = arg;
return foo(dynatyped);
}
void foo(Variant[] dynatyped...)
{
...
}
Hmm. An idiom. My sweet tooth just got thirsty for syntactic sugar!
Andrei Alexandrescu wrote:
Christopher Wright wrote:
Andrei Alexandrescu wrote:
Jarrett Billingsley wrote:
On Fri, Apr 3, 2009 at 11:20 AM, Andrei Alexandrescu
wrote:
You can't. D's varargs suck.
Of course you can. Where did that come from?
void foo(T...)(T args) { bar(args); }
void bar(
bearophile wrote:
davidl:
Something like following can substitute dynamic array:
struct da(T){
T* ptr;
int len, capacity;
T opIndex(int i){}
...
On 32 bit systems that struct is 3*4 bytes long, but the current GC allocates small sizes
using blocks of memory long as powers of 2,
In February I proposed a few ideas to make the virtual call ABI
non-fragile. In the last two months I've built a small benchmark
program to check the actual performance impact it'd have. Now I have
the results. Unfortunatly, I can't pretend they're very reliable, but I
want to share them. Here'
2784: interface Foo { typedef Bar; }
- confused me for a while, so a clearer description might be nice
-- i.e. clarify that something like 'new I.bar()' is invalid.
- seems only to be useful as part of the other contract-like interface
enhancements
-- Like 2786 & 2785 below, this creates a diffe
Kagamin wrote:
Andrei Alexandrescu Wrote:
1. If template constraints suck, why not fixing *them*?
That's a fix.
This is a fix to interfaces, not to template constraints. If template
constraints fail to serve their purpose, what are they for? Make them work, not
others to work for them.
T
Andrei Alexandrescu wrote:
void foo_templated(T...)(T args)
{
Variant[args.length] dynatyped;
foreach (i, arg; args) dynatyped[i] = arg;
return foo(dynatyped);
}
void foo(Variant[] dynatyped...)
{
...
}
Andrei
Okay, that's a reasonable solution, except that it doesn't work with
in
Denis Koroskin wrote:
I'm not sure I understand everything you intend so lets clear things a
little.
I agree there should be a way to enforce struct to implement some..
contract.
But I believe you took a wrong way by using pseudo-interface inheritance.
First of all, it's called Concept in C+
Georg Wrede wrote:
Andrei Alexandrescu wrote:
void foo_templated(T...)(T args)
{
Variant[args.length] dynatyped;
foreach (i, arg; args) dynatyped[i] = arg;
return foo(dynatyped);
}
void foo(Variant[] dynatyped...)
{
...
}
Hmm. An idiom. My sweet tooth just got thirsty for syntacti
Christopher Wright wrote:
Andrei Alexandrescu wrote:
void foo_templated(T...)(T args)
{
Variant[args.length] dynatyped;
foreach (i, arg; args) dynatyped[i] = arg;
return foo(dynatyped);
}
void foo(Variant[] dynatyped...)
{
...
}
Andrei
Okay, that's a reasonable solution, except th
Andrei Alexandrescu wrote:
Georg Wrede wrote:
Andrei Alexandrescu wrote:
void foo_templated(T...)(T args)
{
Variant[args.length] dynatyped;
foreach (i, arg; args) dynatyped[i] = arg;
return foo(dynatyped);
}
void foo(Variant[] dynatyped...)
{
...
}
Hmm. An idiom. My sweet tooth j
Philip Miess wrote:
Walter Bright wrote:
Don wrote:
That's true, but if you're in a floatingpoint module, and you call a
non-floatingpoint module, it's your responsibility to make sure that
the rounding mode is back to normal. You're saying that you don't
care about the status flags. So it's
Walter Bright wrote:
Nick Sabalausky wrote:
Well, when it comes to college, what you're paying for are the classes
and the degree (and, of course, books/room/board). So I'm certainly
going to measure it's worth with that in mind. Having a dinner with
Carl Segan, as great as he was, is hardly w
Jarrett Billingsley Wrote:
> On Fri, Apr 3, 2009 at 6:09 PM, eljay wrote:
> > Hi Jarrett,
> >
> > Thanks for the information (I've read quite a few responses further into
> > this thread).
> >
> > I thought I was missing something, but this appears to be an area in D that
> > could use some imp
Hi everyone,
This code works...
--
import std.variant;
import std.stdio;
void main()
{
Variant v;
v = "hello";
writeln(v);
}
--
But this code does not...
--
import std.variant;
import std.stdio;
void main()
{
Variant[string] v;
grauzone wrote:
Andrei Alexandrescu wrote:
Georg Wrede wrote:
Andrei Alexandrescu wrote:
void foo_templated(T...)(T args)
{
Variant[args.length] dynatyped;
foreach (i, arg; args) dynatyped[i] = arg;
return foo(dynatyped);
}
void foo(Variant[] dynatyped...)
{
...
}
Hmm. An idiom.
Is it this one?
http://d.puremagic.com/issues/show_bug.cgi?id=2451
Eljay wrote:
Hi everyone,
This code works...
--
import std.variant;
import std.stdio;
void main()
{
Variant v;
v = "hello";
writeln(v);
}
--
But this code does not...
--
import std.variant;
import std.stdio;
void main()
{
Varia
On 04/04/2009 17:41, Denis Koroskin wrote:
I'm not sure I understand everything you intend so lets clear things a
little.
I agree there should be a way to enforce struct to implement some..
contract.
But I believe you took a wrong way by using pseudo-interface inheritance.
First of all, it's ca
Andrei Alexandrescu wrote:
grauzone wrote:
Andrei Alexandrescu wrote:
Georg Wrede wrote:
Andrei Alexandrescu wrote:
void foo_templated(T...)(T args)
{
Variant[args.length] dynatyped;
foreach (i, arg; args) dynatyped[i] = arg;
return foo(dynatyped);
}
void foo(Variant[] dynatyped...)
Sean Kelly Wrote:
> Walter Bright wrote:
> > Nick Sabalausky wrote:
> >> Well, when it comes to college, what you're paying for are the classes
> >> and the degree (and, of course, books/room/board). So I'm certainly
> >> going to measure it's worth with that in mind. Having a dinner with
> >>
grauzone wrote:
Consider if opImplicitCastFrom was implemented and you had a function
"void foo(Variant[] x...)", would it be possible to pass a Variant[] to
it, that will be directly used as "x"?
For example:
void foo(Variant[] x...) {
writefln(x);
}
Variant[] t = [1,2,3];
foo(t);
Yah
Also, I don't understand why D needs a separate syntax for primitive types.
I don't like this whole "alias this" idea.
why can't we just use:
struct S : int { ... }
after all, that exactly what's that feature is trying to do, isn't it?
On December 14, Nick Sabalausky wrote:
> That explains a certain mystery I encountered in a library I wrote.
> Everything *seemed* like it should have worked with "scope" instead
> of "auto" but it never did. The variables that were mysteriously
> unconvertable to "scope" were declared in a mixin.
Andrei Alexandrescu wrote:
grauzone wrote:
Consider if opImplicitCastFrom was implemented and you had a function
"void foo(Variant[] x...)", would it be possible to pass a Variant[]
to it, that will be directly used as "x"?
For example:
void foo(Variant[] x...) {
writefln(x);
}
Variant[
bearophile wrote:
Yigal Chripun:
Also, I don't understand why D needs a separate syntax for primitive types.
Generally D can work some more in the direction of unifying primitive types and
objects. Some of it can be done with no performance price to pay.
Like which?
Bye,
bearophile
Yigal Chripun:
> Also, I don't understand why D needs a separate syntax for primitive types.
Generally D can work some more in the direction of unifying primitive types and
objects. Some of it can be done with no performance price to pay.
Bye,
bearophile
On Sat, 04 Apr 2009 15:38:03 -0400, grauzone wrote:
bearophile wrote:
Yigal Chripun:
Also, I don't understand why D needs a separate syntax for primitive
types.
Generally D can work some more in the direction of unifying primitive
types and objects. Some of it can be done with no performan
> Hey Eljay, thanks for being around :o). It's good you raise scrutiny
> about the dynamic style of coding in D. The code is correct but subject
> to a compiler bug:
>
> http://d.puremagic.com/issues/show_bug.cgi?id=2451
>
> I just voted that up (it's supposed to raise its informal importance),
"Georg Wrede" wrote in message
news:[email protected]...
> On December 14, Nick Sabalausky wrote:
> > That explains a certain mystery I encountered in a library I wrote.
> > Everything *seemed* like it should have worked with "scope" instead
> > of "auto" but it never did. The variable
On 2009-04-03 08:43:48 -0400, Eljay said:
Hi Michel,
Thanks for the tip on D-style variadic. I'll give those a spin.
And you are spot on with what I want to be able to do. Objective-C,
with C replaced by D. (Hmmm, I think #1 slipped in from my Borland
CScript days.)
I'm not exactly sur
Andrei Alexandrescu wrote:
Christopher Wright wrote:
Andrei Alexandrescu wrote:
void foo_templated(T...)(T args)
{
Variant[args.length] dynatyped;
foreach (i, arg; args) dynatyped[i] = arg;
return foo(dynatyped);
}
void foo(Variant[] dynatyped...)
{
...
}
Andrei
Okay, that's a re
Christopher Wright wrote:
Andrei Alexandrescu wrote:
Christopher Wright wrote:
Andrei Alexandrescu wrote:
void foo_templated(T...)(T args)
{
Variant[args.length] dynatyped;
foreach (i, arg; args) dynatyped[i] = arg;
return foo(dynatyped);
}
void foo(Variant[] dynatyped...)
{
...
}
Christopher Wright wrote:
> ...
>
> I don't find that this is the case. I implemented a Variant type that
> can be created from a void* and a typeinfo -- I had to, since tango's
> Variant doesn't support this (and, incidentally, because there is no way
> to get a representation of the data insid
http://dobbscodetalk.com/index.php?option=com_myblog&show=Multithreaded-I-O.html&Itemid=29
-- Daniel
P.S. "It really seems barbaric in our digital age that we all have
motors and levers and gears and spinning things in our boxes." Those
damned spinning things!
54 matches
Mail list logo