Why does std.file.readText() append a Line Feed char onto the end
of the string?
I have a file with the following contents in it:
Name = Int
Other=Float
One More = String(Random;)
I then have the code:
void main(string[] args){
const text = "Name = Int
Other
On Thu, 18 Dec 2014 09:18:35 +
Colin via Digitalmars-d-learn wrote:
> Why does std.file.readText() append a Line Feed char onto the end
> of the string?
>
> I have a file with the following contents in it:
> Name = Int
> Other=Float
> One More = String(Random;)
>
> I then h
On Thursday, 18 December 2014 at 09:25:47 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 18 Dec 2014 09:18:35 +
Colin via Digitalmars-d-learn
wrote:
Why does std.file.readText() append a Line Feed char onto the
end of the string?
I have a file with the following contents in it:
Nam
On Thursday, 18 December 2014 at 10:16:38 UTC, Colin wrote:
On Thursday, 18 December 2014 at 09:25:47 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 18 Dec 2014 09:18:35 +
Colin via Digitalmars-d-learn
wrote:
Why does std.file.readText() append a Line Feed char onto the
end of the s
On Thursday, 18 December 2014 at 10:43:32 UTC, yazd wrote:
On Thursday, 18 December 2014 at 10:16:38 UTC, Colin wrote:
On Thursday, 18 December 2014 at 09:25:47 UTC, ketmar via
Digitalmars-d-learn wrote:
On Thu, 18 Dec 2014 09:18:35 +
Colin via Digitalmars-d-learn
wrote:
Why does std.fi
Having quick read through the
http://en.wikipedia.org/wiki/Word_%28computer_architecture%29 may
help re-calibrating the way you thing about bit operations and
optimization.
But how to do the same thing for a struct?
_
dhoom
On 12/18/2014 3:29 PM, Joel wrote:
I've installed SDL2.
Joels-MacBook-Pro:DerelictTest joelcnz$ cat test.d
import derelict.sdl2.sdl;
int main() {
DerelictSDL2.load();
}
Joels-MacBook-Pro:DerelictTest joelcnz$ dmd test libDerelictSDL2.a
libDerelictUtil.a
Joels-MacBook-Pro:DerelictTest jo
On Thursday, 18 December 2014 at 09:18:36 UTC, Colin wrote:
I don't think it's my editor adding chars to the end of the
file, as I'm using vi.
:-) vim actually does it by default. Check out ":help eol" from
inside it.
I think other vi clones do it too but I'm not sure, but I know
vim has it
On 12/17/14 6:15 AM, zeljkog wrote:
On 15.12.14 01:00, "Nordlöw" wrote:
Isn't this algorithm already encoded somewhere in Phobos?
void append(T, Args...)(ref T[] arr, auto ref Args args){
{
static if (args.length == 1)
arr ~= args[0]; // inlined
else{
arr.length += ar
On Wednesday, 17 December 2014 at 12:30:37 UTC, Tobias Pankrath
wrote:
void append(T, Args...)(ref T[] arr, auto ref Args args){
{
static if (args.length == 1)
arr ~= args[0]; // inlined
else{
arr.length += args.length;
foreach(i, e; args)
arr[$ - args.length + i] =
An exemple being fullyQualifiedName:
https://github.com/D-Programming-Language/phobos/blob/master/std/traits.d#L415
I don't get this pattern. Is it documented somewhere ?
On Thursday, 18 December 2014 at 15:48:02 UTC, Mathias LANG wrote:
An exemple being fullyQualifiedName:
https://github.com/D-Programming-Language/phobos/blob/master/std/traits.d#L415
I don't get this pattern. Is it documented somewhere ?
http://dlang.org/variadic-function-templates.html
On Thursday, 18 December 2014 at 15:48:02 UTC, Mathias LANG wrote:
An exemple being fullyQualifiedName:
https://github.com/D-Programming-Language/phobos/blob/master/std/traits.d#L415
I don't get this pattern. Is it documented somewhere ?
Full pattern looks like this:
template foo(T...)
if
On Thu, 18 Dec 2014 15:52:06 +
Low Functioning via Digitalmars-d-learn
wrote:
> On Thursday, 18 December 2014 at 15:48:02 UTC, Mathias LANG wrote:
> > An exemple being fullyQualifiedName:
> > https://github.com/D-Programming-Language/phobos/blob/master/std/traits.d#L415
> >
> > I don't get th
On 12/18/14 11:21 AM, ketmar via Digitalmars-d-learn wrote:
On Thu, 18 Dec 2014 15:52:06 +
Low Functioning via Digitalmars-d-learn
wrote:
On Thursday, 18 December 2014 at 15:48:02 UTC, Mathias LANG wrote:
An exemple being fullyQualifiedName:
https://github.com/D-Programming-Language/phobo
On Thu, 18 Dec 2014 11:26:20 -0500
Steven Schveighoffer via Digitalmars-d-learn
wrote:
> On 12/18/14 11:21 AM, ketmar via Digitalmars-d-learn wrote:
> > On Thu, 18 Dec 2014 15:52:06 +
> > Low Functioning via Digitalmars-d-learn
> > wrote:
> >
> >> On Thursday, 18 December 2014 at 15:48:02 UT
On Thursday, 18 December 2014 at 16:10:31 UTC, Dicebot wrote:
On Thursday, 18 December 2014 at 15:48:02 UTC, Mathias LANG
wrote:
An exemple being fullyQualifiedName:
https://github.com/D-Programming-Language/phobos/blob/master/std/traits.d#L415
I don't get this pattern. Is it documented somewhe
On Thursday, 18 December 2014 at 17:20:28 UTC, Mathias LANG wrote:
Thanks for the precision. Is it something that is going to be
fixed, or is it by design ?
It is something that most likely would have been designed
differently if we had another chance (aka D3) but unlikely to
change in D2 as
On Thursday, 18 December 2014 at 15:12:39 UTC, Nordlöw wrote:
On Wednesday, 17 December 2014 at 12:30:37 UTC, Tobias Pankrath
wrote:
void append(T, Args...)(ref T[] arr, auto ref Args args){
{
static if (args.length == 1)
arr ~= args[0]; // inlined
else{
arr.length += args.length;
I have a bunch of D functions I would like to make available to
Excel (and possibly Julia) without having to write wrappers for
each function individually.
For Excel, I think one needs two levels of wrapper - one is to
create a C style interface [using extern(Windows) calling
convention, and
On 12/18/2014 02:51 AM, Colin wrote:
> > vi, and it does indeed have a '\n' at the end of file.
>
> Ah, I see. That's a little annoying.
It looks like there are ways of dealing with it:
http://stackoverflow.com/questions/1050640/vim-disable-automatic-newline-at-end-of-file
Ali
"happy with Ema
On 18.12.14 14:50, Steven Schveighoffer wrote:
> I wonder how your code compares to this:
>
> void append(T)(ref T[] arr, T[] args...)
> {
> arr ~= args;
> }
This is ~20% slower for ints, but it difference increases for bigger structs.
[snip]
Failed to load one or more shared libraries:
After that last colon, you should be seeing a list of library
names that failed to load. Did you somehow fail to copy/paste
it or is it really missing?
Yes, there was something wrong there, here's another go:
Joels-MBP:test joelcnz$ dmd t
On 12/18/2014 12:41 PM, Laeeth Isharc wrote:
I have a bunch of D functions I would like to make available to Excel
(and possibly Julia) without having to write wrappers for each function
individually.
I've thought about refactoring the reflection parts of pyd into a
reusable library for e.g.
If you memoize a method inside a class definition using
std.functional.memoize is caching done in a per-object manner, or
do all objects of this class share cached return values? Thank
you.
On 12/19/2014 9:58 AM, Joel wrote:
[snip]
derelict.util.exception.SymbolLoadException@derelict/util/exception.d(35):
Failed to load symbol SDL_free from shared library
/usr/local/lib/libSDL2.dylib
OK, the loader is finding libSDL2.dylib in /usr/local/lib where it
expects it to be. Your erro
Hi,
I try to translate following javascript coding to D:
i = buffer[2] << 16;
i |= buffer[1] << 8;
i |= buffer[0];
i += buffer[3] << 24 >>> 0;
Buffer is:
[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 111]
Expected result for i is: 4294967295
But in D the last st
28 matches
Mail list logo