On Wednesday, 26 July 2017 at 09:45:07 UTC, Timon Gehr wrote:
import std.stdio,std.string,std.algorithm,std.conv;
void main(){
readln.split.fold!((stack,op){
switch(op){
static foreach(c;"+-*/") case [c]:
return stack[0..$-2]~mixin("stack[$-2] "~c~"
On Wednesday, 26 July 2017 at 17:12:00 UTC, Mike Wey wrote:
On 26-07-17 16:40, Iakh wrote:
On Wednesday, 26 July 2017 at 09:46:45 UTC, Timon Gehr wrote:
readln.split.fold!((stack,op){
switch(op){
static foreach(c;"+-*/") case [c]:
return
On 26-07-17 16:40, Iakh wrote:
On Wednesday, 26 July 2017 at 09:46:45 UTC, Timon Gehr wrote:
readln.split.fold!((stack,op){
switch(op){
static foreach(c;"+-*/") case [c]:
return stack[0..$-2]~mixin("stack[$-2] "~c~"
stack[$-1]");
On Wednesday, 26 July 2017 at 09:46:45 UTC, Timon Gehr wrote:
readln.split.fold!((stack,op){
switch(op){
static foreach(c;"+-*/") case [c]:
return stack[0..$-2]~mixin("stack[$-2] "~c~"
stack[$-1]");
default: return stack~op.to!real;
On 26.07.2017 11:45, Timon Gehr wrote:
On 26.07.2017 04:37, Seb wrote:
On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote:
Semi-Functional/pure RPN calculator: https://run.dlang.io/is/JGkBZx
This is probably too long, but it demonstrates the compiler enforced
safety and purity
On 26.07.2017 04:37, Seb wrote:
On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote:
Semi-Functional/pure RPN calculator: https://run.dlang.io/is/JGkBZx
This is probably too long, but it demonstrates the compiler enforced
safety and purity (State is passed through the fold), while
On 26.07.2017 04:37, Seb wrote:
On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote:
Semi-Functional/pure RPN calculator: https://run.dlang.io/is/JGkBZx
This is probably too long, but it demonstrates the compiler enforced
safety and purity (State is passed through the fold), while
On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote:
Semi-Functional/pure RPN calculator:
https://run.dlang.io/is/JGkBZx
This is probably too long, but it demonstrates the compiler
enforced safety and purity (State is passed through the fold),
while also showing off the higher level
On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote:
Semi-Functional/pure RPN calculator:
https://run.dlang.io/is/JGkBZx
This is probably too long, but it demonstrates the compiler
enforced safety and purity (State is passed through the fold),
while also showing off the higher level
Semi-Functional/pure RPN calculator:
https://run.dlang.io/is/JGkBZx
This is probably too long, but it demonstrates the compiler
enforced safety and purity (State is passed through the fold),
while also showing off the higher level parts of Phobos (Use of
fold).
10 matches
Mail list logo