monarch_dodra:
That's also why I've stopped using "writeln()" as UFCS: It
"looks" convenient at first, but then you want to turn those
"writeln" into "writefln", and that's when things don't go
according to plan...
Yes, I understand.
If you want some ugly code you can use
std.functional.bi
On Friday, 16 May 2014 at 08:43:31 UTC, bearophile wrote:
monarch_dodra:
UFCS iota :puke:
I think UFCS iota is acceptable when it has only one argument:
myArray.length.iota...
Bye,
bearophile
My gripe is how "incompatible" 1-arg and 2-arg iota is w.r.t.
UFCS:
0.iota(4);
4.iota();
That
On 16/05/14 10:32, monarch_dodra wrote:
UFCS iota :puke:
Yeah, it would make more sense if it would be called "upto":
1.upto(4)
--
/Jacob Carlborg
monarch_dodra:
UFCS iota :puke:
I think UFCS iota is acceptable when it has only one argument:
myArray.length.iota...
Bye,
bearophile
On Friday, 16 May 2014 at 06:37:30 UTC, Jacob Carlborg wrote:
import std.algorithm;
import std.range;
immutable(int[]) _items = 1.iota(4).array;
UFCS iota :puke:
On 15/05/14 18:13, AntonSotov wrote:
DMD 2.065
I do not know much English. sorry.
need to initialize immutable array "_items"
//---
module main;
import std.stdio;
class Zond {
this() {
foreach (i; 1..4) {
_items ~= i; // is ex
On 05/15/2014 11:18 AM, AntonSotov wrote:
if this is actually a bug - will be good if someone could register it.
Done:
https://issues.dlang.org/show_bug.cgi?id=12749
Ali
On Thu, 15 May 2014 14:18:03 -0400, AntonSotov
wrote:
On Thursday, 15 May 2014 at 17:15:50 UTC, Steven Schveighoffer wrote:
Assign _items only once in the constructor.
immutable(int)[] tmp;
foreach(i; 1..4)
tmp ~= i;
_items = tmp;
thanks for example!
On Thursday, 15 May 2014 at 17:1
On Thursday, 15 May 2014 at 17:15:50 UTC, Steven Schveighoffer
wrote:
Assign _items only once in the constructor.
immutable(int)[] tmp;
foreach(i; 1..4)
tmp ~= i;
_items = tmp;
thanks for example!
On Thursday, 15 May 2014 at 17:15:50 UTC, Steven Schveighoffer
wrote:
This should not wor
On Thu, 15 May 2014 12:13:58 -0400, AntonSotov
wrote:
DMD 2.065
I do not know much English. sorry.
need to initialize immutable array "_items"
//---
module main;
import std.stdio;
class Zond {
this() {
foreach (i; 1..4) {
_
On Thursday, 15 May 2014 at 16:13:59 UTC, AntonSotov wrote:
DMD 2.065
I do not know much English. sorry.
need to initialize immutable array "_items"
//---
module main;
import std.stdio;
class Zond {
this() {
foreach (i; 1..4) {
_i
DMD 2.065
I do not know much English. sorry.
need to initialize immutable array "_items"
//---
module main;
import std.stdio;
class Zond {
this() {
foreach (i; 1..4) {
_items ~= i; // is expected ERROR
}
}
immutable(int[]
12 matches
Mail list logo