On Thursday, 10 May 2018 at 22:01:25 UTC, Seb wrote:
On Thursday, 10 May 2018 at 18:38:30 UTC, Andre Pany wrote:
Hi,
I follow the instructions from the wiki to build dmd/druntime
from source on windows.
https://wiki.dlang.org/Building_under_Windows
[...]
Which DMD/druntime do you try to bu
On Thursday, 10 May 2018 at 18:21:17 UTC, bachmeier wrote:
[snip]
I used replace("\\n", "\n")
Ah, I always forget the extra \.
On Thursday, 10 May 2018 at 21:16:12 UTC, Jonathan M Davis wrote:
IIRC, there's a DIP for trying to make += work with just
getters and setters, but I don't know if we're ever going to
see anything like it in the language.
Yes, the DIP is here: https://github.com/dlang/DIPs/pull/97
It's curr
On Thursday, 10 May 2018 at 18:38:30 UTC, Andre Pany wrote:
Hi,
I follow the instructions from the wiki to build dmd/druntime
from source on windows.
https://wiki.dlang.org/Building_under_Windows
[...]
Which DMD/druntime do you try to build?
IIRC there are some issues with the release ball,
On Thursday, May 10, 2018 18:43:40 SrMordred via Digitalmars-d-learn wrote:
> struct T
> {
> int x;
> @property ref X(){ return x; }
> @property X(int v)
> {
> x = v;
> }
> }
>
> T t;
> t.X += 10;
>
> The setter 'x = v' are not executed because i´m returning the
>
On Thursday, 10 May 2018 at 20:38:12 UTC, Vladimir Panteleev
wrote:
On Thursday, 10 May 2018 at 20:32:11 UTC, Dgame wrote:
immutable size_t len = s1.length + s2.length;
percent = (len - distance) * 100.0 / len;
Note that this formula will give you only 50% similarity for
"abc" and "de
On 5/10/2018 3:18 PM, Ali Çehreli wrote:
On 05/10/2018 01:03 PM, Dlang User wrote:
>> this didn´t work either.
>> note that 'f.data+= 2;' don't call the write property
>
> That's odd, it works on my machine (Windows 10 with V2.079.0 DMD
compiler).
Try putting writeln expressions in the tw
On Friday, 4 May 2018 at 13:52:29 UTC, Andy Smith wrote:
On Thursday, 3 May 2018 at 23:58:24 UTC, Enjoys Math wrote:
Error
-
[...]
Haven't run it, but two things to try...
On D side try adding listen after bind.
On python side. Don't think you need to call bind the client
socket (
On Thursday, 10 May 2018 at 20:32:11 UTC, Dgame wrote:
immutable size_t len = s1.length + s2.length;
percent = (len - distance) * 100.0 / len;
Note that this formula will give you only 50% similarity for
"abc" and "def", i.e. two completely different strings. I suggest
to divide by ma
On Thursday, 10 May 2018 at 20:13:49 UTC, Vladimir Panteleev
wrote:
On Thursday, 10 May 2018 at 20:08:04 UTC, Dgame wrote:
void similar_text_similar_str(char* txt1, size_t len1, char*
That looks like an implementation of Levenshtein distance. We
have one in Phobos:
https://dlang.org/library
On 05/10/2018 01:03 PM, Dlang User wrote:
>> this didn´t work either.
>> note that 'f.data+= 2;' don't call the write property
>
> That's odd, it works on my machine (Windows 10 with V2.079.0 DMD
compiler).
Try putting writeln expressions in the two functions to see which one
gets called. ;)
On Thursday, 10 May 2018 at 20:08:04 UTC, Dgame wrote:
void similar_text_similar_str(char* txt1, size_t len1, char*
That looks like an implementation of Levenshtein distance. We
have one in Phobos:
https://dlang.org/library/std/algorithm/comparison/levenshtein_distance.html
I'm in need for some sort of string similarity comparision. I've
found soundex but that didn't solved my needs. After some search
I found a C implementation of similar_text, but that is quite
ugly... I was able to let it work in D but it's still somewhat
messy. Is there any D implementation of
On 5/10/2018 2:50 PM, SrMordred wrote:
On Thursday, 10 May 2018 at 19:41:41 UTC, Dlang User wrote:
On 5/10/2018 1:43 PM, SrMordred wrote:
[...]
I am relatively new to D and I was under the impression that that was
a limitation of @property functions.
But, re-reading the language reference,
On Thursday, 10 May 2018 at 19:41:41 UTC, Dlang User wrote:
On 5/10/2018 1:43 PM, SrMordred wrote:
[...]
I am relatively new to D and I was under the impression that
that was a limitation of @property functions.
But, re-reading the language reference, it gave this example
(it returns somet
On 5/10/2018 1:43 PM, SrMordred wrote:
struct T
{
int x;
@property ref X(){ return x; }
@property X(int v)
{
x = v;
}
}
T t;
t.X += 10;
The setter 'x = v' are not executed because i´m returning the reference
of x.
And without the 'ref' the compiler complains
On Thursday, 10 May 2018 at 12:55:36 UTC, Uknown wrote:
On Thursday, 10 May 2018 at 11:06:06 UTC, Per Nordlöw wrote:
On Wednesday, 9 May 2018 at 21:09:12 UTC, Meta wrote:
It's a context pointer to the enclosing
function/object/struct. Mark the struct as static to get rid
of it.
Ok, but why a
struct T
{
int x;
@property ref X(){ return x; }
@property X(int v)
{
x = v;
}
}
T t;
t.X += 10;
The setter 'x = v' are not executed because i´m returning the
reference of x.
And without the 'ref' the compiler complains because 'x' is not a
lvalue.
Any solution to
Hi,
I follow the instructions from the wiki to build dmd/druntime
from source on windows.
https://wiki.dlang.org/Building_under_Windows
Building dmd ends with following text:
---
copy ..\generated\windows\release\32\dmd.exe .
1 file copied.
make -fwin32.mak C=dmd\bac
On Thursday, 10 May 2018 at 17:59:26 UTC, jmh530 wrote:
On Thursday, 10 May 2018 at 15:01:57 UTC, rikki cattermole
wrote:
[snip]
You'll need to unescape them (which is pretty easy, a simple
replacement here).
For reference, this is invalid json[0]:
```
{
"1
2
3 "
}
`
On Thursday, 10 May 2018 at 15:01:57 UTC, rikki cattermole wrote:
[snip]
You'll need to unescape them (which is pretty easy, a simple
replacement here).
For reference, this is invalid json[0]:
```
{
"1
2
3 "
}
```
[0] https://jsonlint.com/
I don't see an unescape f
On Thursday, 10 May 2018 at 15:01:57 UTC, rikki cattermole wrote:
You'll need to unescape them (which is pretty easy, a simple
replacement here).
For reference, this is invalid json[0]:
```
{
"1
2
3 "
}
```
[0] https://jsonlint.com/
So I see the answer is that I don
On 11/05/2018 2:56 AM, bachmeier wrote:
I'm using std.json for the first time. I want to download the contents
of a markdown file from a web server. When I do that, the line breaks
are escaped, which I don't want. Here's an example:
import std.conv, std.json, std.stdio;
void main() {
str
I'm using std.json for the first time. I want to download the
contents of a markdown file from a web server. When I do that,
the line breaks are escaped, which I don't want. Here's an
example:
import std.conv, std.json, std.stdio;
void main() {
string data =
"This is a paragraph
with
On Thursday, May 10, 2018 11:52:38 Piotr Mitana via Digitalmars-d-learn
wrote:
> Given this code:
>
> abstract class A
> {
> package @property void x(int x);
> package @property int x();
> }
>
> class B : A
> {
> package @property override void x(int x) {}
> package @property o
On Thursday, 10 May 2018 at 11:06:06 UTC, Per Nordlöw wrote:
On Wednesday, 9 May 2018 at 21:09:12 UTC, Meta wrote:
It's a context pointer to the enclosing
function/object/struct. Mark the struct as static to get rid
of it.
Ok, but why an extra void* for `S.tupleof` and not for
`T.tupleof` wh
Given this code:
abstract class A
{
package @property void x(int x);
package @property int x();
}
class B : A
{
package @property override void x(int x) {}
package @property override int x() { return 0; }
}
void main() {}
I get the following message:
onlineapp.d(9): Error: fun
On Wednesday, 9 May 2018 at 21:09:12 UTC, Meta wrote:
It's a context pointer to the enclosing function/object/struct.
Mark the struct as static to get rid of it.
Ok, but why an extra void* for `S.tupleof` and not for
`T.tupleof` which is also scoped inside a unittest?
On Saturday, 5 May 2018 at 10:39:17 UTC, Alex wrote:
Thank you for you for your quick answer.
I think I allready tryed this, before asking, but ...
C:\>cd D\dmd2\sources
C:\D\dmd2\sources>dmd hello.d
Error: module `hello` is in file 'hello.d' which cannot be read
import path[0] = C:\D\dmd2\win
29 matches
Mail list logo