To write such an expressive code D

Dennis Ritchie via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Feb 9 11:40:40 PST 2015


Good evening.
Is it possible to D something to replace the container on the F#, 
which displays the values of the sine from 0 to 90 degrees with 
an interval of 10 degrees:
let pi = Math.PI
let sins = [for x in 0.0..pi / 2.0 / 9.0..pi / 2.0 -> sin x]
sins.Dump()

Output:
0
0,17364817766693
0,342020143325699
0,5
0,642787609686539
0,766044443118978
0,866025403784439
0,939692620785908
0,984807753012208
1

P.S. Interested in code that will be as impressive as this. In 
General, I would like to see something akin to D.


More information about the Digitalmars-d-learn mailing list