ZY Zhou Wrote:
it doesn't make sense to add try/catch every time you use
tolower/toupper/foreach
on string. No one will do that.
You either throw exception when convert invalid utf8 bytes to string, or never
throw exception and use invalid UTF32 code in dchar to represent invalid utf8
%u Wrote:
I agree with a), but not b), Can't find anything in unicode standard says
you can use the low surrogate like that
According to: http://www.cl.cam.ac.uk/~mgk25/
According to ISO 10646-1:2000, sections D.7 and 2.3c, a device
receiving UTF-8 shall interpret a malformed sequence
On Mar 14, 11 13:53, Jesse Phillips wrote:
KennyTM~ Wrote:
It is already throwing an exception called
core.exception.UnicodeException. This even provides you the index where
decoding failed.
(However Phobos is not using it, AFAIK.)
---
import core.exception, std.stdio, std.conv;
On Sunday 13 March 2011 22:45:38 ZY Zhou wrote:
it doesn't make sense to add try/catch every time you use
tolower/toupper/foreach on string. No one will do that.
You either throw exception when convert invalid utf8 bytes to string, or
never throw exception and use invalid UTF32 code in dchar
Thank you Jussi,
But still this is not part of the standard, U+FFFD is a commonly used approach,
while the U+DC80..U+DCFF is also a common solution for
that(http://en.wikipedia.org/wiki/Utf8#Invalid_byte_sequences), different
approach
solve different problems.
I think the current problem in D
On 3/13/2011 10:53 PM, %u wrote:
I tried using Visual Studio to set breakpoints in DMD and everything
(after compiling with -g), but it said that the source file is a
different version (it isn't), and so it doesn't really let me set
breakpoints.
What tools (aka debuggers) do you guys use to
You can use windbg.exe, which is in \dmd\windows\bin. Of course,
you'll also need to download the Digital Mars C++ compiler from
http://www.digitalmars.com/download/freecompiler.html
Hm... I already have WinDbg (and DMC), but I never thought it's any
more efficient to debug with WinDbg than with
On 03/14/2011 07:55 AM, ZY Zhou wrote:
Thank you Jussi,
But still this is not part of the standard, U+FFFD is a commonly used approach,
while the U+DC80..U+DCFF is also a common solution for
that(http://en.wikipedia.org/wiki/Utf8#Invalid_byte_sequences), different
approach
solve different
On 13/03/11 23.44, Andrei Alexandrescu wrote:
On 3/11/11 9:20 AM, Jonas Drewsen wrote:
Hi,
So I've spent some time trying to wrap libcurl for D. There is a lot of
things that you can do with libcurl which I did not know so I'm starting
out small.
For now I've created all the declarations for
%u Wrote:
What tools (aka debuggers) do you guys use to debug DMD?
Debugging dmd with Visual Studio works flawlessly for me.
I just cv2pdb -C it, open devenv bla\dmd.exe, set the working directory to the
D code I want to compile and then open the dmd source code to set breakpoints.
On 14/03/11 00.07, Jonathan M Davis wrote:
On Sunday 13 March 2011 14:56:34 Jonas Drewsen wrote:
On 13/03/11 18.29, dsimcha wrote:
One of the features I miss most in Phobos is support for SQLite. Several
people have written bindings and wrappers and haven't gotten much
attention. (For example:
On 14/03/11 04.33, dsimcha wrote:
On 3/13/2011 5:56 PM, Jonas Drewsen wrote:
It's a great idea. But I think there need to be some kind of janitor for
the 'etc' modules so that it does not end up as a new dsource collection
of many unmaintained, some dead and a few live projects.
I don't see
On Monday 14 March 2011 02:16:12 Jonas Drewsen wrote:
On 13/03/11 23.44, Andrei Alexandrescu wrote:
On 3/11/11 9:20 AM, Jonas Drewsen wrote:
Hi,
So I've spent some time trying to wrap libcurl for D. There is a lot of
things that you can do with libcurl which I did not know so I'm
On Monday 14 March 2011 02:24:45 Jonas Drewsen wrote:
On 14/03/11 00.07, Jonathan M Davis wrote:
On Sunday 13 March 2011 14:56:34 Jonas Drewsen wrote:
On 13/03/11 18.29, dsimcha wrote:
One of the features I miss most in Phobos is support for SQLite.
Several people have written bindings
On Mon, 14 Mar 2011 12:27:45 +0300, Trass3r u...@known.com wrote:
%u Wrote:
What tools (aka debuggers) do you guys use to debug DMD?
Debugging dmd with Visual Studio works flawlessly for me.
I just cv2pdb -C it, open devenv bla\dmd.exe, set the working directory
to the D code I want to
Jussi Jumppanen Wrote:
%u Wrote:
I agree with a), but not b), Can't find anything in unicode standard says
you can use the low surrogate like that
According to: http://www.cl.cam.ac.uk/~mgk25/
According to ISO 10646-1:2000, sections D.7 and 2.3c, a device
receiving UTF-8
On Mon, 14 Mar 2011 05:53:42 -, %u wfunct...@hotmail.com wrote:
I tried using Visual Studio to set breakpoints in DMD and everything
(after compiling with -g), but it said that the source file is a
different version (it isn't), and so it doesn't really let me set
breakpoints.
What tools
Jonas Drewsen wrote:
Hi,
So I've been working a bit on the etc.curl module. Currently most
of
the HTTP functionality is done and some very simple Ftp.
I would very much like to know if this has a chance of getting in
phobos if I finish it with the current design. If not then it will be
for
On Mon, 14 Mar 2011 02:36:07 -0700, Jonathan M Davis wrote:
On Monday 14 March 2011 02:16:12 Jonas Drewsen wrote:
On 13/03/11 23.44, Andrei Alexandrescu wrote:
On 3/11/11 9:20 AM, Jonas Drewsen wrote:
Hi,
So I've spent some time trying to wrap libcurl for D. There is a lot
of things
Lars T. Kyllingstad Wrote:
2. There are no assumptions about the type of data contained in the
array. (char[] arrays are assumed to be UTF-8 encoded.)
http has content-type, so it's known, what is contained in the array.
On Fri, 11 Mar 2011 19:27:21 -0500, dsimcha dsim...@yahoo.com wrote:
3. Streams in D should be based on input ranges, not whatever crufty
old stuff std.stream is based on.
No. I/O Ranges should be based on streams. A stream is a low level
construct that can read and/or write data. In
On Mon, 14 Mar 2011 07:20:26 -0400, Lars T. Kyllingstad
public@kyllingen.nospamnet wrote:
On Mon, 14 Mar 2011 02:36:07 -0700, Jonathan M Davis wrote:
On Monday 14 March 2011 02:16:12 Jonas Drewsen wrote:
On 13/03/11 23.44, Andrei Alexandrescu wrote:
On 3/11/11 9:20 AM, Jonas Drewsen
On Fri, 11 Mar 2011 21:29:42 -0500, dsimcha dsim...@yahoo.com wrote:
The discussion we've had here lately about reading gzipped files has
proved
rather enlightening. I therefore propose the following high-level
design for
streams, with the details to be filled in later:
1. Streams should
On 3/14/2011 8:22 AM, Steven Schveighoffer wrote:
BTW, that crufty old stuff
probably way outperforms anything you could ever do with ranges as the
base.
I don't get the concern about performance, for file I/O at least. Isn't
the main bottleneck reading it off the disk platter?
On 2011-03-13 23:36, KennyTM~ wrote:
On Mar 14, 11 02:55, Jacob Carlborg wrote:
I would say that the functions should NOT crash but instead throw an
exception. Then the developer can choose what to do when there's an
invalid unicode character.
It is already throwing an exception called
On 2011-03-14 06:45, ZY Zhou wrote:
it doesn't make sense to add try/catch every time you use
tolower/toupper/foreach
on string. No one will do that.
You either throw exception when convert invalid utf8 bytes to string, or never
throw exception and use invalid UTF32 code in dchar to represent
Daniel Gibson Wrote:
Am 14.03.2011 02:21, schrieb Nebster:
On 12/03/2011 17:23, Daniel Gibson wrote:
No reason to hate Tango.
Ok, I don't really hate Tango, I just prefer Phobos because I got used
to it first :)
This is perfectly fine :)
Just don't feed the trolls and don't let
Am 14.03.2011 14:17, schrieb dsimcha:
On 3/14/2011 8:22 AM, Steven Schveighoffer wrote:
BTW, that crufty old stuff
probably way outperforms anything you could ever do with ranges as the
base.
I don't get the concern about performance, for file I/O at least. Isn't
the main bottleneck reading
On 14/03/11 12.10, Johannes Pfau wrote:
Jonas Drewsen wrote:
Hi,
So I've been working a bit on the etc.curl module. Currently most
of
the HTTP functionality is done and some very simple Ftp.
I would very much like to know if this has a chance of getting in
phobos if I finish it with the
On 2011-03-13 22:39, Jonas Drewsen wrote:
Hi,
So I've been working a bit on the etc.curl module. Currently most of the
HTTP functionality is done and some very simple Ftp.
I would very much like to know if this has a chance of getting in phobos
if I finish it with the current design. If not
On 14/03/11 13.28, Steven Schveighoffer wrote:
On Mon, 14 Mar 2011 07:20:26 -0400, Lars T. Kyllingstad
public@kyllingen.nospamnet wrote:
On Mon, 14 Mar 2011 02:36:07 -0700, Jonathan M Davis wrote:
On Monday 14 March 2011 02:16:12 Jonas Drewsen wrote:
On 13/03/11 23.44, Andrei Alexandrescu
Andrei Alexandrescu Wrote:
A simple input buffered stream of T would be a range of T[] that has two
extra primitives:
T[] lookAhead(size_t n);
void leaveBehind(size_t n);
T front();
T[] front(size_t n); // bulk front
void popFront(size_t n=1); // bulk popFront
I'm not sure there's a
On 13/03/11 23.44, Andrei Alexandrescu wrote:
You'll probably need to justify the existence of a class hierarchy and
what overridable methods there are. In particular, since you seem to
offer hooks via delegates, probably classes wouldn't be needed at all.
(FWIW I would've done the same; I
Jonas Drewsen wrote:
Do you plan to add some kind of support for header parsing? I think
something like what the .net webclient uses
(
http://msdn.microsoft.com/en-us/library/system.net.webclient(v=VS.100).aspx )
would be great. Especially the HeaderCollection supporting headers as
strings
On 3/13/11 11:54 PM, Jesse Phillips wrote:
libcurl, SQLite, libpng, libbzip2, and the WindowsAPI stuff all sound like
Excellent items to include for standard distribution. It is really nice to just
have these items available like zlib and zip.
Personally I think Lua would make a nice standard
On 3/14/11 4:36 AM, Jonathan M Davis wrote:
That's debatable. Some would argue one way, some another. Personally, I'd argue
ubyte[]. I don't like void[] one bit. Others would agree with me, and yet others
would disagree. I don't think that there's really a general agreement on whether
void[] or
On 3/14/11 10:06 AM, Jonas Drewsen wrote:
const(ubyte)[] for input
void[] for output
that sounds reasonable. I guess that if everybody can agree on this then
the all of phobos (e.g. std.file) should use the same types?
Move the const from the first to the second line :o). I see no reason
why
On 3/14/11 10:38 AM, Jonas Drewsen wrote:
On 13/03/11 23.44, Andrei Alexandrescu wrote:
You'll probably need to justify the existence of a class hierarchy and
what overridable methods there are. In particular, since you seem to
offer hooks via delegates, probably classes wouldn't be needed at
On 3/14/11 10:32 AM, Kagamin wrote:
Andrei Alexandrescu Wrote:
A simple input buffered stream of T would be a range of T[] that has two
extra primitives:
T[] lookAhead(size_t n);
void leaveBehind(size_t n);
T front();
T[] front(size_t n); // bulk front
void popFront(size_t n=1); // bulk
On 3/14/11 4:16 AM, Jonas Drewsen wrote:
On 13/03/11 23.44, Andrei Alexandrescu wrote:
Sweet. As has been discussed, often the content is not text so you may
want to have content return ubyte[] and add a new property such as
textContent or text.
I've already changed it to void[] as done in
On Mon, 14 Mar 2011 09:17:04 -0400, dsimcha dsim...@yahoo.com wrote:
On 3/14/2011 8:22 AM, Steven Schveighoffer wrote:
BTW, that crufty old stuff
probably way outperforms anything you could ever do with ranges as the
base.
I don't get the concern about performance, for file I/O at least.
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
On Mon, 14 Mar 2011 09:17:04 -0400, dsimcha dsim...@yahoo.com wrote:
On 3/14/2011 8:22 AM, Steven Schveighoffer wrote:
BTW, that crufty old stuff
probably way outperforms anything you could ever do with ranges as the
base.
I'd like to note that you need to compile with DMC using the
makefiles provided, then cv2pdb -C and debug with Visual Studio.
Ohh so I need to use cv2pdb, that's why! Thanks a lot! :)
On 14/03/2011 07:20, %u wrote:
You can use windbg.exe, which is in \dmd\windows\bin. Of course,
you'll also need to download the Digital Mars C++ compiler from
http://www.digitalmars.com/download/freecompiler.html
Hm... I already have WinDbg (and DMC), but I never thought it's any
more
== Quote from Nicholas (ma...@later.com)'s article
== Quote from novice2 (so...@noem.ail)'s article
Nicholas Wrote:
As a result of (my) complaining and being a huge fan of XMind, I decided
to
try to organize the library for my own references as I encounter new
sections
of it.
== Quote from Jonathan M Davis (jmdavisp...@gmx.com)'s article
On Friday 11 March 2011 19:34:26 Jonathan M Davis wrote:
On Friday, March 11, 2011 19:18:21 Nicholas wrote:
Thanks for the information. I'll play with it when I'm at work again and
then report my findings.
In the
On 14/03/11 16.40, Johannes Pfau wrote:
Jonas Drewsen wrote:
Do you plan to add some kind of support for header parsing? I think
something like what the .net webclient uses
( http://msdn.microsoft.com/en-us/library/system.net.webclient(v=VS.100).aspx )
would be great. Especially the
On 14/03/11 18.46, Andrei Alexandrescu wrote:
On 3/14/11 10:06 AM, Jonas Drewsen wrote:
const(ubyte)[] for input
void[] for output
that sounds reasonable. I guess that if everybody can agree on this then
the all of phobos (e.g. std.file) should use the same types?
Move the const from the
ZY Zhou rin...@gmail.com wrote:
But for the following case, it is complete wrong if it crash at line 3:
Why? That is the point where you are actually saying 'I care about
individual characters in this string'.
1: char[] c = [0xA0];
2: string s = c.idup;
3: foreach(dchar d; s){}
On 14/03/11 18.55, Andrei Alexandrescu wrote:
On 3/14/11 4:16 AM, Jonas Drewsen wrote:
On 13/03/11 23.44, Andrei Alexandrescu wrote:
Sweet. As has been discussed, often the content is not text so you may
want to have content return ubyte[] and add a new property such as
textContent or text.
On 3/14/11 4:11 PM, Jonas Drewsen wrote:
On 14/03/11 18.55, Andrei Alexandrescu wrote:
Assume the body of the loop does some time-consuming processing - like
e.g. writing to another HTTP stream. Then your network reads should not
wait for that processing. While the user code does something, you
Hello all,
Jesse Phillips jessekphillip...@gmail.com wrote in message
news:ilk728$gk0$1...@digitalmars.com...
libcurl, SQLite, libpng, libbzip2, and the WindowsAPI stuff all sound like
Excellent items to include for standard distribution. It is really nice to
just
have these items available
On 3/14/2011 1:38 AM, Gene P. Cross wrote:
I've amended the source to pass the strings pointer (path.ptr) after adding a
null
but the problem still persists.
I lost for what it could be and I'm certain this is where the problem is,
because
if I remove the method call, the program runs fine.
On Sunday 13 March 2011 22:38:49 Gene P. Cross wrote:
I've amended the source to pass the strings pointer (path.ptr) after adding
a null but the problem still persists.
I lost for what it could be and I'm certain this is where the problem is,
because if I remove the method call, the program
-Daniel
I tried what you said:
char* ptr = toStringz(path);
SDL_LoadBMP(ptr);
and made a check to see if the pointer is null, which it isn't, but I'm unable
to
inspect is value, I haven't a debugger at the moment, could you recommend one ?
I also made the string a char[] and tested to see if
I found the problem.
I've set up my 'main' file to act on various game states and because my load
state
is physically below the running state (where the problems were occuring), even
though they were getting called first, the program starts in the loading state,
dmd wasn't having it. I tried
On 3/14/2011 2:55 AM, Gene P. Cross wrote:
I haven't a debugger at the moment, could you recommend one ?
Sorry, I use GDB with GDC. I don't know about DMD, it may work with GDB
on linux. You could try installing GDC and see if the results are the
same. That may help to rule out the compiler
On 3/14/2011 3:07 AM, Gene P. Cross wrote:
I found the problem.
I've set up my 'main' file to act on various game states and because my load
state
is physically below the running state (where the problems were occuring), even
though they were getting called first, the program starts in the
On Monday 14 March 2011 00:07:05 Gene P. Cross wrote:
I found the problem.
I've set up my 'main' file to act on various game states and because my
load state is physically below the running state (where the problems were
occuring), even though they were getting called first, the program
Thanks for your help, and from here on in I'll be sure to initialise first
thing.
I'll look into GDB, thanks again.
On 03/14/2011 07:55 AM, Gene P. Cross wrote:
-Daniel
I tried what you said:
char* ptr = toStringz(path);
SDL_LoadBMP(ptr);
and made a check to see if the pointer is null, which it isn't, but I'm unable
to
inspect is value, I haven't a debugger at the moment, could you recommend one ?
I also
Am 13.03.2011 23:27, schrieb Magnus Lie Hetland:
I have a data structure that's generally static (const, or even
immutable), but it has some utility storage, which caches certain
results during use. This caching etc. doesn't really affect the
semantics of the main object, and are reset between
On Fri, 11 Mar 2011 22:39:43 -, Stewart Gordon smjg_1...@yahoo.com
wrote:
On 11/03/2011 21:51, Steven Schveighoffer wrote:
snip
Presumably there's a reason that it's been provided for uint but not
ushort or ulong
I think things in std.intrinsic are functions that tie directly to
On 2011-03-14 00:17:18 +0100, Jonathan M Davis said:
So, if you don't actually manage to _really_
be logically const, or if you do this with an immutable object (which would
likely result in a segfault), you _are_ going to have incorrect code. On the
whole, I'd advise just not using const when
On 2011-03-14 11:51:09 +0100, Mafi said:
I found away which doesn't use casts or bugs.
Just use delegates/closures.
Nice :D
--
Magnus Lie Hetland
http://hetland.org
Hey,
I'm having some problems iterating over an enumerated associative array.
It comes up with this error at compile time:
Internal error: e2ir.c 4835
I cut the code down to this:
import std.stdio;
enum int[string] assoc = [;: 0, =: 1, +: 2, -: 2, *: 3,
/: 3];
void main()
{
On 03/14/2011 12:21 PM, Nebster wrote:
Hey,
I'm having some problems iterating over an enumerated associative array.
It comes up with this error at compile time:
Internal error: e2ir.c 4835
I cut the code down to this:
import std.stdio;
enum int[string] assoc = [;: 0, =: 1, +: 2, -: 2,
On Fri, 11 Mar 2011 17:39:43 -0500, Stewart Gordon smjg_1...@yahoo.com
wrote:
On 11/03/2011 21:51, Steven Schveighoffer wrote:
snip
Presumably there's a reason that it's been provided for uint but not
ushort or ulong
I think things in std.intrinsic are functions that tie directly to
On Fri, 11 Mar 2011 18:57:32 -0500, Spacen Jasset
spacenjas...@yahoo.co.uk wrote:
On 10/03/2011 12:18, Steven Schveighoffer wrote:
On Wed, 09 Mar 2011 18:19:55 -0500, Joel Christensen joel...@gmail.com
wrote:
This is on Windows 7. Using a def file to stop the terminal window
coming up.
== Quote from Nebster (evil.nebs...@gmail.com)'s article
Hey,
I'm having some problems iterating over an enumerated associative array.
It comes up with this error at compile time:
Internal error: e2ir.c 4835
I cut the code down to this:
import std.stdio;
enum int[string] assoc =
On 14/03/2011 14:38, Peter Lundgren wrote:
== Quote from Nebster (evil.nebs...@gmail.com)'s article
Hey,
I'm having some problems iterating over an enumerated associative array.
It comes up with this error at compile time:
Internal error: e2ir.c 4835
I cut the code down to this:
import
I am back.
Nebster:
I'm having some problems iterating over an enumerated associative array.
It comes up with this error at compile time:
Internal error: e2ir.c 4835
Added:
http://d.puremagic.com/issues/show_bug.cgi?id=5734
Bye,
bearophile
I'm having trouble passing D strings (char[]) to SDL, in particular
SDL_LoadBMP(), I keep receiving a segfault.
Heres the code:
void setImg(string path) {
// concat null terminating char to string and cast to c type string
when
// passing to SDL_LoadBMP()
path ~= \0;
image =
On Monday, March 14, 2011 10:54:57 Trass3r wrote:
I'm having trouble passing D strings (char[]) to SDL, in particular
SDL_LoadBMP(), I keep receiving a segfault.
Heres the code:
void setImg(string path) {
// concat null terminating char to string and cast to c type string
http://d.puremagic.com/issues/show_bug.cgi?id=5734
Summary: foreach on enum associative array
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
http://d.puremagic.com/issues/show_bug.cgi?id=5731
--- Comment #2 from Jonathan M Davis jmdavisp...@gmx.com 2011-03-14 10:52:58
PDT ---
Pull Request: https://github.com/D-Programming-Language/phobos/pull/18
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
---
http://d.puremagic.com/issues/show_bug.cgi?id=5735
Summary: struct implicitly converted to boolean.
Product: D
Version: D1 D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
http://d.puremagic.com/issues/show_bug.cgi?id=5736
Summary: std.regex matches digits with when \w is used
Product: D
Version: D2
Platform: Other
OS/Version: Mac OS X
Status: NEW
Severity: normal
Priority: P2
http://d.puremagic.com/issues/show_bug.cgi?id=5734
kenn...@gmail.com changed:
What|Removed |Added
Status|NEW |RESOLVED
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=5590
kenn...@gmail.com changed:
What|Removed |Added
CC||bearophile_h...@eml.cc
--- Comment
http://d.puremagic.com/issues/show_bug.cgi?id=5736
kenn...@gmail.com changed:
What|Removed |Added
CC||kenn...@gmail.com
--- Comment #1
81 matches
Mail list logo