On 01/18/2011 06:14 PM, Michel Fortin wrote:
On 2011-01-18 11:38:45 -0500, Andrei Alexandrescu
seewebsiteforem...@erdani.org said:
I was thinking along the lines of:
struct Grapheme
{
private string support_;
...
}
struct ByGrapheme
{
private string iteratee_;
bool empty();
Grapheme front();
On 01/19/2011 01:26 AM, dsimcha wrote:
On 1/18/2011 7:46 AM, spir wrote:
Think at Lisp, for instance, probably one of the most simple languages
ever. This simplicity, precisely, forces to create tons of abstraction
levels just to define notions not present in the language --due to
simplicity
Hello,
Is there somewhere a (clear) doc about float/double internals?
Some more particuliar questions:
What is the internal bit layout? (mantissa, sign, exponent)
Can I assume the integral range is [-2^(m-1) .. 2^⁽m-1)-1], where m is
the number of mantissa bits?
What are the values used to
On 01/14/2011 11:29 PM, foobar wrote:
So it's definitly possible in Hebrew to have more than one combining mark on
the same base letter. When comparing such letters the order of the combining
marks should not matter and I think there's a default normalized order in such
cases.
Unicode
On 01/15/2011 08:51 PM, Steven Schveighoffer wrote:
More over, Even if you ignore Hebrew as a tiny insignificant minority
you cannot do the same for Arabic which has over one *billion* people
that use that language.
I hope that the medium type works 'good enough' for those languages,
with the
e.g. Normalization.
As Spir already said, Unicode is something few understand and even it's own
official docs do not explain such issues properly. We should not confuse users
even further with incomplete support.
In a few days, D will have an external library able to deal with those
issues
On 01/14/2011 04:50 PM, Michel Fortin wrote:
This might be a good time to see whether we need to address graphemes
systematically. Could you please post a few links that would educate
me and others in the mysteries of combining characters?
As usual, Wikipedia offers a good summary and a couple
On 01/15/2011 12:21 AM, Michel Fortin wrote:
Also, it'd really help this discussion to have some hard numbers about
the cost of decoding graphemes.
Text has a perf module that provides such numbers (on different stages
of Text object construction) (but the measured algos are not yet
On 01/17/2011 06:36 PM, Andrei Alexandrescu wrote:
On 1/17/11 10:55 AM, spir wrote:
On 01/15/2011 12:21 AM, Michel Fortin wrote:
Also, it'd really help this discussion to have some hard numbers about
the cost of decoding graphemes.
Text has a perf module that provides such numbers
On 01/17/2011 04:00 PM, Andrei Alexandrescu wrote:
On 1/17/11 6:44 AM, Steven Schveighoffer wrote:
We need to get some real numbers together. I'll see what I can create
for a type, but someone else needs to supply the input :) I'm on short
supply of unicode data, and any attempts I've made to
On 01/17/2011 07:10 PM, Andrei Alexandrescu wrote:
I want to generalize the functionality in string's repeat and move it
outside std.string. There is an obvious semantic clash here. If you say
repeat(abc, 3) did you mean one string abcabcabc or three strings
abc, abc, and abc?
So we need
On 01/17/2011 07:53 PM, Adam Ruppe wrote:
It seems to me that you actually want two separate functions:
repeat(abc, 3) = [abc, abc, abc]
join(repeat(abc, 3)) = abcabcabc
Would rather see:
repeat(abc, 3) = [abc, abc, abc]
abc * 3= abcabcabc
Denis
_
vita es estrany
On 01/17/2011 09:15 PM, Jonathan M Davis wrote:
On Monday, January 17, 2011 10:59:16 spir wrote:
On 01/17/2011 07:53 PM, Adam Ruppe wrote:
It seems to me that you actually want two separate functions:
repeat(abc, 3) = [abc, abc, abc]
join(repeat(abc, 3)) = abcabcabc
Would rather see
On 01/17/2011 07:57 PM, Andrei Alexandrescu wrote:
On 1/17/11 12:23 PM, spir wrote:
Andrei, would you have a look at Text's current state, mainly
theinterface, when you have time for that (no hurry) at
https://bitbucket.org/denispir/denispir-d/src
It is actually a bit more than just a string
On 01/17/2011 07:57 PM, Daniel Gibson wrote:
IMHO * (multiply) is not good because in theoretical computer science
multiply is used to concatenate two words and thus concatenating a word
with itself n times is word^n (pow(word, n) in mathematical terms).
Weird. Excuse my ignorance, but how can
On 01/14/2011 08:20 PM, Nick Sabalausky wrote:
spirdenis.s...@gmail.com wrote in message
news:mailman.619.1295012086.4748.digitalmar...@puremagic.com...
If anyone finds a pointer to such an explanation, bravo, and than you.
(You will certainly not find it in Unicode literature, for instance.)
On 01/14/2011 05:23 AM, Andrei Alexandrescu wrote:
That's forgetting that most of the time people care about graphemes
(user-perceived characters), not code points.
I'm not so sure about that. What do you base this assessment on? Denis
wrote a library that according to him does
On 01/14/2011 07:26 AM, Nick Sabalausky wrote:
Andrei Alexandrescuseewebsiteforem...@erdani.org wrote in message
news:igoj6s$17r6$1...@digitalmars.com...
I'm not so sure about that. What do you base this assessment on? Denis
wrote a library that according to him does grapheme-related stuff
On 01/14/2011 07:44 AM, Nick Sabalausky wrote:
Andrei Alexandrescuseewebsiteforem...@erdani.org wrote in message
news:igoqrm$1n5r$1...@digitalmars.com...
On 1/13/11 10:26 PM, Nick Sabalausky wrote:
[snip]
[ 'f', {u with the umlaut}, 'n', 'f' ]
Or:
[ 'f', 'u', {umlaut combining character},
that according to him does grapheme-related stuff nobody
else does. So apparently graphemes is not what people care about
(although
it might be what they should care about).
It's what they want, they just don't know it.
Graphemes are what many people *think* code points are.
Agreed. Up until spir
On 01/14/2011 02:37 PM, Steven Schveighoffer wrote:
* I don't even know how to make a grapheme that is more than one
code-unit, let alone more than one code-point :) Every time I try, I
get 'invalid utf sequence'.
I feel significantly ignorant on this issue, and I'm slowly getting
enough
On 01/14/2011 07:26 AM, Nick Sabalausky wrote:
Andrei Alexandrescuseewebsiteforem...@erdani.org wrote in message
news:igoj6s$17r6$1...@digitalmars.com...
I'm not so sure about that. What do you base this assessment on?
Denis
wrote a library that according to him does grapheme-related
On 01/13/2011 01:45 AM, Michel Fortin wrote:
On 2011-01-12 14:57:58 -0500, spir denis.s...@gmail.com said:
On 01/12/2011 08:28 PM, Don wrote:
I think the only problem that we really have, is that char[],
dchar[] implies that code points is always the appropriate level of
abstraction.
I'd
On 01/13/2011 01:56 AM, Andrej Mitrovic wrote:
I don't want to make this Vim-specific, so I'm wondering what features are we
missing in today's D editors/IDE's that other languages already have in their
editors/IDE's?
For what it's worth, Geany works very nicely with D out of the box (it's
On 01/13/2011 01:51 AM, Michel Fortin wrote:
On 2011-01-12 19:45:36 -0500, Michel Fortin michel.for...@michelf.com
said:
A funny exercise to make a fool of an algorithm working only with code
points would be to replace the word fortune in a text containing the
word fortuné. If the last é is
On 01/13/2011 04:43 AM, Walter Bright wrote:
Andrej Mitrovic wrote:
On 1/12/11, Jean Crystof n...@news.com wrote:
Claiming that low end components have shorter lifespan is ridiculous.
You've never had computer equipment fail on you?
I've had a lot of computer equipment.
Failures I've had,
On 01/13/2011 11:16 AM, Jonathan M Davis wrote:
On Thursday 13 January 2011 01:49:31 spir wrote:
On 01/13/2011 01:45 AM, Michel Fortin wrote:
On 2011-01-12 14:57:58 -0500, spirdenis.s...@gmail.com said:
On 01/12/2011 08:28 PM, Don wrote:
I think the only problem that we really have
On 01/13/2011 11:15 AM, Don wrote:
Also I don't understand why http://www.digitalmars.com/d/2.0/
comparison.html only contains 1 column for D and no other languages so
you can directly see what they are all missing.
It used to contain several languages. It was removed due to intense
criticism.
On 01/13/2011 01:10 PM, Jonathan M Davis wrote:
I wasn't saying that code points are guaranteed to be characters. I was saying
that in most cases they are, so if efficiency is an issue, then having properly
abstract characters could be too costly.
The problem is then: how does a library or
On 01/13/2011 04:24 PM, Andrej Mitrovic wrote:
On 1/13/11, spirdenis.s...@gmail.com wrote:
May share my settings for D if anyone interested.
Well if you do, share them here:
http://prowiki.org/wiki4d/wiki.cgi?EditorSupport/Geany so everyone can
find it.
Well, I don't mind sharing them, but
On 01/13/2011 02:47 PM, Michel Fortin wrote:
On 2011-01-13 06:48:46 -0500, spir denis.s...@gmail.com said:
Note that D's stdlib currently provides no means to do this, not even
on the fly. You'd have to interface with eg ICU (a C/C++/Java Unicode
library) (good luck ;-). But even ICU, as well
On 01/13/2011 11:00 PM, Nick Sabalausky wrote:
Andrei Alexandrescuseewebsiteforem...@erdani.org wrote in message
news:ignon1$2p4k$1...@digitalmars.com...
This may sometimes not be what the user expected; most of the time they'd
care about the code points.
I dunno, spir has succesfuly
On 01/12/2011 07:22 AM, Jerry Quinn wrote:
Jerry Quinn Wrote:
Same comment for icmp(). Also, in the Unicode standard, case folding can
depend on the specific language.
That uses toUniLower. Not sure how that works.
And doesn't mention details about the Unicode standard version it
On 01/12/2011 07:22 AM, Jerry Quinn wrote:
Jerry Quinn Wrote:
Same comment for icmp(). Also, in the Unicode standard, case folding can
depend on the specific language.
That uses toUniLower. Not sure how that works.
And doesn't mention details about the Unicode standard version it
On 01/12/2011 08:28 PM, Don wrote:
I think the only problem that we really have, is that char[],
dchar[] implies that code points is always the appropriate level of
abstraction.
I'd like to know when it happens that codepoint is the appropriate level
of abstraction.
* If pieces of text are
On 01/11/2011 02:22 PM, Steven Schveighoffer wrote:
A tree is a kind of set, so instead of insert() I'd like a name like
add().
(But maybe this is not standard in D).
The function names must be consistent across containers, because the
point is that complexity and semantic requirements are
On 01/11/2011 05:36 PM, Andrei Alexandrescu wrote:
On 1/11/11 4:41 AM, Michel Fortin wrote:
On 2011-01-10 22:57:36 -0500, Andrei Alexandrescu
seewebsiteforem...@erdani.org said:
In addition to these (and connecting the two), a VLERange would offer
two additional primitives:
1. size_t
On 01/11/2011 04:11 PM, Max Samukha wrote:
Anyway, the necessity for super-cryptic abbreviated names doesn't exist
any more. Maybe, they are justified for very frequently used stuff but
stripl/stripr is not the case.
+++
Standard names should all be as obvious as possible. Then, everyone is
On 01/11/2011 02:30 PM, Steven Schveighoffer wrote:
On Mon, 10 Jan 2011 22:57:36 -0500, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
I've been thinking on how to better deal with Unicode strings.
Currently strings are formally bidirectional ranges with a
surreptitious random access
On 01/11/2011 07:14 PM, Nick Sabalausky wrote:
Daniel Gibsonmetalcae...@gmail.com wrote in message
news:igi6n5$27p...@digitalmars.com...
Am 11.01.2011 19:07, schrieb Nick Sabalausky:
Thoust words are true.
Seriously though, I'm pretty sure a lot of native english speakers don't
know sans
On 01/11/2011 07:01 PM, Nick Sabalausky wrote:
The names are for compatibility with... other languages :o|.
Would that other language be Walterish or C?
If C, it's not like using the wrong case will suddendly change the semantics
of the function. And if the worry is other non-phobos functions
On 01/11/2011 08:09 PM, Andrei Alexandrescu wrote:
The main (and massively ignored) issue when manipulating unicode text is
rather that, unlike with legacy character sets, one codepoint does *not*
represent a character in the common sense. In character sets like
latin-1:
* each code represents a
On 01/11/2011 09:11 PM, Ary Borenszweig wrote:
Welcome to D. Do you program in C, Javascript, Python or Ruby? Cool! Then you
will feel at home.
That phrase currently ends like this:
You don't? Oh, sorry, you will have to learn that some names are all lowercase,
some not.
But it could end like
On 01/12/2011 12:07 AM, Daniel Gibson wrote:
Am 12.01.2011 00:00, schrieb Andrei Alexandrescu:
On 1/11/11 11:21 AM, Ary Borenszweig wrote:
Why care where they come from? Why not make them intuitive? Say, like,
Always
camel case?
If there's enough support for this, I'll do it.
Andrei
On 01/12/2011 02:17 AM, Daniel Gibson wrote:
Somewhere in this thread:
Am 11.01.2011 21:43, schrieb Walter Bright:
Nick Sabalausky wrote:
I agree with this reasoning for having them. However, I don't think it
means we shouldn't D-ify or Phobos-ify them, at least as far as
capitalization
On 01/12/2011 02:22 AM, Andrei Alexandrescu wrote:
IIUC, for the case of text, VLERange helps abstracting from the annoying
fact that a codepoint is encoded as a variable number of code units.
What I meant is issues like:
auto text = a\u0302d;
writeln(text); // â
auto range = VLERange(text);
//
On Sun, 09 Jan 2011 08:29:47 -0500
bearophile bearophileh...@lycos.com wrote:
From a recent update in File I've seen that size() returns an ulong, given by
seek():
http://www.dsource.org/projects/phobos/browser/trunk/phobos/std/stdio.d?rev=2284#L585
Hello,
After getting a MatchResult by calling match(source, engine): Seems that, if
match has failed, calling result.hit() throws an assertion error. Then, how can
I know whether match was successful? As there is always a matchResult object
returned. I'm looking for a kind of success.failure
Hello again,
I also have an issue with the func 'match': instead of simply trying to match
and fail if not found, it seems to search for a matching snippet all along the
source: what a method 'find' or 'search' usually does, as opposed to 'match'
precisely. Thus, i'm forced to prefix all regex
On Mon, 03 Jan 2011 23:27:22 -0600
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:
Nevertheless, I found two issues: one, ParameterTypeTuple doesn't work
for overloaded functions, and associative arrays don't work for ubyte[4]
keys... still a ways to go.
Could you or someone else
On Tue, 4 Jan 2011 02:30:24 -0200
Guilherme Vieira n2.nitro...@gmail.com wrote:
At times like this I wish people would really break their code in smaller
parts in a way you could really just pick what you want from it.
I guess this is a dream generations of programmers, language designers and
On Tue, 04 Jan 2011 07:34:15 -0500
bearophile bearophileh...@lycos.com wrote:
An example of bug (more than 14 like this fixed in few years):
- memset(pp, 0, sizeof(pp));
+ memset(pp, 0, sizeof(*pp));
- memcpy((caddr_t)TstSchedTbl, (caddr_t)vcIndex,sizeof(TstSchedTbl));
Hello,
I'm bluffed by the 2 terms l-value r-value used in C-line language common
terminologies. I think I guess what they mean, but I don't understand the need
for such absconse idioms. Why not:
l-value - variable
r-value - value (or expression)
?
I guess (*p) is considered an
On Tue, 4 Jan 2011 17:56:53 + (UTC)
Manfred_Nowak svv1...@hotmail.com wrote:
They describe which side of the equation they are on
arg, no! please replace equation by assignExpression.
lol, great! this is one of the reasons why in my dream language, assignment
would be denoted by any
On Mon, 03 Jan 2011 00:55:47 -0500
Robert Jacques sandf...@jhu.edu wrote:
On Sun, 02 Jan 2011 05:29:48 -0500, spir denis.s...@gmail.com wrote:
Hello,
Using properties allows travesting a method call into direct data
access. What if the underlying member actually is plain data? Would
On Mon, 03 Jan 2011 08:34:42 -0500
Steven Schveighoffer schvei...@yahoo.com wrote:
Yes, just use a data member:
struct MyRange {
int front;
bool empty;
void popFront();
}
A property is actually supposed to work just like a field.
There is no need for new syntax.
Hum,
On Mon, 03 Jan 2011 10:27:17 -0500
Steven Schveighoffer schvei...@yahoo.com wrote:
On Mon, 03 Jan 2011 09:56:30 -0500, spir denis.s...@gmail.com wrote:
On Mon, 03 Jan 2011 08:34:42 -0500
Steven Schveighoffer schvei...@yahoo.com wrote:
Yes, just use a data member:
struct MyRange
On Mon, 03 Jan 2011 12:27:33 -0800
Walter Bright newshou...@digitalmars.com wrote:
On the other hand, the built-in D unit test ability has been a huge success.
A unit test facility that is not used is worthless, no matter how capable it
is.
The advantage of it being simple and built-in is
On Mon, 3 Jan 2011 22:11:34 +0100
Andrej Mitrovic andrej.mitrov...@gmail.com wrote:
Offtopic (sry): On the other hand, D could do the same for the build
process. Bringing RDMD's abilities to DMD would simplify the build
process for many people.
+++
Newcomers (like myself) can meet rdmd quite
On Mon, 3 Jan 2011 22:23:29 + (UTC)
Adam Ruppe destructiona...@gmail.com wrote:
Over the weekend, I attacked opDispatch again and found some old
Variant bugs were killed. I talked about that in the Who uses D
thread.
Today, I couldn't resist revisiting a dynamic kind of object, and
On Sat, 01 Jan 2011 18:36:17 -0500
bearophile bearophileh...@lycos.com wrote:
spir:
(Even reproduced elif
Python doesn't have the switch statement, so to write a switch you sometimes
use a sequence of if statements, in this case elif helps keep the code more
tidy:
x = 3
if x == 0
On Sun, 02 Jan 2011 01:46:46 -0500
bearophile bearophileh...@lycos.com wrote:
My fantasy: bearophile goes to the Nimrod forum and says Hey, how about
this D language, seems interesting... :o)
That fantasy of yours means that I am interested in using my time to explain
to Nimrod
On Sun, 2 Jan 2011 10:19:48 +0100
Gour g...@atmarama.net wrote:
Caligo So why is D being advertised as a systems programming
Caligo language? By saying Linus would not find D appealing you are
Caligo basically saying kernel developers would not find it appealing.
Do Linus co. have to
On Sun, 02 Jan 2011 20:56:48 +
Peter Alexander peter.alexander...@gmail.com wrote:
This is great stuff, bearophile. Thanks for finding that. Please add
this as an enhancement request to bugzilla (disallowing (!xy)
expressions).
That really surprises me that it's a common bug. Isn't
On Sun, 02 Jan 2011 13:21:33 -0800
Walter Bright newshou...@digitalmars.com wrote:
That's the interesting part, and why I suggested that studying recurring
patterns of real life bugs is productive. What we think might be a problem vs
what actually is a problem can be very different.
Thank
On Sat, 1 Jan 2011 09:56:25 +0100
Philippe Sigaud philippe.sig...@gmail.com wrote:
As I said in the docs, I got stuck at comparison operators. a b is
automatically transformed by the compiler into a.opCmp(b) 0.
a.opCmp(b) becomes another lambda and the ' 0' part triggers another
expansion,
Hello,
[This is another currently unfixed point of D2 that prevents us implementing
our project the way we wish it.]
AFAIK, using '$' for custom collection types is not yet possible: oDollar is
simply not implemented (correct?). But why do we need it? I do not understand
the logic requiring
On Sat, 01 Jan 2011 19:27:57 +0100
Don nos...@nospam.com wrote:
AFAIK, using '$' for custom collection types is not yet possible: oDollar
is simply not implemented (correct?). But why do we need it? I do not
understand the logic requiring an opDollar special method to desugarise
the
This language looks *very* interesting and sensibly designed. The author seems
to have taken, in addition to much input from C-like languages and Python, the
best of the Pascal line tradition. Also, he obviously dared getting rid of
some legacy garbage. Unfortunately, not all, and took dome
On Sat, 1 Jan 2011 13:34:47 + (UTC)
useo u...@start.bg wrote:
Hey guys,
I've the following problem... when I write a simple class, for
example:
...
module myclasses.exampleClass;
class exampleClass {
void writeHelloWorld() {
writeln(Hello World);
}
And import
On Thu, 30 Dec 2010 07:46:19 +0100
Don nos...@nospam.com wrote:
This problem has already hit Phobos. We inserted a hack so that sqrt(2)
will work. But exp(1) doesn't work.
Note that the problems really arise because we've inherited C's rather
cavalier approach to implicit conversion.
I'm
Hello,
In the course of a project (1) 2 partner D programmers and myself are currently
implementing, we faced 2 issues which prevented us using a range interface as
planned. We initially intended to do it for better compliance with D's coming
new style, and nice inter-relation with Phobos
On Thu, 30 Dec 2010 05:55:13 -0500
bearophile bearophileh...@lycos.com wrote:
An alternative is to use Go syntax, and use the Pascal-like := to denote a
value assignment (function signature can't use := ).
Here there is another idea from Go syntax: if the then clause of the if
uses {} then
On Thu, 30 Dec 2010 13:19:52 + (UTC)
Adam Ruppe destructiona...@gmail.com wrote:
=== back to the main point ===
Of course, I'm sure there's dozens of editors with a similar feature.
There might also be an existing option or plugin in your current
editor of choice. It's worth
On Thu, 30 Dec 2010 15:15:32 + (UTC)
Adam Ruppe destructiona...@gmail.com wrote:
My guess is programmers spend ~ half of their time thinking, a
quarter of their time controlling another quarter fixing;
the rest, typing.
I don't know about that! If my personal vices are any
On Thu, 30 Dec 2010 11:19:33 -0600
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:
On 12/30/10 6:41 AM, spir wrote:
Hello,
In the course of a project (1) 2 partner D programmers and myself are
currently implementing, we faced 2 issues which prevented us using a
range
On Thu, 30 Dec 2010 21:13:05 +0100
Don nos...@nospam.com wrote:
Yes, but OCaML isn't a C-family language, inheriting C's broken
treatment of literals.
Just for information (I really mean information, not starting a new
discussion): was it proposed to let down such legacy mess form C at the
On Thu, 30 Dec 2010 14:34:45 -0600
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:
Then people probably need to use sqrt(2.0) or sqrt(cast(double)2).
I've got a lot of sympathy for the first alternative (absolutely NONE
for the second!). But unfortunately, the language allows
On Thu, 30 Dec 2010 01:42:27 -0500
bearophile bearophileh...@lycos.com wrote:
Overall, it sounds like no one should be using D2 yet unless they have a
fetish for arrowhead wounds in their back.
Well, I don't have this impression in practice. Sure, on D lists, we discuss
only the issues.
Hello,
When 2 constructors (*) accept the same number of parameters, the only
remaining discrimination is type. Right? But some language types (or machine
types) can have very diverse _human_ semantics, and thus be used for various
purposes which should, but cannot, be considered different:
On Thu, 30 Dec 2010 03:01:52 -0800
Jonathan M Davis jmdavisp...@gmx.com wrote:
On Thursday 30 December 2010 02:50:55 spir wrote:
Hello,
When 2 constructors (*) accept the same number of parameters, the only
remaining discrimination is type. Right? But some language types
something to solve problems
like spir ones.
and it would be a pretty fragile one IMHO anyway.
Please, explain better.
Bye,
bearophile
As far as I know, typedef was a form of discriminated alias. I don't know
the reasons for its deprecation. It just occurred to me that D's
concrete has come out yet. I hope to see something to solve
problems like spir ones.
and it would be a pretty fragile one IMHO anyway.
Please, explain better.
Bye,
bearophile
As far as I know, typedef was a form of discriminated alias. I don't
know the reasons for its
On Thu, 30 Dec 2010 08:15:51 -0500
bearophile bearophileh...@lycos.com wrote:
But some language types (or machine types) can have very diverse _human_
semantics, and thus be used for various purposes which should, but cannot,
be considered different:
You may wrap your data in a
On Thu, 30 Dec 2010 17:10:00 +0100
Jérôme M. Berger jeber...@free.fr wrote:
Steven Schveighoffer wrote:
What I would suggest is static factory methods. The issue with any kind
of typedef (be it with the soon-to-be-deprecated typedef keyword or with
a proxy struct), is that what does this
On Thu, 30 Dec 2010 16:33:39 -0200
Guilherme Vieira n2.nitro...@gmail.com wrote:
When I create factory methods like those proposed in this thread, I feel
like I'm hijacking a core aspect of the language. Goddamn it, it's the
constructor! IMHO, everybody expects to construct things.. using
Hello,
Out of curiosity, I did some timings of data function member access on
structs classes. Actually, to check whether (explicity) referenced structs
would ~ behave like classes in this respect, I added a struct element allocated
via
auto ps = cast(S*)(GC.malloc(S.sizeof));
*ps =
On Tue, 28 Dec 2010 14:38:56 +0300
Stanislav Blinov stanislav.bli...@gmail.com wrote:
Taking an example from std.algorithm documentation:
1)
int[] arr1 = [ 1, 2, 3, 4 ];
int[] arr2 = [ 5, 6 ];
auto squares = map!(a * a)(chain(arr1, arr2));
assert(equal(squares, [ 1, 4, 9, 16, 25, 36 ]));
On Tue, 28 Dec 2010 16:01:24 + (UTC)
Adam D. Ruppe destructiona...@gmail.com wrote:
While you read a module code you don't know where the imported names it
uses come from.
That's a feature.
[...]
I started off by writing it all in one module, the one where it
was used. That was ok
On Tue, 28 Dec 2010 18:37:37 +0100
Andrej Mitrovic andrej.mitrov...@gmail.com wrote:
On 12/28/10, Adam Ruppe destructiona...@gmail.com wrote:
That's not the only bad part. It also means refactoring your modules
requires changes to the user code too. See my other post here:
Actually, D is
On Wed, 29 Dec 2010 11:02:23 -0500
Steven Schveighoffer schvei...@yahoo.com wrote:
stdout is currently implemented via C's FILE * to allow interleaving of C
output and D output. However, FILE * has some limitations that may hinder
performance. If you don't care about interleaving C and D
On Wed, 29 Dec 2010 14:40:31 + (UTC)
Adam Ruppe destructiona...@gmail.com wrote:
(Name qualification in code, I mean at use place, is best used for
std or third-party lib, I guess.
I don't see a difference between the two. If the source module
matters, it matters if it is third
On Wed, 29 Dec 2010 19:24:12 +0100
Andrej Mitrovic andrej.mitrov...@gmail.com wrote:
But I really don't see the benefit of changing the semantics of
import. You won't get shot in the foot since D offers good protection
from function hijacking.
Yes, I'm aware of this. But this (great) feature
On Wed, 29 Dec 2010 11:24:01 -0500
Steven Schveighoffer schvei...@yahoo.com wrote:
On Wed, 29 Dec 2010 07:29:29 -0500, spir denis.s...@gmail.com wrote:
Hello,
Is there a common idiom to pre-allocate a dynamic array. I mean
allocating to avoid numerous re-allocations in loop
On Wed, 29 Dec 2010 11:24:01 -0500
Steven Schveighoffer schvei...@yahoo.com wrote:
On Wed, 29 Dec 2010 07:29:29 -0500, spir denis.s...@gmail.com wrote:
Hello,
Is there a common idiom to pre-allocate a dynamic array. I mean
allocating to avoid numerous re-allocations in loop
On Wed, 29 Dec 2010 13:48:48 -0500
Steven Schveighoffer schvei...@yahoo.com wrote:
On Wed, 29 Dec 2010 13:14:29 -0500, spir denis.s...@gmail.com wrote:
I've done some timings using reserve and Appender. Seems not to work on
my use case (decomposition of a string [actually a sequence
On Wed, 29 Dec 2010 15:35:31 -0500
Steven Schveighoffer schvei...@yahoo.com wrote:
Yes. Inside a template, the name of the template is synonymous with the
template instance being instantiated.
So for example:
struct S(T)
{
void foo(){ S s; // this is of type S!T
}
}
Good
On Sun, 26 Dec 2010 12:53:29 -0500
Michel Fortin michel.for...@michelf.com wrote:
On 2010-12-26 12:13:41 -0500, Andrei Alexandrescu
seewebsiteforem...@erdani.org said:
On 12/26/10 10:12 AM, bearophile wrote:
This is related to this (closed) issue, but this time I prefer to
discuss the
On Mon, 27 Dec 2010 18:21:24 + (UTC)
Ary Borenszweig a...@esperanto.org.ar wrote:
If the function is left as is I expect questions about Why isn't this
working?
for it to appear on D.learn about 1 time each month.
Exactly like what happens with property += value and other things that
On Sun, 26 Dec 2010 14:04:28 -0800
Jonathan M Davis jmdavisp...@gmx.com wrote:
On Sunday 26 December 2010 07:08:22 Andrei Alexandrescu wrote:
On 12/26/10 8:54 AM, spir wrote:
On Sun, 26 Dec 2010 14:54:12 +0100
Andrej Mitrovicandrej.mitrov...@gmail.com wrote:
int i;// auto
801 - 900 of 1219 matches
Mail list logo