The following symbols in std.string don't satisfy the Phobos naming
conventions and need to be renamed:
LS PS capwords countchars entab expandtabs hexdigits icmp iswhite
ljustify lowercase maketrans newline octdigits removechars rjustify
sformat splitlines stripl stripr tolower tolowerInPlace
hello all,
i've read that on newer architectures
SSE code should be prefered over x87 - because of speed
and i saw masses of SSE code in the math stuff of microsoft and intel
compiler generated code
i know that the current fpu/sse support of DMD isn't that good, but are
there any attemps to
Andrei Alexandrescu wrote:
The following symbols in std.string don't satisfy the Phobos naming
conventions and need to be renamed:
LS PS capwords countchars entab expandtabs hexdigits icmp iswhite
ljustify lowercase maketrans newline octdigits removechars rjustify
sformat splitlines stripl
On Thursday 20 January 2011 23:57:39 Andrei Alexandrescu wrote:
The following symbols in std.string don't satisfy the Phobos naming
conventions and need to be renamed:
LS PS capwords countchars entab expandtabs hexdigits icmp iswhite
ljustify lowercase maketrans newline octdigits removechars
On 2011-01-21 04:02, Andrei Alexandrescu wrote:
On 1/20/11 7:18 PM, Luke J. West wrote:
Hi to all from a total noob.
first of all, I'd like to say how impressed I am with D. In fact, I keep
pinching myself. Have I *really* found a language worth leaving C++ for
after two decades? It's
On Friday 21 January 2011 00:44:26 Jonathan M Davis wrote:
On Thursday 20 January 2011 23:57:39 Andrei Alexandrescu wrote:
The following symbols in std.string don't satisfy the Phobos naming
conventions and need to be renamed:
LS PS capwords countchars entab expandtabs hexdigits icmp
On Fri, 21 Jan 2011 01:57:39 -0600, Andrei Alexandrescu wrote:
The following symbols in std.string don't satisfy the Phobos naming
conventions and need to be renamed:
LS PS capwords countchars entab expandtabs hexdigits icmp iswhite
ljustify lowercase maketrans newline octdigits removechars
On Fri, 21 Jan 2011 09:05:24 +, Lars T. Kyllingstad wrote:
sformat: formatString
Forget that; I confused sformat() and format(). But maybe sformat should
be renamed formatInPlace? I dunno.
-Lars
On 2011-01-21 08:57, Andrei Alexandrescu wrote:
The following symbols in std.string don't satisfy the Phobos naming
conventions and need to be renamed:
LS PS capwords countchars entab expandtabs hexdigits icmp iswhite
ljustify lowercase maketrans newline octdigits removechars rjustify
sformat
On 1/20/11 11:28 PM, Robert Jacques wrote:
On Thu, 20 Jan 2011 22:02:42 -0500, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
First, why not use tupleof? b.tupleof = a.tupleof; works perfectly fine,
simpler and ahem, actually works. __traits(getMember, ...) has to obey
scoping rules,
Andrei Alexandrescu Wrote:
The following symbols in std.string don't satisfy the Phobos naming
conventions and need to be renamed:
LS PS capwords countchars entab expandtabs hexdigits icmp iswhite
ljustify lowercase maketrans newline octdigits removechars rjustify
sformat splitlines
dennis luehring wrote:
hello all,
i've read that on newer architectures
SSE code should be prefered over x87 - because of speed
and i saw masses of SSE code in the math stuff of microsoft and intel
compiler generated code
At the present time, SSE and x87 are the same speed in most cases
Don:
At the present time, SSE and x87 are the same speed in most cases (most
operations take just one cycle) -- except of course that you can do two
or four operations at once with SSE.
SSE-something also allow some other operations, sqrt, etc. Even with GCC I've
seen some performance
On 01/21/2011 04:48 AM, Andrej Mitrovic wrote:
On 1/21/11, Andrei Alexandrescuseewebsiteforem...@erdani.org wrote:
I think copyMembers belongs to the standard library. I wanted to define
a family of functions like it but never got around to it.
It's a shame we can't use .dup. It would look
spir:
It's a shame we can't use .dup. It would look really nice in code.
+++
Copying classes is not a so common need in D. As an example, I need a byPair()
method for AAs more than dup for classes :-)
Bye,
bearophile
On 01/21/2011 04:02 AM, Andrei Alexandrescu wrote:
That being said, it's not difficult to define a generic function that
copies fields over from one class object to another. Here's a start:
import std.stdio;
void copyMembers(A)(A src, A tgt) if (is(A == class)) {
foreach (e;
spir:
How many programmers in the world consider this kind of code not
difficult?
(True complex code is when you have to maintain or improve ocean-wide programs
:-) )
That kind of code is library-level one, so it's more difficult than normal user
code.
Bye,
bearophile
On 01/21/2011 06:28 AM, Robert Jacques wrote:
void copyMembers(A)(A src, A tgt) if (is(A == class)) { tgt.tupleof =
src.tupleof; }
What about this feature in Object under name copy or dup? Sure, it's
not to be used evereday; but it's typcally the kind of routine that,
when needed, we're very
On Thu, 2011-01-20 at 19:24 +0100, Lutger Blijdestijn wrote:
[ . . . ]
Do you have an opinion for the .NET world? I'm currently just using MSBuild,
but know just enough to get it working. It sucks.
I thought .NET was dominated by NAnt -- I have no direct personal
experience, so am
On 01/21/2011 09:43 AM, Lutger Blijdestijn wrote:
newline and whitespace: not sure how it is called in English, but these look
like they have become single words and are fine.
I would not make such exceptions because there is no rational criterion
to determine which multiple-word terms have
On 01/21/2011 09:43 AM, Lutger Blijdestijn wrote:
LS and PS: since these are constants, upper case is ok, although LS is
inconsistent with std.path.linesep.
Consistency across stdlib modules and with D builtin names (esp types)
would be even more helpful than proper casing, imo.
[Also: Is
On 01/21/2011 09:44 AM, Jonathan M Davis wrote:
Well, entab, I'd argue_does_ follow the naming convention, because entab would
be a verb, albeit a made up one. Certainly, en is a prefix, not another word, so
I think that entab is fine. If that doesn't fly, then go with enTab, I guess,
but
I'd
Someone mentioned to me that scope declarations, e.g.
scope class A{}
or
scope A myNewObject;
are being removed from the language. Is this true? If so, how will RAII-type
classes be implemented?
On 01/21/2011 10:14 AM, Jacob Carlborg wrote:
ljustify - leftJustify /justifyLeft
rjustify - rightJustify/justifyRight
stripl - stripLeft
stripr - striptRight
Consistency. Eg: all qualifiers come first (like in english).
Denis
_
vita es estrany
spir.wikidot.com
On 01/21/2011 10:05 AM, Lars T. Kyllingstad wrote:
These should be expanded a bit and camelCased:
LS:lineSep, lineSeparator
PS:paragraphSep, paragraphSeparator
Isn't there a rule that constants all fully uppercase?
Denis
_
vita es estrany
On 01/21/2011 01:29 PM, bearophile wrote:
spir:
It's a shame we can't use .dup. It would look really nice in code.
+++
Copying classes is not a so common need in D. As an example, I need a
byPair() method for AAs more than dup for classes :-)
Bye,
bearophile
Sure, but when you need
Don wrote:
BlazingWhitester wrote:
I spotted some patents that can theaten current DMD implementation.
Wanted to clarify things.
http://www.freepatentsonline.com/6185728.pdf - this patent describes
method pointers implementation (delegates)
This was obviously a patent aimed at protecting
Theorizing: Would it be a bad idea if .dup for classes did the same
thing as normal assignment did for structs with postblit constructors?
Essentially I was thinking that code like this would do the trick:
import std.stdio;
class Widget
{
int integral; // field-by-field assignment
On Fri, 21 Jan 2011 08:16:24 -0500, spir denis.s...@gmail.com wrote:
On 01/21/2011 06:28 AM, Robert Jacques wrote:
void copyMembers(A)(A src, A tgt) if (is(A == class)) { tgt.tupleof =
src.tupleof; }
What about this feature in Object under name copy or dup? Sure, it's
not to be used
ljustify - leftJustify
rjustify - rightJustify
stripl - leftStrip
stripr - rightStrip
I suggest it should be rather justifyLeft/Right and stripLeft/Right.
It's easier to read and it works better with code completion.
replace is clearer in the first case, because you're getting the return
value.
...
I am really trying hard to understand this, but your reasons for first is
clearer then the second makes no sense to me i am sorry.
I still think second is clearer, but whatever, as long as i can see the
so:
Just check boost/string/replace, they have in place replaces default too.
You might not like boost (some don't) but it is the closest example to D.
You will find D1 string functions are much more from here than from Boost:
http://docs.python.org/release/2.5.2/lib/string-methods.html
On Friday, January 21, 2011 06:04:53 spir wrote:
On 01/21/2011 09:44 AM, Jonathan M Davis wrote:
Well, entab, I'd argue_does_ follow the naming convention, because entab
would be a verb, albeit a made up one. Certainly, en is a prefix, not
another word, so I think that entab is fine. If
On Friday, January 21, 2011 06:20:30 spir wrote:
On 01/21/2011 10:05 AM, Lars T. Kyllingstad wrote:
These should be expanded a bit and camelCased:
LS:lineSep, lineSeparator
PS:paragraphSep, paragraphSeparator
Isn't there a rule that constants all fully uppercase?
On 01/21/2011 05:27 PM, Robert Jacques wrote:
On Fri, 21 Jan 2011 08:16:24 -0500, spir denis.s...@gmail.com wrote:
On 01/21/2011 06:28 AM, Robert Jacques wrote:
void copyMembers(A)(A src, A tgt) if (is(A == class)) { tgt.tupleof =
src.tupleof; }
What about this feature in Object under name
On Friday, January 21, 2011 06:16:16 spir wrote:
On 01/21/2011 10:14 AM, Jacob Carlborg wrote:
ljustify - leftJustify /justifyLeft
rjustify - rightJustify/justifyRight
stripl - stripLeft
stripr - striptRight
Consistency. Eg: all qualifiers come first (like in english).
Actually, it's
On 01/21/2011 03:51 PM, Don wrote:
Don wrote:
BlazingWhitester wrote:
I spotted some patents that can theaten current DMD implementation.
Wanted to clarify things.
http://www.freepatentsonline.com/6185728.pdf - this patent describes
method pointers implementation (delegates)
This was
On Fri, 21 Jan 2011 14:54:53 -0500, spir denis.s...@gmail.com wrote:
On 01/21/2011 05:27 PM, Robert Jacques wrote:
On Fri, 21 Jan 2011 08:16:24 -0500, spir denis.s...@gmail.com wrote:
On 01/21/2011 06:28 AM, Robert Jacques wrote:
void copyMembers(A)(A src, A tgt) if (is(A == class)) {
On 01/21/2011 07:47 PM, so wrote:
replace is clearer in the first case, because you're getting the
return value.
...
I am really trying hard to understand this, but your reasons for first
is clearer then the second makes no sense to me i am sorry.
I still think second is clearer, but whatever,
On Fri, 21 Jan 2011 15:06:37 -0500, spir denis.s...@gmail.com wrote:
On 01/21/2011 03:51 PM, Don wrote:
Don wrote:
BlazingWhitester wrote:
I spotted some patents that can theaten current DMD implementation.
Wanted to clarify things.
http://www.freepatentsonline.com/6185728.pdf - this patent
Am 21.01.2011 21:06, schrieb spir:
On 01/21/2011 03:51 PM, Don wrote:
Don wrote:
BlazingWhitester wrote:
I spotted some patents that can theaten current DMD implementation.
Wanted to clarify things.
http://www.freepatentsonline.com/6185728.pdf - this patent describes
method pointers
On Friday, January 21, 2011 10:47:01 so wrote:
replace is clearer in the first case, because you're getting the return
value.
...
I am really trying hard to understand this, but your reasons for first is
clearer then the second makes no sense to me i am sorry.
I still think second is
On Fri, 21 Jan 2011 15:18:46 -0500, Daniel Gibson metalcae...@gmail.com
wrote:
On Fri, 21 Jan 2011 15:18:57 -0500, Steven Schveighoffer
schvei...@yahoo.com wrote:
Damn, beat my by 11 seconds :)
-Steve
Am 21.01.2011 21:20, schrieb Steven Schveighoffer:
On Fri, 21 Jan 2011 15:18:46 -0500, Daniel Gibson metalcae...@gmail.com wrote:
On Fri, 21 Jan 2011 15:18:57 -0500, Steven Schveighoffer schvei...@yahoo.com
wrote:
Damn, beat my by 11 seconds :)
-Steve
*g*
On Friday, January 21, 2011 12:10:26 Steven Schveighoffer wrote:
On Fri, 21 Jan 2011 14:54:53 -0500, spir denis.s...@gmail.com wrote:
(*)
Or do people really speak like:
Would you please make a duplicate of the guest list?
in the US?
They might, it doesn't sound that odd to me,
On 01/21/2011 09:18 PM, Daniel Gibson wrote:
You're thinking of closures (which are also delegates in D), but D's
delegates can also be used to simple point to a member of an object.
It's kind of hidden in the definition:
Delegates to non-static nested functions contain two pieces of data:
the
On Friday, January 21, 2011 12:15:42 spir wrote:
On 01/21/2011 07:47 PM, so wrote:
replace is clearer in the first case, because you're getting the
return value.
...
I am really trying hard to understand this, but your reasons for first
is clearer then the second makes no sense to me
On 01/21/2011 09:21 PM, Jonathan M Davis wrote:
The issue is when you don't look at the documentation or trying to avoid having
to look at the documentation. If you see
auto result = replace(str, hello, goodbye);
it's quite clear that a copy is taking place. And if a copy/slice is taking
spir wrote:
On 01/21/2011 03:51 PM, Don wrote:
Don wrote:
BlazingWhitester wrote:
I spotted some patents that can theaten current DMD implementation.
Wanted to clarify things.
http://www.freepatentsonline.com/6185728.pdf - this patent describes
method pointers implementation (delegates)
On Friday, January 21, 2011 12:48:57 spir wrote:
On 01/21/2011 09:21 PM, Jonathan M Davis wrote:
The issue is when you don't look at the documentation or trying to avoid
having to look at the documentation. If you see
auto result = replace(str, hello, goodbye);
it's quite clear that
Am 21.01.2011 21:31, schrieb spir:
On 01/21/2011 09:18 PM, Daniel Gibson wrote:
You're thinking of closures (which are also delegates in D), but D's
delegates can also be used to simple point to a member of an object.
It's kind of hidden in the definition:
Delegates to non-static nested
Jonathan M Davis napisał:
I don't know a terser way to get a full-fledged range. It comes at a cost,
though. Lazy parameters are just sugar over delegates, so it's not exactly
Usain Bolt**... And you can't return it because by bug or by design lazy
parameters (unlike vanilla delegates)
Jonathan M Davis wrote:
On Friday, January 21, 2011 06:20:30 spir wrote:
On 01/21/2011 10:05 AM, Lars T. Kyllingstad wrote:
These should be expanded a bit and camelCased:
LS:lineSep, lineSeparator
PS:paragraphSep, paragraphSeparator
Isn't there a rule that constants
Andrei Alexandrescu wrote:
iswhite
I like separating is with an underscore, like most coding styles do:
is_whitespace
Warm and fuzzy... :)
Ali
Am 21.01.2011 21:55, schrieb Don:
spir wrote:
On 01/21/2011 03:51 PM, Don wrote:
Don wrote:
BlazingWhitester wrote:
I spotted some patents that can theaten current DMD implementation.
Wanted to clarify things.
http://www.freepatentsonline.com/6185728.pdf - this patent describes
method
Jonathan M Davis napisał:
These should be expanded a bit and camelCased:
LS:lineSep, lineSeparator
PS:paragraphSep, paragraphSeparator
Isn't there a rule that constants all fully uppercase?
That would be typical in C++ or Java, but that's not the case in
On Friday, January 21, 2011 13:46:11 Tomek Sowiński wrote:
Jonathan M Davis napisał:
These should be expanded a bit and camelCased:
LS:lineSep, lineSeparator
PS:paragraphSep, paragraphSeparator
Isn't there a rule that constants all fully uppercase?
On Friday, January 21, 2011 13:30:11 Ali Çehreli wrote:
Andrei Alexandrescu wrote:
iswhite
I like separating is with an underscore, like most coding styles do:
is_whitespace
Warm and fuzzy... :)
Most? I've never dealt with a coding style that had underscores. It's generally
Jonathan M Davis:
Most? I've never dealt with a coding style that had underscores. It's
generally
camelcase, though I get the impression that using underscores in C code is
more
common (I've mostly used C++ and Java). Regardless however, Phobos' coding
style
uses camelcase, not
On 01/22/2011 12:17 AM, bearophile wrote:
You are right. But I'd like to know why Phobos uses camelcase instead
of underscores (as used in C and Python). I think variable names in
camelcase are less noisy.
I have used underscores for a long time, then had to switch to camelcase
for
I think variable names in camelcase are less noisy.
Sorry, I meant:
I think variable names in camelcase are more noisy.
Bye,
bearophile
On 01/21/2011 10:46 PM, Tomek Sowiński wrote:
So if not uppercase, what is the convention for constants then? And, to
hair-split more, what is a constant to begin with? Would e.g. a big immutable
configuration tree structure fall into that bucket? Or a logger object?
Very personal def: I
On 1/21/11 3:15 PM, Tomek Sowiński wrote:
Jonathan M Davis napisał:
I don't know a terser way to get a full-fledged range. It comes at a cost,
though. Lazy parameters are just sugar over delegates, so it's not exactly
Usain Bolt**... And you can't return it because by bug or by design lazy
On 1/21/11 4:49 PM, Jonathan M Davis wrote:
On Friday, January 21, 2011 13:30:11 Ali Çehreli wrote:
Andrei Alexandrescu wrote:
iswhite
I like separating is with an underscore, like most coding styles do:
is_whitespace
Warm and fuzzy... :)
Most? I've never dealt with a coding style
On 01/21/2011 10:03 PM, Jonathan M Davis wrote:
I really don't find having functions returning results without altering their
arguments as the normal case to be odd at all, let alone misleading, since
that's what most functions actually do.
Same for me. I don't find having this version as the
Andrei Alexandrescu Wrote:
Ever since I worked with STL, I fell in love with
names_with_underscores. I can't explain it, but my feeling is that code
using that convention is calm and levelheaded. Camel case forces me to
think of one-word names because at the second word some beauty is
On Friday, January 21, 2011 15:17:00 bearophile wrote:
Jonathan M Davis:
Most? I've never dealt with a coding style that had underscores. It's
generally camelcase, though I get the impression that using underscores
in C code is more common (I've mostly used C++ and Java). Regardless
On 01/22/2011 01:16 AM, Andrei Alexandrescu wrote:
Ever since I worked with STL, I fell in love with
names_with_underscores. I can't explain it, but my feeling is that code
using that convention is calm and levelheaded. Camel case forces me to
think of one-word names because at the second word
Andrei Alexandrescu napisał:
Like I said, anything that doesn't bother to expose range-interfaced
iterators and is not performance critical is
considered a target for ad hoc ranges. Working with non-D libraries, or
libraries ported to D but preserving
mother-language idioms. Tasks
Well, the underscored names might be easier to read since the words
are spaced apart. They might be easier to type as well, if you set a
hotkey for _. With camelcase you either have autocomplete to help you
or you have to use Shift all the time (you need shift for _ as well
unless you set a hotkey
On 1/21/11 7:35 PM, Tomek Sowiński wrote:
Andrei Alexandrescu napisał:
Like I said, anything that doesn't bother to expose range-interfaced iterators
and is not performance critical is
considered a target for ad hoc ranges. Working with non-D libraries, or
libraries ported to D but
Gour wrote:
Otoh, with Ubuntu, upgrade from 8.10 to 10.10 is always a major
undertaking (I'm familiar with it since '99 when I used SuSE and had
experience with deps hell.)
I finally did do it, but as a clean install. I found an old 160G drive, wiped
it, and installed 10.10 on it.
On 1/22/11 12:35 AM, Walter Bright wrote:
Phobos1 on 10.10 is dying in its unit tests because Ubuntu changed how
gcc's strtof() works. Erratic floating point is typical of C runtime
library implementations (the transcendentals are often sloppily done),
which is why more and more Phobos uses its
On Fri, 21 Jan 2011 22:35:55 -0800
Walter Bright newshou...@digitalmars.com wrote:
Hello Walter,
I finally did do it, but as a clean install. I found an old 160G
drive, wiped it, and installed 10.10 on it. (Amusingly, the About
Ubuntu box says it's version 11.04, and /etc/issue says it's
Speaking of COM.. has anyone successfully used COM interfaces in D2?
I once tried to create a DDraw proxy dll but I can't remember how good it
worked.
https://bitbucket.org/trass3r/ddrawproxy
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - .fragment;
scope(success) {
std.file.rename(tempFilename, filename);
}
auto f = File(tempFilename, w);
}
and:
void transactionalCreate(string filename) {
string
How does one avoid code duplication in a snippet code like this:
class A{}
void foo(const A, void delegate(const A) fn)
{
// some stuff
// ...
// ...
}
void foo(A, void delegate(A) fn)
{
// exact same stuff, with different qualifiers
// ...
// ...
On Thu, 20 Jan 2011 21:14:06 -0500, Adam Conner-Sax
adam_conner_...@yahoo.com wrote:
The following code:
import std.algorithm;
class Foo {
private:
int id_;
public:
shared int id() const { return id_; }
}
static bool compare(in shared(Foo) a, in shared(Foo) b)
{
return (a.id()
On 01/21/2011 02:18 PM, tamir wrote:
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - .fragment;
scope(success) {
std.file.rename(tempFilename, filename);
}
auto f = File(tempFilename, w);
}
and:
void
Thanks!
I tried to apply that patch and rebuild phobos (I changed the file, remade
libphobos2.a, put it in /usr/local/lib). That worked but I still get my error.
I
might have done the applying or rebuilding wrong though, especially since once I
did that, even with the casting away of shared, I
On Fri, 21 Jan 2011 10:04:56 -0500, Adam Conner-Sax
adam_conner_...@yahoo.com wrote:
Thanks!
I tried to apply that patch and rebuild phobos (I changed the file,
remade
libphobos2.a, put it in /usr/local/lib). That worked but I still get my
error. I
might have done the applying or
On Fri, 21 Jan 2011 08:18:15 -0500, tamir tamir@gmail.com wrote:
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - .fragment;
scope(success) {
std.file.rename(tempFilename, filename);
}
auto f =
On Fri, 21 Jan 2011 10:09:18 -0500, Steven Schveighoffer
schvei...@yahoo.com wrote:
On Fri, 21 Jan 2011 10:04:56 -0500, Adam Conner-Sax
adam_conner_...@yahoo.com wrote:
Thanks!
I tried to apply that patch and rebuild phobos (I changed the file,
remade
libphobos2.a, put it in
On Fri, 21 Jan 2011 09:08:58 -0500, Sean Eskapp eatingstap...@gmail.com
wrote:
How does one avoid code duplication in a snippet code like this:
class A{}
void foo(const A, void delegate(const A) fn)
{
// some stuff
// ...
// ...
}
void foo(A, void delegate(A) fn)
{
On 1/20/11 5:48 PM, Jacob Carlborg wrote:
On 2011-01-20 21:34, Steven Schveighoffer wrote:
On Thu, 20 Jan 2011 15:03:55 -0500, Jacob Carlborg d...@me.com wrote:
On 2011-01-20 19:18, Steven Schveighoffer wrote:
On Thu, 20 Jan 2011 13:07:58 -0500, Jacob Carlborg d...@me.com wrote:
On
templates:
void foo(T)(T, void delegate(T) fn)
{
}
This parameterizes foo based on T, which could be A, const A, or int, or
whatever works to compile the function.
What if the parameters are more general, for instance the first parameter is
always a Foo, the second is a delegate which
On Friday, January 21, 2011 12:36:23 Ary Manzana wrote:
On 1/20/11 5:48 PM, Jacob Carlborg wrote:
On 2011-01-20 21:34, Steven Schveighoffer wrote:
On Thu, 20 Jan 2011 15:03:55 -0500, Jacob Carlborg d...@me.com wrote:
On 2011-01-20 19:18, Steven Schveighoffer wrote:
On Thu, 20 Jan 2011
On Friday, January 21, 2011 05:18:15 tamir wrote:
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - .fragment;
scope(success) {
std.file.rename(tempFilename, filename);
}
auto f = File(tempFilename, w);
}
Hi, I'm trying to override Object's toString. I've noted it isn't a
const method, namely:
string toString() const;
This cause me troubles when using it on a const reference.
Shouldn't it be const?
Thanks,
Tom;
Sean Eskapp Wrote:
templates:
void foo(T)(T, void delegate(T) fn)
{
}
This parameterizes foo based on T, which could be A, const A, or int, or
whatever works to compile the function.
What if the parameters are more general, for instance the first parameter is
always a Foo,
Tom Wrote:
Hi, I'm trying to override Object's toString. I've noted it isn't a
const method, namely:
string toString() const;
This cause me troubles when using it on a const reference.
Shouldn't it be const?
Thanks,
Tom;
Phobos hasn't become very const aware. There have been bugs
When there are multiple calls that can fail, and where I have to do
clean-up code in a certain order and under certain conditions I use
scope(exit). For example:
import std.stdio;
import std.exception;
void main()
{
foo();
}
enum NoError = true;
bool Initialize() { return true; }
bool
On Friday, January 21, 2011 13:02:56 Tom wrote:
Hi, I'm trying to override Object's toString. I've noted it isn't a
const method, namely:
string toString() const;
This cause me troubles when using it on a const reference.
Shouldn't it be const?
Thanks,
Tom;
It's a long-standing
On Friday, January 21, 2011 14:49:44 Andrej Mitrovic wrote:
When there are multiple calls that can fail, and where I have to do
clean-up code in a certain order and under certain conditions I use
scope(exit). For example:
import std.stdio;
import std.exception;
void main()
{
foo();
On Friday, January 21, 2011 14:12:18 Andrej Mitrovic wrote:
import std.stdio;
import std.concurrency;
void foo(int var)
{
}
bool bar(int var)
{
return true;
}
void barWrapper(int var)
{
bar(var);
}
void main()
{
spawn(foo, 1);
spawn(barWrapper, 1);
Jesse Phillips:
So I do believe it should be const, but between the other priorities, and
possible signature change for toString, it isn't done yet.
There also the idea of introducing the writeTo() standard method, that's neat
:-)
Bye,
bearophile
Sorry, I should be careful with the word side-effects. What I meant
was the newly spawned thread does its own job that the main thread
doesn't care much about. It doesn't touch main's state or any shared
variables. It does some work other than return a value. But the
function I wanted the new
On 01/21/2011 09:56 PM, Jonathan M Davis wrote:
On Friday, January 21, 2011 05:18:15 tamir wrote:
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - .fragment;
scope(success) {
std.file.rename(tempFilename,
The following code yields results as commented.
import std.stdio;
class A
{
int b;
}
void main()
{
const A a = new A;
writeln(typeof(a).stringof); // const(A)
writeln(typeof(a.b).stringof); // const(int)
writeln((const A).stringof); // const(A)
Sean Eskapp wrote:
The following code yields results as commented.
import std.stdio;
class A
{
int b;
}
void main()
{
const A a = new A;
writeln(typeof(a).stringof); // const(A)
writeln(typeof(a.b).stringof); // const(int)
writeln((const A).stringof); // const(A)
1 - 100 of 109 matches
Mail list logo