On Saturday, 3 July 2021 at 01:15:20 UTC, Paul Backus wrote:
The error message here is actually telling you exactly what the
problem is: `findSplit` requires a forward range, but the range
returned by `File.byLine` is not a forward range, just an input
range.
Hey Paul,
Thanks for the poi
On Saturday, 3 July 2021 at 00:29:23 UTC, Kevin Bailey wrote:
Unfortunately, ldc2 is saying:
```
split.d(8): Error: template std.algorithm.searching.findSplit
cannot deduce function from argument types
!()(ByLineImpl!(char, char), string), candidates are:
/usr/lib/ldc/x86_64-linux-gnu/include
Sorry if this is too simple of a question, but I'm trying to
simply find
a blank line in a file. I'm doing something like:
```
auto file = File("somefile");
auto r = file.byLine();
auto tup = r.findSplit("");
// tup[0] would contain the range before the line,
// tup[2] would contain the range af
(Responding out of order:)
On Friday, 2 July 2021 at 00:26:52 UTC, someone wrote:
But when you start attempting to declare @safe chunks of code
that actually DO things ... well, it seems end-of-the-story.
If you find yourself unable to get real work done in `@safe`
code, this is almost certai
On 7/1/21 8:26 PM, someone wrote:
... just wondering:
I am writing pretty trivial code, nothing out of the ordinary, and
attempted to check how much of it could be marked safe ...
It should be quite a bit.
- Lots of tiny common library functions are pretty easy
- Getter/Setter properties
On 7/2/21 12:21 AM, Kirill wrote:
I have a `Tuple!(string, ..., string)[] data` that I would like to print
out:
`a b c`
`1 2 3`
`4 5 6`
Furthermore, I want to be able to print any N rows and M columns of
that table. For instance:
`b c`
`2 3`
or
On Friday, 2 July 2021 at 04:21:24 UTC, Kirill wrote:
I have a `Tuple!(string, ..., string)[] data`
If there are only strings in the tuple, it could be simplified by
making it a static array of strings instead. The compile-time
index issue would go away.
—Bastiaan
On Friday, 2 July 2021 at 00:26:52 UTC, someone wrote:
... just wondering:
...
Imho, if you want all of the app to be safe, and you cannot avoid
unsafe code, then there are two choices:
1. Mark the method doing unsafe stuff as @trusted, or pieces of
code which are unsafe with trusted lambda h
On Friday, 2 July 2021 at 04:21:24 UTC, Kirill wrote:
...
1. use static foreach for tuple loop.
2. start column and end column should be known at compile time.
Either make them immutable, or as enum constant, or pass them as
an template argument.
Tuple is basically a wrapper over built in t