On Thursday, 14 March 2019 at 11:38:44 UTC, alex1974 wrote:
I have several geometric shapes (triangle, trapezoid, gauss,
...) forming the membership functions of a fuzzy set.
For example the shape of the triangle is defined by the
variables a, b and c. The function calculating membership looks
On 15/03/2019 00:45, ag0aep6g via Digitalmars-d-learn wrote:
On 14.03.19 20:43, Jacob Carlborg wrote:
class C {
uint i ;
this (uint i) {
this.i = i ;
}
this (uint i) shared {
this.i = i ;
}
this (uint i) immutable {
this.i = i ;
}
}
On 14.03.19 20:43, Jacob Carlborg wrote:
class C {
uint i ;
this (uint i) {
this.i = i ;
}
this (uint i) shared {
this.i = i ;
}
this (uint i) immutable {
this.i = i ;
}
}
__gshared c0 = new C(0);
shared c1 = new shared C(1);
immuta
On Thursday, 14 March 2019 at 19:46:30 UTC, spir wrote:
But the doc (the language ref for the matter) should definitely
say what you just explained above, shouldn't they?
Well arguably, the spec should detail the language semantics
formally and not just be a description of the reference
imple
On Thursday, 14 March 2019 at 20:06:08 UTC, Ron Tarrant wrote:
On Thursday, 14 March 2019 at 16:02:01 UTC, Basile B. wrote:
You must register put the static library file, not the object
I thing, anyway, i just made you a video showing exactly what
to do since finally the linker error is gone (
On Thursday, 14 March 2019 at 16:02:01 UTC, Basile B. wrote:
You must register put the static library file, not the object I
thing, anyway, i just made you a video showing exactly what to
do since finally the linker error is gone (yay !), also launch
one of the demo file as a "runnable module"
On 14/03/2019 15:52, H. S. Teoh via Digitalmars-d-learn wrote:
On Thu, Mar 14, 2019 at 03:22:52PM +0100, spir via Digitalmars-d-learn wrote:
https://dlang.org/spec/hash-map.html#static_initialization:
immutable long[string] aa = [
"foo": 5,
"bar": 10,
"baz": 2000
];
==> Error: non-con
On 2019-03-14 12:05, spir wrote:
I desperately try to declare/define/initialise a simple class instance
at module-level. This is a special (conceptually static and immutable)
instance used as a "marker", that just should exist and be accessible by
methods of this class and/or other classes defi
On Thursday, 14 March 2019 at 18:25:17 UTC, H. S. Teoh wrote:
On Thu, Mar 14, 2019 at 06:07:46PM +, Alec Stewart via
Digitalmars-d-learn wrote: [...]
bool opEquals(ref const Interval i) const {
// probably would be a bit more than just this, but
for this issue
// let's
On Thu, Mar 14, 2019 at 06:07:46PM +, Alec Stewart via Digitalmars-d-learn
wrote:
[...]
> bool opEquals(ref const Interval i) const {
> // probably would be a bit more than just this, but for this issue
> // let's just stick with this.
> return d_start.opEquals(othe
On Thursday, 14 March 2019 at 18:07:46 UTC, Alec Stewart wrote:
// let's just stick with this.
return d_start.opEquals(other.d_start) &&
d_end.opEquals(other.d_end);
Why not just use d_start == other.d_start && d_end == other.d_end
there?
So should I bother with operator ov
I thought (for shits and giggles) to try and implement the
Aho-Corasick algorithm[1].
I thought I'd start with a struct to represent the "interval":
struct Interval {
size_t d_start;
size_t d_end;
size_t size;
this(size_t start, size_t end) {
d_
On Thursday, 14 March 2019 at 15:50:55 UTC, Ron Tarrant wrote:
Thanks for replying, Basile. It's always nice to get info
straight from the original code author. :)
On Wednesday, 13 March 2019 at 11:59:11 UTC, Basile B. wrote:
1. "Compile File and Run"
It's for the scripts-like program, i.e s
On Thursday, 14 March 2019 at 15:29:28 UTC, Ozan wrote:
Hi
In vibe.d / data / mongo / collection I found the function
* ensureIndex(Tuple!(string, int))[] field_orders)
What could be the right way to use "Tuple!(string, int))[]
field_orders"?
I tried different ways like [Tuple!("a", 1), Tuple!
Thanks for replying, Basile. It's always nice to get info
straight from the original code author. :)
On Wednesday, 13 March 2019 at 11:59:11 UTC, Basile B. wrote:
1. "Compile File and Run"
It's for the scripts-like program, i.e single module. For this,
the dependencies must be registered in
On Tuesday, 12 March 2019 at 15:48:14 UTC, Ron Tarrant wrote:
I managed to get dexed to compile a single-file dub project,
but for completeness sake, I'm also trying to configure it to
use dmd (non-dub) to compile GtkD projects using Compilation
(menu) > Compile File and Run.
To that end, I h
Hi
In vibe.d / data / mongo / collection I found the function
* ensureIndex(Tuple!(string, int))[] field_orders)
What could be the right way to use "Tuple!(string, int))[]
field_orders"?
I tried different ways like [Tuple!("a", 1), Tuple!("b", 2)]",
but compiler said "No"
Any hint?
Thanks &
On Thursday, 14 March 2019 at 14:47:18 UTC, Adam D. Ruppe wrote:
On Thursday, 14 March 2019 at 14:22:52 UTC, spir wrote:
https://dlang.org/spec/hash-map.html#static_initialization:
Well, bug in implementation. That is *supposed* to work, but
the compiler never implemented it.
The docs reall
On Thu, Mar 14, 2019 at 03:22:52PM +0100, spir via Digitalmars-d-learn wrote:
> https://dlang.org/spec/hash-map.html#static_initialization:
>
> immutable long[string] aa = [
> "foo": 5,
> "bar": 10,
> "baz": 2000
> ];
>
> ==> Error: non-constant expression `["foo":5L, "bar":10L, "baz":2000L
On Thursday, 14 March 2019 at 14:22:52 UTC, spir wrote:
https://dlang.org/spec/hash-map.html#static_initialization:
Well, bug in implementation. That is *supposed* to work, but the
compiler never implemented it.
The docs really should point out this fact explicitly, though.
On Thursday, 14 March 2019 at 14:22:52 UTC, spir wrote:
https://dlang.org/spec/hash-map.html#static_initialization:
immutable long[string] aa = [
"foo": 5,
"bar": 10,
"baz": 2000
];
If I'm right, you can't use this syntax with global array. Insted
this works:
void main()
{
immutable
On 14/03/2019 12:16, H. S. Teoh via Digitalmars-d-learn wrote:
On Thu, Mar 14, 2019 at 12:05:22PM +0100, spir via Digitalmars-d-learn wrote:
I desperately try to declare/define/initialise a simple class instance
at module-level. This is a special (conceptually static and immutable)
instance used
https://dlang.org/spec/hash-map.html#static_initialization:
immutable long[string] aa = [
"foo": 5,
"bar": 10,
"baz": 2000
];
==> Error: non-constant expression `["foo":5L, "bar":10L, "baz":2000L]`
Also: I don't understand the error message:
* What is non-constant in the *expression*?
* A
On Thursday, 14 March 2019 at 11:38:44 UTC, alex1974 wrote:
I have several geometric shapes (triangle, trapezoid, gauss,
...) forming the membership functions of a fuzzy set.
For example the shape of the triangle is defined by the
variables a, b and c. The function calculating membership looks
On Thursday, 14 March 2019 at 11:05:22 UTC, spir wrote:
I desperately try to declare/define/initialise a simple class
instance at module-level. This is a special (conceptually
static and immutable) instance used as a "marker", that just
should exist and be accessible by methods of this class an
I have several geometric shapes (triangle, trapezoid, gauss, ...)
forming the membership functions of a fuzzy set.
For example the shape of the triangle is defined by the variables
a, b and c. The function calculating membership looks like:
real triangle (real a, real b, real c, real value) {
On Thursday, 14 March 2019 at 11:05:22 UTC, spir wrote:
The most confusing error is:
Error: variable `_base.c0` is a thread-local class and cannot
have a static initializer. Use `static this()` to initialize
instead.
Error is reffering to:
https://dlang.org/spec/module.html#staticorder
Yo
On Thu, Mar 14, 2019 at 12:05:22PM +0100, spir via Digitalmars-d-learn wrote:
> I desperately try to declare/define/initialise a simple class instance
> at module-level. This is a special (conceptually static and immutable)
> instance used as a "marker", that just should exist and be accessible
> b
I desperately try to declare/define/initialise a simple class instance at
module-level. This is a special (conceptually static and immutable) instance
used as a "marker", that just should exist and be accessible by methods of this
class and/or other classes defined in the same module. (Thus I do
29 matches
Mail list logo