On Saturday, 21 November 2015 at 05:20:16 UTC, Shriramana Sharma
wrote:
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
string a = "hello";
string b = a[3 .. 2];
I expect b to become an empty slice, because 3 is >= 2 already
after 0 increments, making the slice length 0. Instead, the code
throws a range violation.
Expressions of this kind come up, e.g., when taking slices near
the end of arrays, like
On Saturday, 21 November 2015 at 15:57:35 UTC, TheDGuy wrote:
Hello,
i haven't found any tutorial about creating a textbox with GTKD
yet, so maybe someone could show me how to do it?
How About gtk.TextView ?
Russel Winder via Digitalmars-d-learn wrote:
> else on for and while, whilst technically redundant as well, does
> occasionally make for a nicer read, for very analogous reasons. It can
> generally avoid the need for extra booleans and other state variables.
Hmm – I forgot Python has `else` for
On Thursday, 19 November 2015 at 22:14:01 UTC, ZombineDev wrote:
On Thursday, 19 November 2015 at 06:33:06 UTC, Jay Norwood
wrote:
On Wednesday, 18 November 2015 at 22:46:01 UTC, jmh530 wrote:
My sense is that any data frame implementation should try to
build on the work that's being done with
On http://dlang.org/function.html, I read that "final" is a valid
attribute/storage class for function parameters:
InOutX:
auto
TypeCtor
final <-- ??
in
lazy
out
ref
scope
This looks like a documentation error, but perhaps it's not. I
hope someone can explain
On Sat, 2015-11-21 at 19:26 +0530, Shriramana Sharma via Digitalmars-d-
learn wrote:
>
[…]
> Hmm – I forgot Python has `else` for `for` and `while` too. But it's
> a tad
> difficult to wrap one's mind around the meaning of the word `else` in
> this
> particular context whereas it actually means
On Friday, 20 November 2015 at 20:39:58 UTC, Ilya wrote:
Can DMD frontend optimize
string concatenation
```
enum Double(S) = S ~ S;
assert(condition, "Text " ~ Double!"+" ~ ___FUNCTION__);
```
to
```
assert(condition, "Text ++_function_name_");
```
?
At least for string (and array?)
Hi,
I just spend a day with the D programming language and I am very
excited about being able to write such performant programs in
such an clear and concise way!
I tried to write a little search tool.
The BoyerMooreFinder docs say that the comparison operator can be
specified.
On Saturday, 21 November 2015 at 18:03:07 UTC, SimonN wrote:
string a = "hello";
string b = a[3 .. 2];
I expect b to become an empty slice, because 3 is >= 2 already
after 0 increments, making the slice length 0. Instead, the
code throws a range violation.
Expressions of this kind
On Saturday, 21 November 2015 at 18:28:51 UTC, BBaz wrote:
this is only an error if bounds checking is not turned on. If
you compile your example with DMD option "-boundscheck=off",
nothing happens, and the slice will be equal (here) to a[3..$];
Thanks for the hint, I tested this with
Hello,
i haven't found any tutorial about creating a textbox with GTKD
yet, so maybe someone could show me how to do it?
On Sat, 21 Nov 2015 11:15:22 +0530, Shriramana Sharma wrote:
> 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?
On Saturday, November 21, 2015 18:28:49 BBaz via Digitalmars-d-learn wrote:
> this is only an error if bounds checking is not turned on. If you
> compile your example with DMD option "-boundscheck=off", nothing
> happens, and the slice will be equal (here) to a[3..$];
It's a logic error
On Saturday, 21 November 2015 at 05:45:25 UTC, Shriramana Sharma
wrote:
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?
The
On Sunday, November 22, 2015 03:19:54 Jon D via Digitalmars-d-learn wrote:
> On Sunday, 22 November 2015 at 00:31:53 UTC, Jonathan M Davis
> wrote:
> >
> > Honestly, arrays suck as output ranges. They don't get appended
> > to; they get filled, and for better or worse, the documentation
> > for
On Sunday, 22 November 2015 at 00:10:07 UTC, Ali Çehreli wrote:
May I suggest that you improve that page. ;) If you don't
already have a clone o the repo, you can do it easily by
clicking the "Improve this page" button on that page.
Hi Ali, thanks for the quick response. And point taken :) I
On Sunday, November 22, 2015 02:00:46 Chris Wright via Digitalmars-d-learn
wrote:
> On Sat, 21 Nov 2015 16:10:45 -0800, Jonathan M Davis via
> Digitalmars-d-learn wrote:
>
> > Getting rid of finally would mean
> > reimplementing scope(exit) differently
>
> Well, we could keep try/finally as a
On 22/11/15 7:34 PM, Carl Sturtivant wrote:
The docs for dmd for windows say that the DFLAGS environment variable's
value will be appended to the dmd command line. I tried this with -m64
as the value and this is ignored.
http://dlang.org/dmd-windows.html#environment
More generally, is there a
On Saturday, 21 November 2015 at 13:57:01 UTC, Shriramana Sharma
wrote:
Hmm – I forgot Python has `else` for `for` and `while` too. But
it's a tad difficult to wrap one's mind around the meaning of
the word `else` in this particular context whereas it actually
means `nobreak`. Perhaps if
The docs for dmd for windows say that the DFLAGS environment
variable's value will be appended to the dmd command line. I
tried this with -m64 as the value and this is ignored.
http://dlang.org/dmd-windows.html#environment
More generally, is there a standard rearrangement of files and
Something I found confusing was the relationship between array
capacity and copy(). A short example:
void main()
{
import std.algorithm: copy;
auto a = new int[](3);
assert(a.length == 3);
[1, 2, 3].copy(a); // Okay
int[] b;
b.reserve(3);
assert(b.capacity >=
On Saturday, November 21, 2015 15:14:31 Johan Engelen via Digitalmars-d-learn
wrote:
> On http://dlang.org/function.html, I read that "final" is a valid
> attribute/storage class for function parameters:
>
> InOutX:
> auto
> TypeCtor
> final <-- ??
> in
> lazy
> out
On Saturday, November 21, 2015 11:15:22 Shriramana Sharma via
Digitalmars-d-learn wrote:
> 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
On Saturday, November 21, 2015 18:03:05 SimonN via Digitalmars-d-learn wrote:
> string a = "hello";
> string b = a[3 .. 2];
>
> I expect b to become an empty slice, because 3 is >= 2 already
> after 0 increments, making the slice length 0. Instead, the code
> throws a range violation.
>
i'm trying to build the docs as per
http://wiki.dlang.org/Building_DMD#Building_the_Docs
i have a working setup to build the latest dmd/druntime/phobos
but somehow the makefile tries to download an old dmd version and
my bandwith currently is a bit restricted and i want an offline
version.
On Sat, Nov 21, 2015 at 08:29:51PM +, yawniek via Digitalmars-d-learn wrote:
> i'm trying to build the docs as per
> http://wiki.dlang.org/Building_DMD#Building_the_Docs
>
> i have a working setup to build the latest dmd/druntime/phobos but
> somehow the makefile tries to download an old dmd
Hi Jon! :)
On 11/21/2015 03:34 PM, Jon D wrote:
> Preconditions:
> target shall have enough room to accomodate the entirety of source.
>
> Clarifying that "enough room" means 'length' rather than 'capacity'
> might be beneficial.
May I suggest that you improve that page. ;) If you
On Saturday, November 21, 2015 23:34:25 Jon D via Digitalmars-d-learn wrote:
> Something I found confusing was the relationship between array
> capacity and copy(). A short example:
>
> void main()
> {
> import std.algorithm: copy;
>
> auto a = new int[](3);
> assert(a.length == 3);
On Sat, 21 Nov 2015 16:10:45 -0800, Jonathan M Davis via
Digitalmars-d-learn wrote:
> Getting rid of finally would mean
> reimplementing scope(exit) differently
Well, we could keep try/finally as a concept inside the compiler but
change the parser so it rejects finally blocks.
On Sunday, 22 November 2015 at 00:31:53 UTC, Jonathan M Davis
wrote:
Honestly, arrays suck as output ranges. They don't get appended
to; they get filled, and for better or worse, the documentation
for copy is probably assuming that you know that. If you want
your array to be appended to when
On Sunday, 22 November 2015 at 00:24:43 UTC, Jonathan M Davis
wrote:
this is only an error if bounds checking is not turned on.
It's a logic error regardless.
you're going to have to create a wrapper.
Right, I am using a wrapper, and I'm not relying on any behavior
of a[3..2] during
On Friday, 20 November 2015 at 20:39:58 UTC, Ilya wrote:
Can DMD frontend optimize
string concatenation
```
enum Double(S) = S ~ S;
assert(condition, "Text " ~ Double!"+" ~ ___FUNCTION__);
```
to
```
assert(condition, "Text ++_function_name_");
```
?
If you really want to make sure it is
On Sunday, 12 July 2015 at 08:38:01 UTC, Tofu Ninja wrote:
Is it even possible?
You can use function instead delegate, and bind captured
variables as struct:
http://dpaste.dzfl.pl/6e23bbcfe17f
auto bind(F: R function(ARGS), R, ARGS...)(F fn, ARGS args) @nogc
{
struct Functor {
On Fri, 2015-11-20 at 22:39 -0800, Ali Çehreli via Digitalmars-d-learn
wrote:
>
[…]
> I don't know what idiom that enables in Python but it feels to me
> like
> putting the statements right after the ones that could throw suffices
> in
> D (and Python):
The else clause for while, for, try, has
On Saturday, 21 November 2015 at 00:30:45 UTC, userABCabc123
wrote:
Yes:
class Foo
{
void bar(){writeln(__PRETTY_FUNCTION__);}
}
auto uncollectedDelegate(T, string name)(ref T t)
{
import std.experimental.allocator.mallocator;
struct Dg{void* ptr,
Seems to be fixed:
__
import std.math;
void main() {real function(real) c = }
__
https://issues.dlang.org/show_bug.cgi?id=4541
At least it works on linux x86_64.
On Saturday, 21 November 2015 at 01:18:38 UTC, Charles wrote:
What string is throwing the error? I've had that error when I
was trying to decode windows1252 strings.
Thank you for your answer, but it's not a compilation error, it's
a message box displayed when i lauch compilation. I asked
38 matches
Mail list logo