On Sunday, 30 April 2017 at 05:53:09 UTC, Andrew Edwards wrote:
string line;
parse!int((line = readln)).writeln;
is there a reason you mix normal call and ufc or just some style?
you can do this and remove some ()
(line = readln).parse!int.writeln;
On Sunday, 30 April 2017 at 03:20:20 UTC, JV wrote:
On Sunday, 30 April 2017 at 03:18:04 UTC, Adam D. Ruppe wrote:
On Sunday, 30 April 2017 at 03:10:25 UTC, JV wrote:
btw i forgot to add () at readln while editing the post
That's not necessary, it doesn't change anything.
But readln without
I've been playing around with using D with no runtime on Linux,
but recently I was thinking it would be nice to have an alloca
implementation. I was thinking I could just bump the stack
pointer (with alignment considerations) but from what I
understand compilers sometimes generate code that ref
On Sunday, 30 April 2017 at 03:18:39 UTC, JV wrote:
On Sunday, 30 April 2017 at 03:13:14 UTC, JV wrote:
On Sunday, 30 April 2017 at 02:07:48 UTC, JV wrote:
int func;
writeln("\t\tEnter Selection : ");
readln(func);
On Sunday, 30 April 2017 at 03:20:20 UTC, JV wrote:
On Sunday, 30 April 2017 at 03:18:04 UTC, Adam D. Ruppe wrote:
On Sunday, 30 April 2017 at 03:10:25 UTC, JV wrote:
okay?? but how do i return an int?
tried using what i found in the internet like using std.conv;
to use toInt() but still sh
On Sunday, 30 April 2017 at 03:18:04 UTC, Adam D. Ruppe wrote:
On Sunday, 30 April 2017 at 03:10:25 UTC, JV wrote:
btw i forgot to add () at readln while editing the post
That's not necessary, it doesn't change anything.
But readln without arguments returns a string, not an int.
okay?? but
On Sunday, 30 April 2017 at 03:13:14 UTC, JV wrote:
On Sunday, 30 April 2017 at 02:07:48 UTC, JV wrote:
Hello i'm kinda new to D language and i wanted to make a
simple program
but somehow my input does no go to my if statements and just
continues to ask for the user to input.Kindly help me
bt
On Sunday, 30 April 2017 at 03:10:25 UTC, JV wrote:
btw i forgot to add () at readln while editing the post
That's not necessary, it doesn't change anything.
But readln without arguments returns a string, not an int.
On Sunday, 30 April 2017 at 02:07:48 UTC, JV wrote:
Hello i'm kinda new to D language and i wanted to make a simple
program
but somehow my input does no go to my if statements and just
continues to ask for the user to input.Kindly help me
btw here is my sample code
int func;
writeln("
On Sunday, 30 April 2017 at 03:04:49 UTC, Adam D. Ruppe wrote:
On Sunday, 30 April 2017 at 02:07:48 UTC, JV wrote:
int func;
writeln("\t\tEnter Selection : ");
func = readln;
writeln(func);
That shouldn't even compile... are you sure that's your actual
code, and that it is actuall
On Sunday, 30 April 2017 at 02:07:48 UTC, JV wrote:
int func;
writeln("\t\tEnter Selection : ");
func = readln;
writeln(func);
That shouldn't even compile... are you sure that's your actual
code, and that it is actually building successfully?
On Sunday, 30 April 2017 at 00:17:37 UTC, Carl Sturtivant wrote:
Consider the following.
struct member
{
int n;
}
struct outer
{
member x;
alias x this;
alias n2 = n;
}
This does not compile: alias n2 = n;
Error: undefined identifier 'n'
On the other hand if change that into
Hello i'm kinda new to D language and i wanted to make a simple
program
but somehow my input does no go to my if statements and just
continues to ask for the user to input.Kindly help me
btw here is my sample code
int func;
writeln("\t\tEnter Selection : ");
func = readln;
writeln(
On Saturday, 29 April 2017 at 19:16:14 UTC, kinke wrote:
On Saturday, 29 April 2017 at 18:08:16 UTC, سليمان السهمي
(Soulaïman Sahmi) wrote:
GCC has this attribute called abi_tag that they put on any
function that returns std::string or std::list
The usual workaround is compiling the C++ source
Consider the following.
struct member
{
int n;
}
struct outer
{
member x;
alias x this;
alias n2 = n;
}
This does not compile: alias n2 = n;
Error: undefined identifier 'n'
On the other hand if change that into
alias n2 = x.n;
then it does compile.
void main()
{
outer
On Saturday, 29 April 2017 at 21:18:27 UTC, cym13 wrote:
On Saturday, 29 April 2017 at 21:09:13 UTC, fred wrote:
import std.stdio;
I am somewhat new to D, and I am trying to receive user input,
like this, with a prompt:
string str;
writeln("Enter a string: ");
str = readln;
writeln(str);
Ho
On Saturday, 29 April 2017 at 21:09:13 UTC, fred wrote:
import std.stdio;
I am somewhat new to D, and I am trying to receive user input,
like this, with a prompt:
string str;
writeln("Enter a string: ");
str = readln;
writeln(str);
However, the prompt appears after I enter the input; any rea
import std.stdio;
I am somewhat new to D, and I am trying to receive user input,
like this, with a prompt:
string str;
writeln("Enter a string: ");
str = readln;
writeln(str);
However, the prompt appears after I enter the input; any reason
why?
I've trawled the internet for a good hour, bu
On Saturday, 29 April 2017 at 18:54:36 UTC, سليمان السهمي
(Soulaïman Sahmi) wrote:
But still, this needs to be fixed, copy pasting the name
mangling is in my opinion just a hack for your specific cpp
compiler on your specific platform.
It can't be fixed on the D side as the Visual C++ mangling
On Saturday, 29 April 2017 at 18:08:16 UTC, سليمان السهمي
(Soulaïman Sahmi) wrote:
GCC has this attribute called abi_tag that they put on any
function that returns std::string or std::list
The usual workaround is compiling the C++ source with
_GLIBCXX_USE_CXX11_ABI=0 for gcc >= 5.
On Saturday, 29 April 2017 at 08:08:27 UTC, ParticlePeter wrote:
On Saturday, 29 April 2017 at 00:31:32 UTC, Nicholas Wilson
wrote:
If you are having problems with the linker with Ali's you can
do
```
extern(C++) bool cppFunc( float[3] color ); // correct
signature, but causes compiler error
GCC has this attribute called abi_tag that they put on any
function that returns std::string or std::list, for the rational
behind that read
here:https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html .
the special thing with this attribute is that it adds something
to the name man
On Saturday, 29 April 2017 at 10:17:47 UTC, Atila Neves wrote:
On Saturday, 29 April 2017 at 06:22:03 UTC, ParticlePeter wrote:
On Saturday, 29 April 2017 at 01:49:56 UTC, Atila Neves wrote:
On Friday, 28 April 2017 at 18:41:22 UTC, kinke wrote:
[...]
The worst part about that is mangling as
On Saturday, 29 April 2017 at 06:22:03 UTC, ParticlePeter wrote:
On Saturday, 29 April 2017 at 01:49:56 UTC, Atila Neves wrote:
On Friday, 28 April 2017 at 18:41:22 UTC, kinke wrote:
[...]
The worst part about that is mangling aside, the two
declarations are identical to the compiler.
Atil
On Friday, 28 April 2017 at 18:08:38 UTC, H. S. Teoh wrote:
On Fri, Apr 28, 2017 at 04:42:28PM +, via
Digitalmars-d-learn wrote: [...]
writefln(text("%.", i, "f"), x);
[...]
There's no need to use text() here:
writefln("%.*f", i, x);
does what you want.
T
Thanks, I mi
On Saturday, 29 April 2017 at 08:15:06 UTC, Stanislav Blinov
wrote:
Ah, that calls for something like a isCallableWith template.
Pay extra care to how you pass parameters in that variadic
opCall template though. Doing it like in the code above will
pass everything by value, even though the orig
On Saturday, 29 April 2017 at 06:18:34 UTC, Alex wrote:
The problem is another one: say I have something like this:
import std.traits;
struct A(alias T) if(isCallable!T)
{
auto opCall(U...)(U args) if(is(Parameters!T == U))
//if(__traits(compiles, T(args)))
{
On Saturday, 29 April 2017 at 00:31:32 UTC, Nicholas Wilson wrote:
If you are having problems with the linker with Ali's you can do
```
extern(C++) bool cppFunc( float[3] color ); // correct
signature, but causes compiler error
pragma(mangle, cppFunc.mangleof)
float cppFunc(float * color); //
28 matches
Mail list logo