Hello,
Here is a code with comments: https://run.dlang.io/is/BNl2Up.
I don't understand how to pass lambda into template.
I get an error:
onlineapp.d(18): Error: template instance `qwerty!((i) => "arg"
~ i.to!string ~ "[0] == '?'", "||")` cannot use local __lambda1
as parameter to non-global
On 03/09/2018 7:38 PM, Chris Katko wrote:
On Monday, 3 September 2018 at 06:28:38 UTC, bauss wrote:
On Monday, 3 September 2018 at 06:25:23 UTC, bauss wrote:
On Monday, 3 September 2018 at 03:19:39 UTC, Neia Neutuladh wrote:
On Monday, 3 September 2018 at 03:04:57 UTC, Chris Katko wrote:
This
On Monday, 3 September 2018 at 03:19:39 UTC, Neia Neutuladh wrote:
On Monday, 3 September 2018 at 03:04:57 UTC, Chris Katko wrote:
This should be simple? All I want to do is load an entire
file, and access individual bytes. The entire thing. I don't
want to have know the file size before hand,
On Monday, 3 September 2018 at 06:25:23 UTC, bauss wrote:
On Monday, 3 September 2018 at 03:19:39 UTC, Neia Neutuladh
wrote:
On Monday, 3 September 2018 at 03:04:57 UTC, Chris Katko wrote:
This should be simple? All I want to do is load an entire
file, and access individual bytes. The entire
On Monday, 3 September 2018 at 06:28:38 UTC, bauss wrote:
On Monday, 3 September 2018 at 06:25:23 UTC, bauss wrote:
On Monday, 3 September 2018 at 03:19:39 UTC, Neia Neutuladh
wrote:
On Monday, 3 September 2018 at 03:04:57 UTC, Chris Katko
wrote:
This should be simple? All I want to do is load
On Monday, 3 September 2018 at 07:38:51 UTC, Chris Katko wrote:
On Monday, 3 September 2018 at 06:28:38 UTC, bauss wrote:
On Monday, 3 September 2018 at 06:25:23 UTC, bauss wrote:
On Monday, 3 September 2018 at 03:19:39 UTC, Neia Neutuladh
wrote:
On Monday, 3 September 2018 at 03:04:57 UTC,
On Monday, 3 September 2018 at 09:09:44 UTC, Andrey wrote:
Hello,
Here is a code with comments: https://run.dlang.io/is/BNl2Up.
I don't understand how to pass lambda into template.
I get an error:
onlineapp.d(18): Error: template instance `qwerty!((i) => "arg"
~ i.to!string ~ "[0] == '?'",
On Saturday, 1 September 2018 at 22:38:46 UTC, Ali Çehreli wrote:
You can strip off any attribute with SetFunctionAttributes:
import std.stdio;
// Adapted from std.traits.SetFunctionAttributes documentation
import std.traits;
auto assumeNoGC(T)(T t)
if (isFunctionPointer!T || isDelegate!T)
On Sun, 2018-09-02 at 21:54 +, Laeeth Isharc via Digitalmars-d-
learn wrote:
> On Sunday, 2 September 2018 at 17:49:45 UTC, Russel Winder wrote:
> >
[…]
> > Now to work out how to make the project auto generate this D
> > module so as to avoid having it in the repository, and
> >
On Monday, 3 September 2018 at 10:50:17 UTC, Russel Winder wrote:
Interesting alternative to DStep. I came to D to avoid
#include, but… I'll give it a whirl once I can get it compiled
on Debian Sid. It seems the libclang-dev package does not
install a libclang.so symbolic link, you have to be
On Mon, 2018-09-03 at 12:45 +, Andrea Fontana via Digitalmars-d-
learn wrote:
> […]
>
> I use dpp to generate d code to import:
> - Create a temp.dpp file with #include inside
> - Run "d++ --preprocess-only temp.dpp"
>
> Now you have your .d file exactly like in dstep.
>
So where does this
On Monday, 3 September 2018 at 13:39:25 UTC, agorkvmh wrote:
Hi all,
Running this:
---
static assert(Foo(1).pos == 2);
struct Foo
{
this(int i){ advance(); }
size_t pos =1;
void advance()
{
pragma(msg, pos);
pos = pos+1;
pragma(msg, pos);
}
}
dmd
On Monday, 3 September 2018 at 13:52:24 UTC, bauss wrote:
On Monday, 3 September 2018 at 13:39:25 UTC, agorkvmh wrote:
[...]
It prints 1, because pragma(msg) is called when the compiler is
analyzing the code through the semantic process and not when
the body of the function is executed
Myself and some others are looking at replacing autotools in
Tilix with meson for the various Linux distros to use when
building and packaging the binary. However we are running into an
issue with meson around the use of the "-L--export-dynamic" flag.
When compiling with meson using LDC and
For anyone that wants to try to reproduce it, you can clone this
repo and switch to the meson branch:
https://github.com/bilelmoussaoui/tilix
On Friday, 31 August 2018 at 09:59:20 UTC, Dukc wrote:
For me, it seems that for generality you should always add ref
into foreach loop variable. The reason is this:
One good reason:
https://forum.dlang.org/thread/dlhrrgvzmhladnphi...@forum.dlang.org
Hi all,
Running this:
---
static assert(Foo(1).pos == 2);
struct Foo
{
this(int i){ advance(); }
size_t pos =1;
void advance()
{
pragma(msg, pos);
pos = pos+1;
pragma(msg, pos);
}
}
dmd -o- -unittest source/pgs/parser.d
1LU
1LU
---
The static
On Monday, 3 September 2018 at 22:07:10 UTC, aliak wrote:
Why does it work with nogc but not with pure?
Cheers,
- Ali
You can't define an impure function inside a pure unittest. If
you move `modify` outside the unittest block, and change the
argument from a lambda to a function pointer, it
On Monday, 3 September 2018 at 14:00:23 UTC, agorkvmh wrote:
There is a way to do print the two values at compile time?
Yes. Put a pragma where you static assert for Foo(1).pos equality
with 2:
--
static assert(Foo(1).pos == 2);
pragma(msg, Foo(1).pos);
struct Foo
{
this(int i)
On Monday, 3 September 2018 at 15:00:33 UTC, Alex wrote:
On Monday, 3 September 2018 at 14:00:23 UTC, agorkvmh wrote:
[...]
Yes. Put a pragma where you static assert for Foo(1).pos
equality with 2:
[...]
Thanks, by the way, the autocomplete suggests me '__ctfeWrite',
what is it?
On Monday, 3 September 2018 at 15:08:57 UTC, agorkvmh wrote:
On Monday, 3 September 2018 at 15:00:33 UTC, Alex wrote:
On Monday, 3 September 2018 at 14:00:23 UTC, agorkvmh wrote:
[...]
Yes. Put a pragma where you static assert for Foo(1).pos
equality with 2:
[...]
Thanks, by the way,
so I'im doing an expansive operation with a file, to try speed
up, i switch to using parallel but keeping in the otuput printing
thread-safe. But for some reason, even using synchonized, it
doesn't work as expected, for example, it output multiples
results on same time, as in the example
On Monday, 3 September 2018 at 09:09:44 UTC, Andrey wrote:
Hello,
Here is a code with comments: https://run.dlang.io/is/BNl2Up.
I don't understand how to pass lambda into template.
I get an error:
onlineapp.d(18): Error: template instance `qwerty!((i) => "arg"
~ i.to!string ~ "[0] == '?'",
On Monday, 3 September 2018 at 09:09:44 UTC, Andrey wrote:
Hello,
Here is a code with comments: https://run.dlang.io/is/BNl2Up.
I don't understand how to pass lambda into template.
I get an error:
onlineapp.d(18): Error: template instance `qwerty!((i) => "arg"
~ i.to!string ~ "[0] == '?'",
In another thread [0] this function can be used to call non nogc
code from nogc code
import std.traits;
auto assumeNoGC(T)(T t) {
enum attrs = functionAttributes!T | FunctionAttribute.nogc;
return cast(SetFunctionAttributes!(T, functionLinkage!T,
attrs)) t;
}
And then you can use it
25 matches
Mail list logo