Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-18 Thread spir
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();

Re: Too much flexibility is dangerous for large systems

2011-01-18 Thread spir
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

about float double

2011-01-18 Thread spir
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

Re: More Unicode fun

2011-01-17 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and

2011-01-17 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and

2011-01-17 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-17 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-17 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-17 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-17 Thread spir
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

Re: repeat

2011-01-17 Thread spir
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

Re: repeat

2011-01-17 Thread spir
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

Re: repeat

2011-01-17 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-17 Thread spir
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

Re: repeat

2011-01-17 Thread spir
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

Re: VLERange: a range in between BidirectionalRange andRandomAccessRange

2011-01-16 Thread spir
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.)

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-14 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-14 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-14 Thread spir
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},

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-14 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-14 Thread 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

VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-14 Thread spir
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

Unicode's proper level of abstraction? [was: Re: VLERange:...]

2011-01-13 Thread spir
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

Re: What are we missing, in terms of tool support?

2011-01-13 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-13 Thread spir
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

Re: DVCS (was Re: Moving to D)

2011-01-13 Thread spir
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,

Re: Unicode's proper level of abstraction? [was: Re: VLERange:...]

2011-01-13 Thread spir
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

D2's actual state [was: Re: website layout]

2011-01-13 Thread spir
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.

Re: Unicode's proper level of abstraction? [was: Re: VLERange:...]

2011-01-13 Thread spir
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

Re: What are we missing, in terms of tool support?

2011-01-13 Thread spir
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

Re: Unicode's proper level of abstraction? [was: Re: VLERange:...]

2011-01-13 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-13 Thread spir
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

Re: eliminate junk from std.string?

2011-01-12 Thread spir
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

Re: eliminate junk from std.string?

2011-01-12 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-12 Thread spir
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

Re: About std.container.RedBlackTree

2011-01-11 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-11 Thread spir
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

Re: eliminate junk from std.string?

2011-01-11 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-11 Thread spir
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

Re: eliminate junk from std.string?

2011-01-11 Thread spir
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

Re: eliminate junk from std.string?

2011-01-11 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-11 Thread spir
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

Re: eliminate junk from std.string?

2011-01-11 Thread spir
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

D standard style [was: Re: eliminate junk from std.string?]

2011-01-11 Thread spir
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

Re: eliminate junk from std.string?

2011-01-11 Thread spir
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

Re: VLERange: a range in between BidirectionalRange and RandomAccessRange

2011-01-11 Thread spir
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); //

Re: File.size() is a ulong

2011-01-09 Thread spir
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

use of regex

2011-01-09 Thread spir
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

use of regex -- PS

2011-01-09 Thread spir
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

Re: memoize -- AAs don't work for ubyte[4] keys

2011-01-04 Thread spir
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

Re: Is this a viable effort? The DRY principle, community-wide

2011-01-04 Thread spir
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

Re: About some bugs

2011-01-04 Thread spir
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));

terminology: l-value r-value

2011-01-04 Thread spir
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

Re: terminology: l-value r-value

2011-01-04 Thread spir
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

Re: property-like data members

2011-01-03 Thread spir
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

Re: property-like data members

2011-01-03 Thread spir
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,

Re: property-like data members

2011-01-03 Thread spir
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

Re: std.unittests for (final?) review

2011-01-03 Thread spir
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

Re: std.unittests for (final?) review

2011-01-03 Thread spir
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

Re: Dynamic D

2011-01-03 Thread spir
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

Re: Nimrod language

2011-01-02 Thread spir
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

Re: Nimrod language

2011-01-02 Thread spir
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

Re: Advocacy (Was: Who here actually uses D?)

2011-01-02 Thread spir
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

Re: Less commas

2011-01-02 Thread spir
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

Re: Less commas

2011-01-02 Thread spir
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

Re: While we were discussing lambda syntax..

2011-01-01 Thread spir
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,

'$' and opDollar

2011-01-01 Thread spir
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

Re: '$' and opDollar

2011-01-01 Thread spir
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

Re: Nimrod language

2011-01-01 Thread spir
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

Re: dmd compile with imported modules

2011-01-01 Thread spir
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

Re: PROPOSAL: Implicit conversions of integer literals to floating point

2010-12-30 Thread spir
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

range practicle use

2010-12-30 Thread spir
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

Re: Something Go and Scala syntax

2010-12-30 Thread spir
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

Re: Something Go and Scala syntax

2010-12-30 Thread spir
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

Re: Something Go and Scala syntax

2010-12-30 Thread spir
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

Re: range practicle use

2010-12-30 Thread spir
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

Re: PROPOSAL: Implicit conversions of integer literals to floating

2010-12-30 Thread spir
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

Re: PROPOSAL: Implicit conversions of integer literals to floating

2010-12-30 Thread spir
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

Re: Examples using Tango

2010-12-30 Thread spir
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.

discrimination of constructors with same number of parameters

2010-12-30 Thread spir
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:

Re: discrimination of constructors with same number of parameters

2010-12-30 Thread spir
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

Re: discrimination of constructors with same number of parameters

2010-12-30 Thread spir
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

Re: discrimination of constructors with same number of parameters

2010-12-30 Thread spir
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

Re: discrimination of constructors with same number of parameters

2010-12-30 Thread spir
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

Re: discrimination of constructors with same number of parameters

2010-12-30 Thread spir
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

Re: discrimination of constructors with same number of parameters

2010-12-30 Thread spir
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

member access times

2010-12-29 Thread spir
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 =

Re: Clay language

2010-12-29 Thread spir
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 ]));

Re: Clay language

2010-12-29 Thread spir
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

Re: Clay language

2010-12-29 Thread spir
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

Re: streaming redux

2010-12-29 Thread spir
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

Re: Clay language

2010-12-29 Thread spir
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

Re: Clay language

2010-12-29 Thread spir
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

Re: dynamic array capacity

2010-12-29 Thread spir
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

Re: dynamic array capacity

2010-12-29 Thread spir
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

Re: dynamic array capacity

2010-12-29 Thread spir
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

Re: ChainImpl save method

2010-12-29 Thread spir
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

Re: Phobos usability with text files

2010-12-28 Thread spir
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

Re: Phobos usability with text files

2010-12-28 Thread spir
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

Re: auto init what the code means

2010-12-27 Thread spir
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

<    4   5   6   7   8   9   10   11   12   13   >