On 11/20/2015 09:45 PM, Shriramana Sharma wrote:
Hello. In Python one has the syntax try..except..else.. where code in the
else clause will only be executed if an exception does not occur. (Ref:
http://stackoverflow.com/a/22579805/1503120)
In D, is there such an idiomatic/canonical construct? Th
On Saturday, 21 November 2015 at 05:55:53 UTC, Shriramana Sharma
wrote:
rsw0x wrote:
scope(failure) can be used to run code when an exception is
thrown inside the scope, and scope(success) only triggers if
the
scope exited successfully
http://ddili.org/ders/d.en/scope.html
Thanks but I kno
Shriramana Sharma wrote:
> In Python one has the syntax try..except..else.. where code in the
> else clause will only be executed if an exception does not occur. (Ref:
> http://stackoverflow.com/a/22579805/1503120)
Official Python documentation:
https://docs.python.org/3/reference/compound_stmts
rsw0x wrote:
> scope(failure) can be used to run code when an exception is
> thrown inside the scope, and scope(success) only triggers if the
> scope exited successfully
>
> http://ddili.org/ders/d.en/scope.html
Thanks but I know that and it executes only at the point of scope exit. But
I want
On Saturday, 21 November 2015 at 05:45:37 UTC, Shriramana Sharma
wrote:
Hello. In Python one has the syntax try..except..else.. where
code in the else clause will only be executed if an exception
does not occur. (Ref:
http://stackoverflow.com/a/22579805/1503120)
In D, is there such an idiomat
Hello. In Python one has the syntax try..except..else.. where code in the
else clause will only be executed if an exception does not occur. (Ref:
http://stackoverflow.com/a/22579805/1503120)
In D, is there such an idiomatic/canonical construct? The D try statement
only seems to support finally
The page http://dlang.org/exception-safe.html says:
"It's try-finally that becomes redundant."
IIUC this is because we have scope(exit).
Does this mean that `finally` should eventually be removed from the
language?
--
Shriramana Sharma, Penguin #395953
Hello. The following code works fine for me:
#! /usr/bin/env rdmd
import std.stdio;
void main() { writeln(2); }
So what is the use of the --shebang option of rdmd?
http://dlang.org/rdmd.html does not shed much light on this.
Thanks.
--
Shriramana Sharma, Penguin #395953
On Friday, 20 November 2015 at 21:27:12 UTC, Pierre wrote:
Hello, I can't build my project with MS-COFF option.
I'm using DMD 2.069.
I got this error :
utf.d(1109) : invalid UTF-8 sequence (at index 1)
I used these options with visual D:
Compiler : DMD
D-Version : D2
Output Type
On Sunday, 12 July 2015 at 09:03:25 UTC, Tofu Ninja wrote:
On Sunday, 12 July 2015 at 08:47:37 UTC, ketmar wrote:
On Sun, 12 Jul 2015 08:38:00 +, Tofu Ninja wrote:
Is it even possible?
what do you mean?
Sorry, thought the title was enough.
The context for a delegate(assuming not a met
On Friday, 20 November 2015 at 23:35:50 UTC, Spacen Jasset wrote:
On Friday, 20 November 2015 at 23:21:03 UTC, anonymous wrote:
[...]
FT_Init_FreeType must be read at compile time, because
freeType is a module level variable, and initializers for
module variables must be static values. The ini
On Friday, 20 November 2015 at 23:21:03 UTC, anonymous wrote:
[...]
FT_Init_FreeType must be read at compile time, because freeType
is a module level variable, and initializers for module
variables must be static values. The initializer is run through
CTFE (Compile Time Function Evaluation).
P
On 20.11.2015 23:56, Spacen Jasset wrote:
The ideal would be to have a struct that can be placed inside a function
scope, or perhaps as a module global variable. Why does Ft_Init_FreeType
have to be read at compile time?
text.d(143,15): Error: static variable FT_Init_FreeType cannot be read
at
On 11/20/2015 02:56 PM, Spacen Jasset wrote:
> FT_Init_FreeType is a static which is set at some previous time to a
> function entry point in the FreeType library.
> text.d(143,15): Error: static variable FT_Init_FreeType cannot be read
> at compile time
The compiler seems to think that FT_Init
I have the following code in attempt to create an RAII object
wrapper, but it seems that it might be impossible. The problem
here is that FT_Init_FreeType is a static which is set at some
previous time to a function entry point in the FreeType library.
I could use a scope block, but would rath
On Thursday, 19 November 2015 at 15:36:44 UTC, Steven
Schveighoffer wrote:
On 11/19/15 3:30 AM, Jonathan M Davis via Digitalmars-d-learn
wrote:
On Wednesday, November 18, 2015 22:15:19 anonymous via
Digitalmars-d-learn wrote:
On 18.11.2015 22:02, rsw0x wrote:
slices aren't arrays
http://dlang.
Hello, I can't build my project with MS-COFF option.
I'm using DMD 2.069.
I got this error :
utf.d(1109) : invalid UTF-8 sequence (at index 1)
I used these options with visual D:
Compiler : DMD
D-Version : D2
Output Type: DLL
Subsystem : Not set
Compilation: Combined co
On Fri, 20 Nov 2015 20:39:57 +, Ilya wrote:
> Can DMD frontend optimize
> string concatenation
> ```
> enum Double(S) = S ~ S;
>
> assert(condition, "Text " ~ Double!"+" ~ ___FUNCTION__);
> ```
>
> to
>
> ```
> assert(condition, "Text ++_function_name_");
>
> ```
> ?
Yes this occurs as
Can DMD frontend optimize
string concatenation
```
enum Double(S) = S ~ S;
assert(condition, "Text " ~ Double!"+" ~ ___FUNCTION__);
```
to
```
assert(condition, "Text ++_function_name_");
```
?
On Friday, 20 November 2015 at 15:03:06 UTC, Adam D. Ruppe wrote:
On Friday, 20 November 2015 at 14:18:00 UTC, Alex Parrill wrote:
But you don't need a template for this case; mixin templates
have access to `this`:
Indeed, this is a good answer too.
The difference between this and the templat
On Friday, 20 November 2015 at 19:45:26 UTC, TheDGuy wrote:
So like this?
public void remove(TreeIter iter)
{
this.remove(iter);
}
If i do this, i get a stackoverflow error :(
Your List inherits from TreeStore correct? just get rid of your
custom remov
Ahh, okay. Thank you very much for your help, now everything
works fine :)
On Fri, 20 Nov 2015 19:34:01 +, TheDGuy wrote:
> Thanks for your reply,
>
> is it also possible to do it like this?
>
Yeah, that'll work.
> but now i get the error:
>
> "rowDeleted is not callable using argument types (TreeIter)"?
rowDeleted is just to emit the signal that a row has been
On Fri, 20 Nov 2015 19:45:25 +, TheDGuy wrote:
> So like this?
>
> public void remove(TreeIter iter)
> {
> this.remove(iter);
> }
>
> If i do this, i get a stackoverflow error :(
That's creating an infinite recursion as the method simply calls itself.
Assumin
So like this?
public void remove(TreeIter iter)
{
this.remove(iter);
}
If i do this, i get a stackoverflow error :(
Thanks for your reply,
is it also possible to do it like this?
import gtk.MainWindow;
import gtk.Box;
import gtk.Main;
import gtk.Button;
import gdk.Event;
import gtk.Widget;
import List, Languages;
void main(string[] args){
Main.init(args);
MainWindow win = new MainWindow("Tr
On Thursday, 19 November 2015 at 06:33:06 UTC, Jay Norwood wrote:
Maybe the nd slices could be applied if you considered each row
to be the same structure, and slice by rows rather than
operating on columns. Pandas supports a multi-dimension panel.
Maybe this would be the application for nd
On Fri, 20 Nov 2015 18:57:10 +, TheDGuy wrote:
> Thanks for your reply,
>
> now it gets more clear for me but how am i able to access the TreeView
> within the CustomButton-Class? If i declare TreeView and TreeStore
> public i get "static variable list cannot be read at compile time"?
>
> au
Thanks for your reply,
now it gets more clear for me but how am i able to access the
TreeView within the CustomButton-Class? If i declare TreeView and
TreeStore public i get "static variable list cannot be read at
compile time"?
import gtk.MainWindow;
import gtk.Box;
import gtk.Main;
import
On Friday, 20 November 2015 at 17:09:50 UTC, TheDGuy wrote:
Hello,
is it possible, to delete a selected TreeView SubItem with a
Button-Click?
My Code currently looks like this:
import gtk.MainWindow;
import gtk.Box;
import gtk.Main;
import gtk.Button;
import gdk.Event;
import gtk.Widget;
i
On Thursday, 19 November 2015 at 23:16:04 UTC, Spacen Jasset
wrote:
I thought scope was deprecated, but I see that this is still
here: http://dlang.org/attribute.html#scope
Is it just the uses on classes and local variables that are
discouraged, but the use in a function signature will continu
Hello,
is it possible, to delete a selected TreeView SubItem with a
Button-Click?
My Code currently looks like this:
import gtk.MainWindow;
import gtk.Box;
import gtk.Main;
import gtk.Button;
import gdk.Event;
import gtk.Widget;
import List, Languages;
void main(string[] args){
Mai
On Friday, 20 November 2015 at 15:43:00 UTC, BBasile wrote:
One last question: is it possible to nest the calls to
functions that take this kind of parameters ?
auto this_ = cast(T) this;
this_.bug0();
this_.bug1();
On Friday, 20 November 2015 at 12:49:02 UTC, Rikki Cattermole
wrote:
Dunno if its been fixed in ~master (doubt it), but all you need
to do in your code, is copy it in.
Cool, that worked.
I've personally marked (well voted anyway) for this bug to be
critical.
It seems I'm the only one who thin
On Friday, 20 November 2015 at 14:49:28 UTC, Adam D. Ruppe wrote:
On Friday, 20 November 2015 at 14:01:13 UTC, BBasile wrote:
everything that can be done to avoid the compilations errors
will also prevent "bar" to be written in the output (because a
B will never be analyzed). The "only" fix I s
On Friday, 20 November 2015 at 14:18:00 UTC, Alex Parrill wrote:
But you don't need a template for this case; mixin templates
have access to `this`:
Indeed, this is a good answer too.
The difference between this and the template thing I did is that
yours is virtual so calling it through an in
On Friday, 20 November 2015 at 14:39:29 UTC, Alex Parrill wrote:
Alternatively, you can use a static method and pass in the
instance.
Initially this solution looked awesome but when `bug()` is
static, `&dg` returns some functions, not some delegates, which
is a problem: this implies that I ha
On Friday, 20 November 2015 at 14:01:13 UTC, BBasile wrote:
everything that can be done to avoid the compilations errors
will also prevent "bar" to be written in the output (because a
B will never be analyzed). The "only" fix I see is like in the
stack overflow answer: statically check if the m
On Thursday, 19 November 2015 at 22:07:19 UTC, ZombineDev wrote:
On Friday, 13 November 2015 at 15:35:11 UTC, Ish wrote:
[...]
If you're more familiar with pthreads, you can just use them
from core.sys.posix.pthread [1]. After all this what
core.thread uses on Posix [2]. In general you can u
Alternatively, you can use a static method and pass in the
instance.
Note that `new B` will print A's members twice, because A's
constructor is always called and `__traits(allMembers, B)`
includes A's members.
---
import std.stdio;
mixin template Bug()
{
import std.traits;
static v
On Friday, 20 November 2015 at 14:18:00 UTC, Alex Parrill wrote:
If the mixin has to be used on class and on struct, I cant use an
interface. In this case override will create an error and go back
to the solution on SO: statically check if things are already
there.
Templates are not virtual,
On Friday, 20 November 2015 at 14:01:13 UTC, BBasile wrote:
Background:
===
http://stackoverflow.com/questions/33764540/warning-about-overriden-methods-when-using-a-mixin
Why this horrible trick has to be used:
===
cast this as (T) in a function temp
Background:
===
http://stackoverflow.com/questions/33764540/warning-about-overriden-methods-when-using-a-mixin
Why this horrible trick has to be used:
===
cast this as (T) in a function template that's been mixed in an
ancestor is not always usable,
On Friday, 20 November 2015 at 13:44:11 UTC, rumbu wrote:
On Friday, 20 November 2015 at 11:16:13 UTC, userABCabc123
wrote:
[...]
[...]
Not thoroughly tested and only works for doubles, but this must
do the trick.
[...]
Thx, it works, easy to adapt to float.
On Friday, 20 November 2015 at 11:16:13 UTC, userABCabc123 wrote:
Does someone have a good CTFE fmod() function ? The problem is
that std.math.fmod() is itself not available at CT, neither do
floor() or similar functions necessary to get the quotient when
the input value is two times over/under
On Friday, 20 November 2015 at 12:31:37 UTC, Tofu Ninja wrote:
On Tuesday, 10 November 2015 at 11:39:56 UTC, Rikki Cattermole
wrote:
One already exists.
I've confirmed it in the build scripts. It only effects
Windows.
Any fix for this right now?
No, https://issues.dlang.org/show_bug.cgi?id=
On 21/11/15 1:31 AM, Tofu Ninja wrote:
On Tuesday, 10 November 2015 at 11:39:56 UTC, Rikki Cattermole wrote:
One already exists.
I've confirmed it in the build scripts. It only effects Windows.
Any fix for this right now?
Dunno if its been fixed in ~master (doubt it), but all you need to do
On Tuesday, 10 November 2015 at 11:39:56 UTC, Rikki Cattermole
wrote:
One already exists.
I've confirmed it in the build scripts. It only effects Windows.
Any fix for this right now?
Does someone have a good CTFE fmod() function ? The problem is
that std.math.fmod() is itself not available at CT, neither do
floor() or similar functions necessary to get the quotient when
the input value is two times over/under the bounds.
Currently I have this one...
---
auto warp(T)(T x,
49 matches
Mail list logo