Re: How to instantiate a map with multiple functions

2015-12-26 Thread karthikeyan via Digitalmars-d-learn
On Saturday, 26 December 2015 at 19:38:16 UTC, Fusxfaranto wrote: On Saturday, 26 December 2015 at 19:30:24 UTC, karthikeyan wrote: How to instantiate a map with multiple functions. I looked into the docs at http://dlang.org/phobos/std_algorithm_iteration.html#map. They contain a string which

How to instantiate a map with multiple functions

2015-12-26 Thread karthikeyan via Digitalmars-d-learn
How to instantiate a map with multiple functions. I looked into the docs at http://dlang.org/phobos/std_algorithm_iteration.html#map. They contain a string which I suppose is a mixin and when I change "a" to some other name it results in an error for me. Are there any ways to use lambda

Re: basic interactive readf from stdin

2015-12-26 Thread karthikeyan via Digitalmars-d-learn
On Saturday, 26 December 2015 at 19:52:15 UTC, Adam D. Ruppe wrote: On Saturday, 26 December 2015 at 19:40:59 UTC, Jay Norwood wrote: Simple VS console app in D. If you are running inside visual studio, you need to be aware that output will be block buffered, not line buffered, because VS

Re: basic interactive readf from stdin

2015-12-26 Thread Karthikeyan via Digitalmars-d-learn
On Sunday, 27 December 2015 at 00:20:51 UTC, Ali Çehreli wrote: On 12/26/2015 12:11 PM, karthikeyan wrote: > I read http://ddili.org/ders/d.en/input.html and inserted a space before %s > but still no use. Am I missing something here with the latest version? The answer is nine chapters later.

Re: How to instantiate a map with multiple functions

2015-12-26 Thread Karthikeyan via Digitalmars-d-learn
On Sunday, 27 December 2015 at 00:27:12 UTC, Ali Çehreli wrote: On 12/26/2015 11:46 AM, karthikeyan wrote: > Thanks but the following returns an error for me > >import std.algorithm.comparison : equal; >import std.range : chain; >int[] arr1 = [ 1, 2, 3, 4 ]; >int[] arr2 = [ 5, 6

Re: basic interactive readf from stdin

2015-12-26 Thread Karthikeyan via Digitalmars-d-learn
On Sunday, 27 December 2015 at 02:08:05 UTC, Ali Çehreli wrote: On 12/26/2015 05:15 PM, Karthikeyan wrote: >> The answer is nine chapters later. :) (Use readln() and strip() (or >> chomp())). >> >> http://ddili.org/ders/d.en/strings.html >> >> Ali > > Many thanks Ali. The book says ctrl + D

Re: How to instantiate a map with multiple functions

2015-12-27 Thread karthikeyan via Digitalmars-d-learn
On Sunday, 27 December 2015 at 02:21:11 UTC, Ali Çehreli wrote: On 12/26/2015 05:26 PM, Karthikeyan wrote: > if I need to map on a array of tuples will that work with the tuple being > unpacked or do I need to get it as single element and do unpacking myself? Unfortunately, there is no