On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby wrote:
After reading the following thread:
http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org
I wondered if it was possible to write a classic fizzbuzz[1]
example using a UFCS chain? I've tried and failed.
[1]:
On Tuesday, 28 April 2015 at 11:03:09 UTC, bearophile wrote:
Gary Willoughby:
I wondered if it was possible to write a classic fizzbuzz[1]
example using a UFCS chain? I've tried and failed.
Is this OK?
void main() {
import std.stdio, std.algorithm, std.range, std.conv,
std.functional;
After reading the following thread:
http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org
I wondered if it was possible to write a classic fizzbuzz[1]
example using a UFCS chain? I've tried and failed.
[1]: http://en.wikipedia.org/wiki/Fizz_buzz
Gary Willoughby:
I wondered if it was possible to write a classic fizzbuzz[1]
example using a UFCS chain? I've tried and failed.
Is this OK?
void main() {
import std.stdio, std.algorithm, std.range, std.conv,
std.functional;
100
.iota
.map!(i = ((i + 1) % 15).predSwitch(
On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby wrote:
After reading the following thread:
http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org
I wondered if it was possible to write a classic fizzbuzz[1]
example using a UFCS chain? I've tried and failed.
[1]:
On Tuesday, 28 April 2015 at 19:30:06 UTC, tcak wrote:
Is there any way to define a variable or an attribute as
read-only without defining a getter function/method for it?
Thoughts behind this question are:
1. For every reading, another function call process for CPU
while it could directly
Hi,
Is it possible to write self-modifying code in D, who will
perform at runtime? Or is it a characteristic of languages that
compile to bytecode?
On Tuesday, 28 April 2015 at 16:20:24 UTC, Per Nordlöw wrote:
I update my Github repo. I had forgotten to push my latest
changes.
On Tuesday, 28 April 2015 at 07:43:28 UTC, Kagamin wrote:
Looks like it does: http://dpaste.dzfl.pl/a851acca63d9
That compiler error is because `ArrayWrapper!(int[]) = []`
matches both `this(int[])` and `this(ArrayWrapper[])`,
although... that might be workable.
On Wednesday, 29 April 2015 at 02:34:20 UTC, William Dunne wrote:
Sorry for the noob question.
I'm currently trying to parse this bit of json:
Array
(
[meta] = Array
(
[level1trust] = 1
[level2trust] = 9
)
[connections] = Array
(
Sorry for the noob question.
I'm currently trying to parse this bit of json:
Array
(
[meta] = Array
(
[level1trust] = 1
[level2trust] = 9
)
[connections] = Array
(
[level1] = Array
(
[from]
On Wednesday, 29 April 2015 at 01:38:17 UTC, Dennis Ritchie wrote:
Hi,
Is it possible to write self-modifying code in D, who will
perform at runtime?
Not easily. Just the obvious approach to invoke the compiler and
run/load the created executable / shared library.
Or is it a
On Tue, 28 Apr 2015 21:45:07 +, PhilipDaniels wrote:
Beginner question. Given
if (startsWith(input, 0x, 0X))
How do I turn that into a case-insensitive startsWith? startsWith says
it takes a predicate but I can't figure out how to pass it one. The
examples all use a == b !? These
On Tuesday, 28 April 2015 at 11:04:12 UTC, w0rp wrote:
On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby
wrote:
After reading the following thread:
http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org
I wondered if it was possible to write a classic fizzbuzz[1]
example
On Tuesday, 28 April 2015 at 13:59:48 UTC, Ivan Kazmenko wrote:
On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby
wrote:
After reading the following thread:
http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org
I wondered if it was possible to write a classic fizzbuzz[1]
At
https://github.com/nordlow/justd/blob/master/conv_ex.d
I'm trying to figure out how to best implement a fuzzy variant of
std.conv.to when converting a string to an enum.
I'm almost there but I'm uncertain how to best pick the index of
the smallest element in `distances` and then convert
On 2015-04-28 17:52:57 +, Adam D. Ruppe said:
This can also be automated with a bit of code in a lot of cases:
import std.traits;
ParameterTypeTuple!foo params;
foreach(index, ref param; params) {
params[index] = args[index];
}
foo(params);
Move that into a helper function and you
On Tuesday, 28 April 2015 at 21:45:10 UTC, PhilipDaniels wrote:
Beginner question. Given
if (startsWith(input, 0x, 0X))
How do I turn that into a case-insensitive startsWith?
startsWith says it takes a predicate but I can't figure out how
to pass it one. The examples all use a == b !?
Beginner question. Given
if (startsWith(input, 0x, 0X))
How do I turn that into a case-insensitive startsWith? startsWith
says it takes a predicate but I can't figure out how to pass it
one. The examples all use a == b !? These attempts below, and
other things I have tried, fail with
Looks like it does: http://dpaste.dzfl.pl/a851acca63d9
I keep getting this message. Why?
Fetching: http://ftp.digitalmars.com/dmd.2.067.0.zip
[] 56256/54884 KB
Installing: dmd-2.067.0
An unknown error occurred:
tango.core.Exception.IOException@/Users/doob/development/d/tango/tango/core/Exception.d(59):
Hi, I have the following problem: I have the parameters for a
function in an array. Now I want to call a function with a specific
arity and use the parameters from the array to call it.
Like this pseudo-code:
args = [10, 20];
def foo(a, b): return a + b;
print(foo(*args));
Is something
Easiest is to just do it by hand:
foo(args[0], args[1]);
This can also be automated with a bit of code in a lot of cases:
import std.traits;
ParameterTypeTuple!foo params;
foreach(index, ref param; params) {
params[index] = args[index];
}
foo(params);
Move that into a helper function
On Tuesday, 28 April 2015 at 16:06:16 UTC, Andrea Fontana wrote:
On Tuesday, 28 April 2015 at 13:59:48 UTC, Ivan Kazmenko wrote:
On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby
wrote:
After reading the following thread:
On 04/28/2015 10:48 AM, Robert M. Münch wrote:
Hi, I have the following problem: I have the parameters for a function
in an array. Now I want to call a function with a specific arity and use
the parameters from the array to call it.
Like this pseudo-code:
args = [10, 20];
def foo(a, b):
Is there any way to define a variable or an attribute as
read-only without defining a getter function/method for it?
Thoughts behind this question are:
1. For every reading, another function call process for CPU while
it could directly read the value from memory.
2. Repetition of same name
On Tue, 28 Apr 2015 19:30:04 +, tcak wrote:
Is there any way to define a variable or an attribute as read-only
without defining a getter function/method for it?
Thoughts behind this question are:
1. For every reading, another function call process for CPU while it
could directly read
27 matches
Mail list logo