Replace that with something like writeln("caught") and you will
see that it is indeed caught. :) Printing the exception mimicks
the default behavior and you (and I) think that the exception
is not caught. :)
that's work, but I can not understand where I can to look at
exception level. If I ri
On Thursday, November 06, 2014 03:48:26 Dmitriy via Digitalmars-d-learn wrote:
> Hello, I'm in the middle of learning D. I can't find any
> definitive information about what is the complexity of operator
> ~= when used for adding an element to an array. Is it amortized
> O(1) or is it implementatio
Hello, I'm in the middle of learning D. I can't find any
definitive information about what is the complexity of operator
~= when used for adding an element to an array. Is it amortized
O(1) or is it implementation defined? (I hope it at worst O(n)
though I haven't seen any information about tha
Thanks, Adam.
Should we perhaps make a pull to suggest updating the docs/wiki?
As the point below is not what one would infer from the dlang.org
library reference page.
(If I say we, it's because I don't know what the protocol is, or
whether my perception is right).
On Tuesday, 4 November
On Thursday, November 06, 2014 00:16:48 Mike via Digitalmars-d-learn wrote:
> In that case, a better question is "Why use the standard C
> implementation if we have working D code?".
Less to maintain. Also, there's less risk of inconsistency with what C is
doing. And it's low level stuff anyway wh
On Wednesday, 5 November 2014 at 14:24:00 UTC, Sean Kelly wrote:
On Wednesday, 5 November 2014 at 09:45:50 UTC, Mike wrote:
Greetings,
In core.varar.
(https://github.com/D-Programming-Language/druntime/blob/master/src/core/vararg.d),
why is the X86 implementation singled out and written in D
On Wednesday, 5 November 2014 at 23:53:57 UTC, Ali Çehreli wrote:
On 11/05/2014 03:48 PM, bioinfornatics wrote:
Dear,
maybe I'm too tired to see my errors or they are a bug. See
below
I have this:
.
|-- fasta.d
`-- src
`-- nicea
|-- metadata.d
|-- parser.d
`--
On 11/05/2014 03:48 PM, bioinfornatics wrote:
Dear,
maybe I'm too tired to see my errors or they are a bug. See below
I have this:
.
|-- fasta.d
`-- src
`-- nicea
|-- metadata.d
|-- parser.d
`-- range.d
when I try to build it:
$ dmd -I./src/ ./fasta.d 2>&1
On Wed, 05 Nov 2014 23:48:21 +, bioinfornatics wrote:
> Dear,
>
> maybe I'm too tired to see my errors or they are a bug. See below
>
> I have this:
> .
> |-- fasta.d `-- src
> `-- nicea
> |-- metadata.d |-- parser.d `-- range.d
>
> when I try to build it:
>
> $ dmd -I./src
Dear,
maybe I'm too tired to see my errors or they are a bug. See below
I have this:
.
|-- fasta.d
`-- src
`-- nicea
|-- metadata.d
|-- parser.d
`-- range.d
when I try to build it:
$ dmd -I./src/ ./fasta.d 2>&1
fasta.o:(.rodata+0x1f8): undefined reference to
`_
On Wednesday, 5 November 2014 at 21:57:42 UTC, bioinfornatics
wrote:
On Tuesday, 4 November 2014 at 22:06:03 UTC, Ali Çehreli wrote:
On 11/04/2014 01:58 PM, bioinfornatics wrote:
>> test.d(40): Error: type Section!((letter) => letter == '>',
>> (letter) => letter == '\x0a') has no value
You ha
On Tuesday, 4 November 2014 at 22:06:03 UTC, Ali Çehreli wrote:
On 11/04/2014 01:58 PM, bioinfornatics wrote:
>> test.d(40): Error: type Section!((letter) => letter == '>',
>> (letter) => letter == '\x0a') has no value
You have this line:
@Section!(/* ... */)
Although that is a type name,
On Wednesday, 5 November 2014 at 20:31:54 UTC, Patrick Jeeves
wrote:
On Wednesday, 5 November 2014 at 19:44:57 UTC, luminousone
wrote:
On Wednesday, 5 November 2014 at 19:05:32 UTC, Patrick Jeeves
wrote:
On Wednesday, 5 November 2014 at 18:56:08 UTC, luminousone
wrote:
unless delete is explicit
Justin Whear:
--any compiler crash is a bug
regardless of whether the source is valid D code or not.
I suspect that in some cases those compiler crashes are a way for
the compiler to tell the programmer that the code was too much
hairy and too much hard to understand ;-)
Bye,
bearophile
On Wed, 05 Nov 2014 20:48:06 +, Patrick Jeeves wrote:
> When I tried to test out the following code the compiler segfaulted:
>
> Is there some rule against doing this or is it a glitch?
Please file a bug report on issues.dlang.org --any compiler crash is a bug
regardless of whether the sourc
When I tried to test out the following code the compiler
segfaulted:
interface BarBase
{
void do_a_thing();
}
interface Bar(T) : BarBase
{
static if(hasMember!(T, "rotation") && is(typeof(T.rotation) ==
double))
{
@property
double rotation()
On Wednesday, 5 November 2014 at 19:44:57 UTC, luminousone wrote:
On Wednesday, 5 November 2014 at 19:05:32 UTC, Patrick Jeeves
wrote:
On Wednesday, 5 November 2014 at 18:56:08 UTC, luminousone
wrote:
unless delete is explicitly called, I don't believe the
destructor would ever be called, it wo
On Monday, 3 November 2014 at 21:17:09 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
struct polynomial(uint base)
{
private:
uint[] N;
public:
this(uint x) { base = x; }
base is part of the type. polynomial is just a 'recipe' for a
type,
the real struct would be Polynomial!(0), Pol
On Wednesday, 5 November 2014 at 19:05:32 UTC, Patrick Jeeves
wrote:
On Wednesday, 5 November 2014 at 18:56:08 UTC, luminousone
wrote:
unless delete is explicitly called, I don't believe the
destructor would ever be called, it would still have a
reference in the static foo_list object that woul
On Wednesday, 5 November 2014 at 18:56:08 UTC, luminousone wrote:
unless delete is explicitly called, I don't believe the
destructor would ever be called, it would still have a
reference in the static foo_list object that would stop it from
being collected by the gc.
This is exactly why I ask
On Wednesday, 5 November 2014 at 18:18:18 UTC, Ali Çehreli wrote:
On 11/05/2014 10:12 AM, Adam D. Ruppe wrote:
> On Wednesday, 5 November 2014 at 18:10:38 UTC, Ali Çehreli
wrote:
>> If so, then that push_back would be adding an incomplete
object to the
>> list.
>
> scope(success)?
I really like
On 11/05/2014 10:01 AM, Ali Çehreli wrote:
>>> sort (c.byCodeUnit);
>>> }
>>>
>>> But IMO it should.
>>
>> https://issues.dlang.org/show_bug.cgi?id=13689
>
> It can't be a RandomAccessRange because it cannot satisfy random access
> at O(1) time.
Sorry, I misunderstood (again): code u
On 11/05/2014 06:01 AM, Suliman wrote:
> I can't understand what I am missing. Try-catch block also do not handle
> exception:
I does. This turned out to be very tricky for me. :)
> void main()
> {
> string fname = "app.d1"; //file name with error
> string current_folder = (getcwd() ~
On 11/05/2014 10:12 AM, Adam D. Ruppe wrote:
> On Wednesday, 5 November 2014 at 18:10:38 UTC, Ali Çehreli wrote:
>> If so, then that push_back would be adding an incomplete object to the
>> list.
>
> scope(success)?
I really like that! :)
But still not for this case because in addition to the p
On Wednesday, 5 November 2014 at 18:10:38 UTC, Ali Çehreli wrote:
If so, then that push_back would be adding an incomplete object
to the list.
scope(success)?
But the D translation worries me too because the destructor won't
run at the same time as the C++ version, unless you make it a
scop
On 11/05/2014 10:07 AM, Ali Çehreli wrote:
> On 11/05/2014 09:17 AM, Patrick Jeeves wrote:
>
> > class foo
> > {
> > static std::list foo_list;
> > typedef std::list::iterator iterator;
> > public:
> > foo()
> > {
> > foo_list.push_back(this);
> > }
Argh! I forgot
On 11/05/2014 09:17 AM, Patrick Jeeves wrote:
> class foo
> {
> static std::list foo_list;
> typedef std::list::iterator iterator;
> public:
> foo()
> {
> foo_list.push_back(this);
> }
> ~foo()
> {
> foo_list.remove(this);
> }
Going completely off-to
On 11/05/2014 05:44 AM, "Marc Schütz" " wrote:
On Wednesday, 5 November 2014 at 13:34:05 UTC, Marc Schütz wrote:
On Wednesday, 5 November 2014 at 12:54:03 UTC, Ivan Kazmenko wrote:
Hi!
This gives an error (cannot deduce template function from argument
types):
-
import std.algorithm;
void
On Wednesday, 5 November 2014 at 17:17:11 UTC, Patrick Jeeves
wrote:
So this is more a stackoverflow question, but I feel like later
searchers will be more likely to find it if I put it here.
if I have the following C++ code:
class foo
{
static std::list foo_list;
typedef std::list::iterator i
So this is more a stackoverflow question, but I feel like later
searchers will be more likely to find it if I put it here.
if I have the following C++ code:
class foo
{
static std::list foo_list;
typedef std::list::iterator iterator;
public:
foo()
{
foo_list.push_back(this);
Am I right understand that keyword "Exception" is handle
universal type of exceptions?
catch (Exception)
{
writeln("inner");
}
But in my example with try block can I change it's to something
more informative?
On Wednesday, 5 November 2014 at 09:45:50 UTC, Mike wrote:
Greetings,
In core.varar.
(https://github.com/D-Programming-Language/druntime/blob/master/src/core/vararg.d),
why is the X86 implementation singled out and written in D
rather than leveraging the standard c library implementation
lik
On Wed, 05 Nov 2014 14:09:20 +
Gary Willoughby via Digitalmars-d-learn
wrote:
> That shouldn't matter. See: http://dlang.org/exception-safe.html
this indeed matter. and it should.
signature.asc
Description: PGP signature
On Wednesday, 5 November 2014 at 11:31:01 UTC, bearophile wrote:
This was discussed some times, and Walter is against this, but
I think he is wrong, and eventually things will change.
An access violation already thrown on Win32. Just catch a
Throwable in main and write out exception.toString.
On Wednesday, 5 November 2014 at 14:04:26 UTC, MadProgressor
wrote:
The scope(failure) is translated to a try catch after the
satement you wann monitor.
So put it before
That shouldn't matter. See: http://dlang.org/exception-safe.html
On Wednesday, 5 November 2014 at 12:56:41 UTC, Suliman wrote:
void openFile(string fname, string current_folder)
{
auto file = readText(current_folder ~ fname);
scope(failure)
{
writeln("failure");
}
// writeln(file);
}
if file name do not e
I can't understand what I am missing. Try-catch block also do not
handle exception:
void main()
{
string fname = "app.d1"; //file name with error
string current_folder = (getcwd() ~"\\");
writeln(current_folder);
openFile(fname, current_folder);
}
void openFile(s
On Wednesday, 5 November 2014 at 13:34:05 UTC, Marc Schütz wrote:
On Wednesday, 5 November 2014 at 12:54:03 UTC, Ivan Kazmenko
wrote:
Hi!
This gives an error (cannot deduce template function from
argument types):
-
import std.algorithm;
void main () {
char [] c;
sort (c);
On Wednesday, 5 November 2014 at 12:54:03 UTC, Ivan Kazmenko
wrote:
Hi!
This gives an error (cannot deduce template function from
argument types):
-
import std.algorithm;
void main () {
char [] c;
sort (c);
}
-
Why is "char []" so special that it can't be sorted?
For
void openFile(string fname, string current_folder)
{
auto file = readText(current_folder ~ fname);
scope(failure)
{
writeln("failure");
}
// writeln(file);
}
if file name do not exists, I want to rise scope exception. But
it's do not rise, a
Hi!
This gives an error (cannot deduce template function from
argument types):
-
import std.algorithm;
void main () {
char [] c;
sort (c);
}
-
Why is "char []" so special that it can't be sorted?
For example, if I know the array contains only ASCII characters,
sortin
On Wednesday, 5 November 2014 at 11:27:02 UTC, thedeemon wrote:
On Wednesday, 5 November 2014 at 11:09:42 UTC, Bauss wrote:
Is there any way to track down access violations, instead of
me having to look through my source code manually.
I have a pretty big source code and an access violation
h
On Wednesday, 5 November 2014 at 11:39:21 UTC, Marc Schütz wrote:
On Wednesday, 5 November 2014 at 11:09:42 UTC, Bauss wrote:
Is there any way to track down access violations, instead of
me having to look through my source code manually.
I have a pretty big source code and an access violation
On Wednesday, 5 November 2014 at 11:09:42 UTC, Bauss wrote:
Is there any way to track down access violations, instead of me
having to look through my source code manually.
I have a pretty big source code and an access violation happens
at runtime, but it's going to be a nightmare looking throu
Bauss:
Is there any way to track down access violations, instead of me
having to look through my source code manually.
I have a pretty big source code and an access violation happens
at runtime, but it's going to be a nightmare looking through it
all to find the access violation. Not to ment
On Wednesday, 5 November 2014 at 11:09:42 UTC, Bauss wrote:
Is there any way to track down access violations, instead of me
having to look through my source code manually.
I have a pretty big source code and an access violation happens
at runtime, but it's going to be a nightmare looking throu
Is there any way to track down access violations, instead of me
having to look through my source code manually.
I have a pretty big source code and an access violation happens
at runtime, but it's going to be a nightmare looking through it
all to find the access violation. Not to mention all t
Greetings,
In core.varar.
(https://github.com/D-Programming-Language/druntime/blob/master/src/core/vararg.d),
why is the X86 implementation singled out and written in D rather
than leveraging the standard c library implementation like the
others?
Mike
On Tuesday, 4 November 2014 at 23:09:33 UTC, Jack wrote:
So there must be an incompatibility with the video subsystem
and tcl/tk.
So it seems. Thank you very much for helping me.
You were a big help.
Sorry i can't do more. I'm the author of Tkd and would like to
get to the bottom of it.
49 matches
Mail list logo