Python's features, which requires D
Dennis Ritchie via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sat May 23 14:08:18 PDT 2015
On Saturday, 23 May 2015 at 20:57:10 UTC, anonymous wrote:
> On Saturday, 23 May 2015 at 20:25:18 UTC, Dennis Ritchie wrote:
>> This does not work!
>>
>> enum n1 = 5;
>> writeln(stdin.byLine
>> .map!(line => line.split(" ").map!(x => to!int(x)))
>> );
>> -----
>> http://rextester.com/VGHZF81178
>
> The code itself is ok.
>
> That site has broken newlines. You can see here that
> std.ascii.newline is different from what the site actually
> feeds to the program: <http://rextester.com/IIT33098>.
>
> You can work around that by passing the correct line terminator
> to byLine: <http://rextester.com/SOW95508>.
Perhaps that's not the site, and in Windows. That's what gives me
in CMD:
456 4 4 8 99 456
[[456, 4, 4, 8, 99, 456]13 546
std.conv.ConvException at C:\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(2013):
Unexpected end of input when converting from type char[] to type
int
----------------
0x0040FD10 in pure @safe int std.conv.parse!(int,
char[]).parse(ref char[]) at
C:\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(2015)
0x00410C74 in pure @safe int std.conv.toImpl!(int,
char[]).toImpl(char[]) at
C:\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(1738)
0x0040FB92 in pure @safe int
std.conv.to!(int).to!(char[]).to(char[]) at
C:\D\dmd2\windows\bin\..\..\src\phobos\std\conv.d(296)
0x0040FB7E in pure @safe int
acm.main().__lambda1!(char[]).__lambda1(char[]).__lambda2!(char[]).__lambda2(char[])
0x00410DA7 in pure @property @safe int
std.algorithm.iteration.__T9MapResultS553acm4mainFZ17__T9__lambda1TAaZ9__lambda1MFAaZ9__lambda2TAAaZ.MapResult.front()
at C:\D\dmd2\windows\bin\..\..\src\phobos\
std\algorithm\iteration.d(548)
0x004122D4 in
D3std6format169__T11formatRangeTS3std5stdio4File17LockingTextWriterTS3std9algorithm9iteration76A5C81813C007BD25AC82BE82F3551A66
at C:\D\dmd2\windows\bin\..\..\src\phobos\std\format.d(240
9)
0x0041213F in
D3std6format169__T11formatValueTS3std5stdio4File17LockingTextWriterTS3std9algorithm9iteration768E862681E57D43E301EA954AAC63F894
at C:\D\dmd2\windows\bin\..\..\src\phobos\std\format.d(311
2)
0x004120AA in
D3std6format171__T13formatElementTS3std5stdio4File17LockingTextWriterTS3std9algorithm9iterationC8BE2524D6E8B27505208FE77A7AABE7
at C:\D\dmd2\windows\bin\..\..\src\phobos\std\format.d(261
9)
0x00411B89 in
D3std6format172__T11formatRangeTS3std5stdio4File17LockingTextWriterTS3std9algorithm9iteration7956A969C910F877511562257DEEBA50CE
at C:\D\dmd2\windows\bin\..\..\src\phobos\std\format.d(241
0)
0x00411A27 in
D3std6format172__T11formatValueTS3std5stdio4File17LockingTextWriterTS3std9algorithm9iteration793B5F1700DB9877FAF5528C7A1A67E5DC
at C:\D\dmd2\windows\bin\..\..\src\phobos\std\format.d(311
2)
0x00411991 in
D3std6format174__T13formatGenericTS3std5stdio4File17LockingTextWriterTS3std9algorithm9iterationD44607637B1FEE3931BFD9A68911D4FE
at C:\D\dmd2\windows\bin\..\..\src\phobos\std\format.d(345
1)
0x0041185C in
D3std6format175__T14formattedWriteTS3std5stdio4File17LockingTextWriterTaTS3std9algorithm9iteratD57474F5CD8E0DF85B780AE37888E8BE
at C:\D\dmd2\windows\bin\..\..\src\phobos\std\format.d(521
)
0x00411320 in
D3std5stdio4File129__T5writeTS3std9algorithm9iteration79__T9MapResultS213acm4mainFZ9__lambda1TSD37A9C7F430415C668F40B8F70856955
at C:\D\dmd2\windows\bin\..\..\src\phobos\std\stdio.d(1200
)
0x0041120A in
D3std5stdio129__T7writelnTS3std9algorithm9iteration79__T9MapResultS213acm4mainFZ9__lambda1TS3stC41BC71D1E9C2BC78EB8446AC4667CCD
at C:\D\dmd2\windows\bin\..\..\src\phobos\std\stdio.d(2932
)
0x0040203D in _Dmain at
C:\Users\REiS\Documents\Projects\acm\acm\acm.d(21)
0x00427E06 in
D2rt6dmain211_d_run_mainUiPPaPUAAaZiZ6runAllMFZ9__lambda1MFZv
0x00427DDB in void rt.dmain2._d_run_main(int, char**, extern (C)
int function(char[][])*).runAll()
0x00427CF3 in _d_run_main
0x00427884 in main
0x0043E701 in mainCRTStartup
0x76BB7C04 in BaseThreadInitThunk
0x775AAD1F in RtlInitializeExceptionChain
0x775AACEA in RtlInitializeExceptionChain
More information about the Digitalmars-d-learn
mailing list