Steven Schveighoffer Wrote:
> Bottom line: if a function isn't supposed to change the buffer, the
> signature should be const for that parameter. It's one of the principles
> of const, and why it's in D2 in the first place. I'd explain to the coder
> that he is wrong to expect that modify
BCS wrote:
Hello Walter,
BCS wrote:
Yes the ignition (as the the key) doesn't turn off but when the
engine quits running the ignition system (as in the magneto or that
block of epoxy and silicon under the hood) quits triggering the
spark. Tie into that.
Trying to determine if the distributo
bearophile Wrote:
> Jason House:
>
> > IMHO, enum is a patchwork collection of features... manifest constants,
> > enumerated lists, and bitmasks are all conflated into something rather
> > ugly.<
>
> Manifest constants defined with enum look a little ugly, and I too don't like
> it, but it's
Walter Bright:
> Sorry, I'd overlooked that.
You have nothing to be sorry of, good Walter, you are not supposed to read
every silly thing that I post on this newsgroups.
I like Design by Contract (DbC), even if I don't use it often. I think DbC is a
very requested feature for Java because Java
Hello KennyTM~,
On Nov 21, 09 15:40, Yigal Chripun wrote:
On 21/11/2009 02:45, Andrei Alexandrescu wrote:
Ellery Newcomer wrote:
Nick Sabalausky wrote:
"Yigal Chripun" wrote in message
news:he6sqe$1dq...@digitalmars.com...
Based on recent discussions on the NG a few features were
depr
Jason House:
> IMHO, enum is a patchwork collection of features... manifest constants,
> enumerated lists, and bitmasks are all conflated into something rather ugly.<
Manifest constants defined with enum look a little ugly, and I too don't like
it, but it's not even a syntax problem, it's a nam
Travis Boucher wrote:
Bill Baxter wrote:
On Mon, Nov 23, 2009 at 11:50 AM, Travis Boucher
wrote:
Denis Koroskin wrote:
Travis Boucher has shown his interest in contribution, but he currently
has issues with D2 not working on FreeBSD. To quote him:
I have dmd working, and druntime (which was
On Tue, 24 Nov 2009 17:35:43 -0500, Bartosz Milewski
wrote:
Steven Schveighoffer Wrote:
On Tue, 24 Nov 2009 16:52:52 -0500, Bartosz Milewski
wrote:
> Steven Schveighoffer Wrote:
>> > Imagine you're reviewing this code written by a relative newbee:
>> >
>> > char[] quote(char[] word) {
>>
I'm somewhat new to D; so take everything I say with a grain of salt.
It seems to me that there is a tension here between high-level and
low-level. A high-level Array type might make slices be a Range. The Range
would keep a reference to the Array type plus a start and end index. When
the s
Nick Sabalausky Wrote:
> I don't suppose there's any chance that ugly design will be getting cleaned
> up for D2 is there? Or maybe at least potentially on the table for D3?
I'm with you, but you have quite an uphill battle. Both Andrei and Walter love
it. IMHO, enum is a patchwork collection
Hello Chad,
Don wrote:
I think you've just created the strongest argument AGAINST this
feature: that it makes it too hard for machine-generated code.
Forget the !: hack. No chance.
If that's the strongest argument, then this is cake. I'll go through
Phobos and insert goto case's by hand if
I don't suppose there's any chance that ugly design will be getting cleaned
up for D2 is there? Or maybe at least potentially on the table for D3?
bearophile wrote:
Walter Bright:
http://bugs.sun.com/bugdatabase/top25_rfes.do
Yep:
http://www.mail-archive.com/digitalmars-d@puremagic.com/msg18755.html
Sorry, I'd overlooked that.
Found on Reddit:
This looks a lot like D:
http://research.swtch.com/2009/11/go-data-structures.html
New features in Java, some of them look like D:
http://code.joejag.com/2009/new-language-features-in-java-7/
Bye,
bearophile
Walter Bright:
> http://bugs.sun.com/bugdatabase/top25_rfes.do
Yep:
http://www.mail-archive.com/digitalmars-d@puremagic.com/msg18755.html
Bye,
bearophile
http://bugs.sun.com/bugdatabase/top25_rfes.do
This is a long line of Python2.x code that I've found difficult to translate to
nice D1 code, even using my dlibs:
result = min( ((arr[i], arr[j])
for i in xrange(len(arr) - 1)
for j in xrange(i + 1, min(i + 5, len(arr,
key=dist)
Where:
arr is a list
2009/11/24 Long Chang :
>
>
> enum CompileTimeOption{
>
> ANCHORED ,
> AUTO_CALLOUT ,
> CASELESS ,
> ENDONLY ,
> DOTALL ,
> EXTENDED ,
> EXTRA ,
> FIRSTLINE ,
> MULTILINE ,
> NO_AUTO_CAPTURE ,
> UNGREEDY ,
> UTF8 ,
> NO_UTF8_CHECK ,
> D
2009/11/24 Steven Schveighoffer :
> On Tue, 24 Nov 2009 10:26:08 -0500, Nick Sabalausky wrote:
>
>> "Long Chang" wrote in message
>> news:mailman.499.1259061212.20261.digitalmar...@puremagic.com...
>>>
>>> class RegExp
>>> {
>>> enum Option{
>>> X, Y, Z
>>> }
>>> int options;
>>> th
Steven Schveighoffer Wrote:
> On Tue, 24 Nov 2009 16:52:52 -0500, Bartosz Milewski
> wrote:
>
> > Steven Schveighoffer Wrote:
> >> > Imagine you're reviewing this code written by a relative newbee:
> >> >
> >> > char[] quote(char[] word) {
> >> > word.length += 2;
> >> > word[length-1] = '
Brad Roberts wrote:
Alternate thought.. should order matter or should it automatically sort
such that most specific catch is preferred. Sort of matches the
declaration order doesn't (ok, shouldn't) matter philosophy.
I think the user should know if one inherits from the other, so I'm
relucta
On Tue, 24 Nov 2009 16:52:52 -0500, Bartosz Milewski
wrote:
Steven Schveighoffer Wrote:
> Imagine you're reviewing this code written by a relative newbee:
>
> char[] quote(char[] word) {
> word.length += 2;
> word[length-1] = '"';
> for(int i = word.length-2; i > 0; --i)
> word[i]
Nick Sabalausky wrote:
"Brad Roberts" wrote in message
news:alpine.deb.2.00.0911241319190.18...@bellevue.puremagic.com...
On Mon, 23 Nov 2009, Andrei Alexandrescu wrote:
Consider:
try {
...
} catch (Exception) {
...
} catch (StdioException) {
...
}
The second handler never matches
Steven Schveighoffer Wrote:
> > Imagine you're reviewing this code written by a relative newbee:
> >
> > char[] quote(char[] word) {
> > word.length += 2;
> > word[length-1] = '"';
> > for(int i = word.length-2; i > 0; --i)
> > word[i] = word[i - 1];
> > word[0] = '"';
> > return word
Denis Koroskin wrote:
On Tue, 24 Nov 2009 14:00:18 +0300, Gerrit Wichert
wrote:
how about opLimit ?
I recall that Visual Basic has UBound function that returns upper bound
of a multi-dimensional array:
Dim a(100, 5, 4) As Byte
UBound(a, 1) -> 100
UBound(a, 2) -> 5
UBound(a, 3) -> 4
Wor
"Brad Roberts" wrote in message
news:alpine.deb.2.00.0911241319190.18...@bellevue.puremagic.com...
> On Mon, 23 Nov 2009, Andrei Alexandrescu wrote:
>
>> Consider:
>>
>> try {
>>...
>> } catch (Exception) {
>>...
>> } catch (StdioException) {
>>...
>> }
>>
>> The second handler never
On Tue, 24 Nov 2009 16:20:14 -0500, Brad Roberts
wrote:
On Mon, 23 Nov 2009, Andrei Alexandrescu wrote:
Consider:
try {
...
} catch (Exception) {
...
} catch (StdioException) {
...
}
The second handler never matches because StdioException is a subclass of
Exception, so the first
Don pisze:
Additionally in my framework you can pass around parts of SQL e.g. :
WhereExpression exp = Where(More(visitcards.id, 100));
You basically *CAN NOT* do it when just using strings.
Of course you can define a where clause using strings.
(I'm not sure when you'd want to, though. I su
On Mon, 23 Nov 2009, Andrei Alexandrescu wrote:
> Consider:
>
> try {
>...
> } catch (Exception) {
>...
> } catch (StdioException) {
>...
> }
>
> The second handler never matches because StdioException is a subclass of
> Exception, so the first handler will always match whatever the
On Tue, 24 Nov 2009 15:29:22 -0500, Bartosz Milewski
wrote:
Andrei Alexandrescu Wrote:
Array may include a field
bool sliceExtracted;
that is set to true whenever you take a slice from the array and set to
false whenever the array's data is reallocated. The array's
documentation could
On Tue, 24 Nov 2009 15:25:27 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
Why do we need this scheme then? If it only makes sense to use
slicing when you are done appending, then why not use that model with
today's rules? Why make code that uses slices before you are f
On Tue, 24 Nov 2009 15:00:11 -0500, Bartosz Milewski
wrote:
It's hard to argue whether something is or isn't bug prone and how
severe the bugs could be. An experienced programmer knows all the
gotchas so he or she will never introduce such bugs. A more bug-prone
person will be afraid to
Andrei Alexandrescu Wrote:
> Array may include a field
>
> bool sliceExtracted;
>
> that is set to true whenever you take a slice from the array and set to
> false whenever the array's data is reallocated. The array's
> documentation could mention that ~= is amortized constant if there are
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 14:07:27 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 11:07:43 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
In many other posts, people have been festering over dropping
T[new] and not
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 14:55:55 -0500, Andrei Alexandrescu
wrote:
Because we don't know how to make things perfect in all circumstances.
Well, this makes things less than perfect in most circumstances for the
sake of a small questionable use case. IMO, this is a h
On Tue, 24 Nov 2009 14:55:55 -0500, Andrei Alexandrescu
wrote:
Because we don't know how to make things perfect in all circumstances.
Well, this makes things less than perfect in most circumstances for the
sake of a small questionable use case. IMO, this is a huge step backwards.
-Stev
It's hard to argue whether something is or isn't bug prone and how severe the
bugs could be. An experienced programmer knows all the gotchas so he or she
will never introduce such bugs. A more bug-prone person will be afraid to speak
up in public so as not to appear stupid or be bullied away. It
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 14:07:27 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 11:07:43 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
In many other posts, people have been festering over dropping
T[new] and not
On Tue, 24 Nov 2009 14:07:27 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 11:07:43 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
In many other posts, people have been festering over dropping T[new]
and not having a reference array t
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 11:07:43 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
In many other posts, people have been festering over dropping T[new]
and not having a reference array type. The argument is (and forgive
me if this is a strawman, someone
On Tue, 24 Nov 2009 12:46:37 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
Lookup should be atomic without locking (I think, simply an integer
load right?), but you'd have to lock to actually do an append.
I don't think we solve the lock problem without having multiple
he
On Tue, 24 Nov 2009 12:46:37 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 11:41:17 -0500, Steven Schveighoffer
wrote:
The cache is a thread-local map from pointers to size_t. Using it
does not require any locking I think.
When reallocating, do you
On Tue, 24 Nov 2009 12:46:37 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 11:41:17 -0500, Steven Schveighoffer
wrote:
The cache is a thread-local map from pointers to size_t. Using it
does not require any locking I think.
When reallocating, do you
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
> Steven Schveighoffer wrote:
> > On Tue, 24 Nov 2009 11:41:17 -0500, Steven Schveighoffer
> > wrote:
> >
> >
> >>> The cache is a thread-local map from pointers to size_t. Using it
> >>> does not require any locking I thi
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 11:41:17 -0500, Steven Schveighoffer
wrote:
The cache is a thread-local map from pointers to size_t. Using it
does not require any locking I think.
When reallocating, do you not also need to update the allocated length
in the heap, even if t
Bill Baxter wrote:
On Tue, Nov 24, 2009 at 8:26 AM, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 11:01:10 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
[snip]
Andrei has mentioned that he thinks we can store the allocated length in
the GC block
On Tue, Nov 24, 2009 at 8:26 AM, Andrei Alexandrescu
wrote:
> Steven Schveighoffer wrote:
>>
>> On Tue, 24 Nov 2009 11:01:10 -0500, Andrei Alexandrescu
>> wrote:
>>
>>> Steven Schveighoffer wrote:
>>> [snip]
Andrei has mentioned that he thinks we can store the allocated length in
t
On Tue, 24 Nov 2009 11:41:17 -0500, Steven Schveighoffer
wrote:
The cache is a thread-local map from pointers to size_t. Using it does
not require any locking I think.
When reallocating, do you not also need to update the allocated length
in the heap, even if the allocation fits into th
Moritz Warning schrieb:
apart from gdc, ldc might work as well http://dsource.org/projects/ldc.
This looks quiet promising, except it still is beta, but hopefully this
will get changed
On Tue, 24 Nov 2009 11:26:11 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 11:01:10 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
[snip]
Andrei has mentioned that he thinks we can store the allocated length
in the GC block, which I t
"Nick Sabalausky" wrote in message
news:heh1v5$1te...@digitalmars.com...
>
> Come to think of it though, I think my favorite is still making the
> "Foo.Option." optional wherever a Foo.Option is expected. But, I'd
> consider anything (except the Haxe-style approach of polluting the
> namespace
s_lange wrote:
A 16 bit precision floating point type has been defined by the IEEE in
the revision of the 754 floating point standard and declared as
optional. These small data types are heavily used in all kinds of
graphics rendering software. The most prominent example beeing the gl
librarie
"Robert Clipsham" wrote in message
news:hegv1c$1mo...@digitalmars.com...
> Long Chang wrote:
>> class RegExp
>> {
>> enum Option{
>> X, Y, Z
>> }
>> int options;
>> this(int options = 0){ this.options = options; }
>> }
>>
>> void main(){
>>auto reg = new RegExp("^
On Tue, 24 Nov 2009 10:44:45 -0500, Robert Clipsham
wrote:
Long Chang wrote:
class RegExp
{
enum Option{
X, Y, Z
}
int options;
this(int options = 0){ this.options = options; }
}
void main(){
auto reg = new RegExp("^A.", .Option( X |Y|Z ) );
assert(
Steven Schveighoffer wrote:
On Tue, 24 Nov 2009 11:01:10 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
[snip]
Andrei has mentioned that he thinks we can store the allocated length
in the GC block, which I think would also work. You also wouldn't
need an MRU cache in that ca
On Tue, 24 Nov 2009 17:14:06 +0100, s_lange wrote:
> I know there are ways to get GDC working on ARM CPUs, but I'm interested
> to know whether there is also an ARM version of the DMD compiler. If it
> isn't yet, then if it is planned or scheduled to port it to ARM, and if
> it already is, in what
A 16 bit precision floating point type has been defined by the IEEE in
the revision of the 754 floating point standard and declared as
optional. These small data types are heavily used in all kinds of
graphics rendering software. The most prominent example beeing the gl
libraries of the OpenGL
On Tue, 24 Nov 2009 11:07:43 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
In many other posts, people have been festering over dropping T[new]
and not having a reference array type. The argument is (and forgive me
if this is a strawman, someone from the other side can po
On Tue, 24 Nov 2009 19:14:06 +0300, s_lange wrote:
I know there are ways to get GDC working on ARM CPUs, but I'm interested
to know whether there is also an ARM version of the DMD compiler. If it
isn't yet, then if it is planned or scheduled to port it to ARM, and if
it already is, in what
"Steven Schveighoffer" wrote in message
news:op.u3woiqnyeav...@localhost.localdomain...
> On Tue, 24 Nov 2009 10:26:08 -0500, Nick Sabalausky wrote:
>
>> "Long Chang" wrote in message
>> news:mailman.499.1259061212.20261.digitalmar...@puremagic.com...
>>> class RegExp
>>> {
>>>enum Option{
I know there are ways to get GDC working on ARM CPUs, but I'm interested
to know whether there is also an ARM version of the DMD compiler. If it
isn't yet, then if it is planned or scheduled to port it to ARM, and if
it already is, in what status it currently is.
I'm specifically interested on
On Tue, 24 Nov 2009 11:01:10 -0500, Andrei Alexandrescu
wrote:
Steven Schveighoffer wrote:
[snip]
Andrei has mentioned that he thinks we can store the allocated length
in the GC block, which I think would also work. You also wouldn't need
an MRU cache in that case, but he says it's in *a
aarti_pl wrote:
Lutger pisze:
yigal chripun wrote:
aarti_pl Wrote:
There's nothing more hideous than all those frameworks in Java/C++ that
try to re-enginer SQL into functions, templates, LINQ, whatever. SQL
*is*
a perfectly designed language for its purpose and it doesn't need to be
Steven Schveighoffer wrote:
In many other posts, people have been festering over dropping T[new] and
not having a reference array type. The argument is (and forgive me if
this is a strawman, someone from the other side can post if I'm
incorrect): If we make arrays a separate type from slices,
On Tue, 24 Nov 2009 09:27:22 -0500, Steven Schveighoffer
wrote:
I think dsichma already is working on such a type.
Gah! my apologies to David, I should know better as someone who has a
hard-to-spell last name.
For some reason I always read "dee-sic-ma" when I see your handle :)
I mean
Steven Schveighoffer wrote:
[snip]
Andrei has mentioned that he thinks we can store the allocated length in
the GC block, which I think would also work. You also wouldn't need an
MRU cache in that case, but he says it's in *addition* to the MRU cache,
so I'm not sure what he means.
[snip]
Re
Walter Bright wrote:
Andrei Alexandrescu wrote:
Should that be a compile-time error? I think so.
=
class A : Exception
{
this(string msg) { super(msg); }
}
void foo()
{
try { }
catch (Exception e) { }
catch (A e) { }
}
==
Long Chang wrote:
class RegExp
{
enum Option{
X, Y, Z
}
int options;
this(int options = 0){ this.options = options; }
}
void main(){
auto reg = new RegExp("^A.", .Option( X |Y|Z ) );
assert( RegExp .Option.X | RegExp .Option.Y| RegExp .Option.Z
== reg
Nick Sabalausky:
> That's a very good idea, I like that a lot.
I don't understand that idea yet, sorry :-)
Is that proposal asking for sugar to write:
enum Option { X, Y, Z }
Option.X | Option.Y | Option.Z
As:
Option(X | Y | Z)
?
Or is it asking for something more, like omitting the class name in
On Tue, 24 Nov 2009 10:26:08 -0500, Nick Sabalausky wrote:
"Long Chang" wrote in message
news:mailman.499.1259061212.20261.digitalmar...@puremagic.com...
class RegExp
{
enum Option{
X, Y, Z
}
int options;
this(int options = 0){ this.options = options; }
}
void main(){
On Tue, 24 Nov 2009 10:19:57 -0500, Lutger
wrote:
Just to clarify, is it true that stomping over mutable arrays is covered
by
the spec (currently), but stomping immutable arrays is classified as a
bug?
I was very surprised by this.
Stomping of arrays is covered by the spec (without refe
On Tue, 24 Nov 2009 18:31:27 +0300, Nick Sabalausky wrote:
"Lars T. Kyllingstad" wrote in message
news:heg9jk$7f...@digitalmars.com...
I think the spec should state as a general rule that unreachable code is
an error.
Disagree very much with this. I don't want to have to carefully comment
"Lars T. Kyllingstad" wrote in message
news:heg9jk$7f...@digitalmars.com...
>
> I think the spec should state as a general rule that unreachable code is
> an error.
Disagree very much with this. I don't want to have to carefully comment out
temporarily-dead code when I'm inserting debugging br
"Long Chang" wrote in message
news:mailman.499.1259061212.20261.digitalmar...@puremagic.com...
> class RegExp
> {
>enum Option{
>X, Y, Z
>}
>int options;
>this(int options = 0){ this.options = options; }
> }
>
> void main(){
> auto reg = new RegExp("^A.", .Option(
Just to clarify, is it true that stomping over mutable arrays is covered by
the spec (currently), but stomping immutable arrays is classified as a bug?
I was very surprised by this.
On Tue, 24 Nov 2009 09:27:22 -0500, Steven Schveighoffer
wrote:
This stomping becomes more of a problem for library writers:
char * toStringZ(string s)
{
s ~= '\0';
return s.ptr;
}
Apologies, this should be written:
immutable(char) * toStringZ(string s)
-Steve
In many other posts, people have been festering over dropping T[new] and
not having a reference array type. The argument is (and forgive me if
this is a strawman, someone from the other side can post if I'm
incorrect): If we make arrays a separate type from slices, and only allow
appending
this.outer also. work on d1.
thank you guys.
Don Wrote:
> Bill Baxter wrote:
> > On Mon, Nov 23, 2009 at 11:33 AM, Leandro Lucarella
> > wrote:
> >> I'm just saying
> >> that the patch was mostly turned down because he didn't asked for other
> >> devs permission to make the patch, not because of the quality of the patch
> >> (or the featur
On Tue, 24 Nov 2009 08:09:28 -0500, Long Chang
wrote:
I use the d1 & tango trunk & dwt-win.
there is a new dispose method for Object, and Dwt-win already have a
dispose
width Event argument.
I try it with outer, the error is :
x.d(17): Error: undefined identifier outer
x.d(17): Error:
On Tue, 24 Nov 2009 16:09:28 +0300, Long Chang
wrote:
I use the d1 & tango trunk & dwt-win.
there is a new dispose method for Object, and Dwt-win already have a
dispose
width Event argument.
I try it with outer, the error is :
x.d(17): Error: undefined identifier outer
x.d(17): Error:
I use the d1 & tango trunk & dwt-win.
there is a new dispose method for Object, and Dwt-win already have a dispose
width Event argument.
I try it with outer, the error is :
x.d(17): Error: undefined identifier outer
x.d(17): Error: undefined identifier outer
x.d(17): Error: no property 'toStrin
On Tue, 24 Nov 2009 07:38:51 -0500, Long Chang
wrote:
how about this case:
public interface Listener {
void handleEvent (int);
}
class Test{
this(){
Listener listener= new class() Listener {
public void handleEvent(int evt) {
toString(evt);
On Mon, 23 Nov 2009 18:34:48 -0500, Leandro Lucarella
wrote:
Steven Schveighoffer, el 23 de noviembre a las 15:18 me escribiste:
On Mon, 23 Nov 2009 11:10:48 -0500, Leandro Lucarella
wrote:
>
>The thing is, with realloc() is less likely that you forget that the
data
>can be copied because
how about this case:
public interface Listener {
void handleEvent (int);
}
class Test{
this(){
Listener listener= new class() Listener {
public void handleEvent(int evt) {
toString(evt);
}
};
}
void toString(int evt){
On Tue, 24 Nov 2009 06:55:44 -0500, Long Chang
wrote:
public interface Listener {
void handleEvent (int);
}
void main(){
void print(int evt){
}
Listener listener= new class() Listener {
public void handleEvent(int evt) {
.print(evt);
}
};
On Tue, 24 Nov 2009 14:55:44 +0300, Long Chang
wrote:
public interface Listener {
void handleEvent (int);
}
void main(){
void print(int evt){
}
Listener listener= new class() Listener {
public void handleEvent(int evt) {
.print(evt);
}
};
public interface Listener {
void handleEvent (int);
}
void main(){
void print(int evt){
}
Listener listener= new class() Listener {
public void handleEvent(int evt) {
.print(evt);
}
};
}
-
Michal Minich wrote:
Andrei Alexandrescu wrote:
Consider:
try {
...
} catch (Exception) {
...
} catch (StdioException) {
...
}
The second handler never matches because StdioException is a subclass
of Exception, so the first handler will always match whatever the
second matches.
Should that be
On Tue, 24 Nov 2009 14:00:18 +0300, Gerrit Wichert
wrote:
how about opLimit ?
I recall that Visual Basic has UBound function that returns upper bound of
a multi-dimensional array:
Dim a(100, 5, 4) As Byte
UBound(a, 1) -> 100
UBound(a, 2) -> 5
UBound(a, 3) -> 4
Works for single-dimensi
how about opLimit ?
class RegExp
{
enum Option{
X, Y, Z
}
int options;
this(int options = 0){ this.options = options; }
}
void main(){
auto reg = new RegExp("^A.", .Option( X |Y|Z ) );
assert( RegExp .Option.X | RegExp .Option.Y| RegExp .Option.Z ==
reg.options );
}
enum CompileTimeOption{
ANCHORED ,
AUTO_CALLOUT ,
CASELESS ,
ENDONLY ,
DOTALL ,
EXTENDED ,
EXTRA ,
FIRSTLINE ,
MULTILINE ,
NO_AUTO_CAPTURE ,
UNGREEDY ,
UTF8 ,
NO_UTF8_CHECK ,
DUPNAMES ,
NEWLINE_CR ,
NEWLINE_LF ,
NEWLIN
Andrei Alexandrescu wrote:
> Consider:
>
> try {
> ...
> } catch (Exception) {
> ...
> } catch (StdioException) {
> ...
> }
>
> The second handler never matches because StdioException is a subclass of
> Exception, so the first handler will always match whatever the second
> match
Andrei Alexandrescu wrote:
Should that be a compile-time error? I think so.
=
class A : Exception
{
this(string msg) { super(msg); }
}
void foo()
{
try { }
catch (Exception e) { }
catch (A e) { }
}
=
gives:
test.
Andrei Alexandrescu wrote:
Consider:
try {
...
} catch (Exception) {
...
} catch (StdioException) {
...
}
The second handler never matches because StdioException is a subclass
of Exception, so the first handler will always match whatever the
second matches.
Should that be a compile-time error?
Andrei Alexandrescu wrote:
Consider:
try {
...
} catch (Exception) {
...
} catch (StdioException) {
...
}
The second handler never matches because StdioException is a subclass of
Exception, so the first handler will always match whatever the second
matches.
Should that be a compile
Andrei Alexandrescu wrote:
Consider:
try {
...
} catch (Exception) {
...
} catch (StdioException) {
...
}
The second handler never matches because StdioException is a subclass of
Exception, so the first handler will always match whatever the second
matches.
Should that be a compile
On Tue, 24 Nov 2009 10:30:30 +0300, Andrei Alexandrescu
wrote:
Consider:
try {
...
} catch (Exception) {
...
} catch (StdioException) {
...
}
The second handler never matches because StdioException is a subclass of
Exception, so the first handler will always match whatever the
Andrei Alexandrescu Wrote:
> sharing for ~=. Also I am not ruling out the possibility that we can
> guarantee a ~= that never keeps sharing with existing arrays. (One idea
> I discussed with Walter was encoding uniqueness of arrays in a bit
> stored with the array limits.)
I've been thinking th
1 - 100 of 102 matches
Mail list logo