Hello Saaa,
No.
You should be able to get the name using an alias:
void func(alias var)()
{
writefln(var.stringof);
}
Can this be combined with the tuple parameter?
I'll seconds this, there doesn't seem to be any way to generate tuples of
aliases and this is another cases where it would b
> No.
>
> You should be able to get the name using an alias:
>
> void func(alias var)()
> {
>writefln(var.stringof);
> }
Can this be combined with the tuple parameter?
>
> But you can't do it at runtime.
>
>> Also how do I fix this:
>> --
>> functio(`i`); // Error: "i" is not an lvalue
>
> You
Saaa wrote:
> Is it possible to get the passed variable name � la:
> --
> void functio(A...)(ref A a)
> {
> writefln(typeof(a[0]));
> }
> int i;
> functio(i); // prints "i"
No.
You should be able to get the name using an alias:
void func(alias var)()
{
writefln(var.stringof);
}
But yo
Is it possible to get the passed variable name à la:
--
void functio(A...)(ref A a)
{
writefln(typeof(a[0]));
}
int i;
functio(i); // prints "i"
--
Also how do I fix this:
--
functio(`i`); // Error: "i" is not an lvalue
--
>From the specs:
It is not an error to have const module variable declarations without
initializers if there is no constructor. This is to support the practice
of having modules serve only as declarations that are not linked in, the
implementation of it will be in another module that is linked in.
BLS wrote:
Vladimir Voinkov wrote:
std.regex can't be used in compile time function call. It's quite
frustrating...
see dsource.org .. afaik there is a compile time regex project. hth
http://www.dsource.org/projects/scregexp
But the generated functions aren't CTFE-compatible AFAIK. A CTFE r
Daniel Keep wrote:
Tim Matthews wrote:
Kagamin wrote:
Tim Matthews Wrote:
I thought a slice would behave slighty different due to some sort of
meta data that is a separate area of memory so it doesn't effect D's
abi.
Current plan is to introduce new type - array - into the language.
Do yo
Hello Tim,
Sorry I misread (lacking sleep).
Been there, done that. :oz
Sorry I misread (lacking sleep). I can just re slice from the slice,
silly me.
import std.stdio;
void extendSlice(T)(ref T[] slice, uint extendCount)
{
slice = slice.ptr[0..slice.length+extendCount];
}
void main()
{
char[] a = "Hello".dup;
char[] b;
b = a[1..3]; //b is a view i
On Thu, 09 Jul 2009 11:20:54 +0200, Lars T. Kyllingstad wrote:
> Jesse Phillips wrote:
>> On Tue, 07 Jul 2009 12:04:43 +0200, Lars T. Kyllingstad wrote:
>>
>>> Jesse Phillips wrote:
I don't know if I'm misunderstanding the use of shell() or if this is
a bug. Trying to run some programs
Hello Tim,
BCS wrote:
Hello Tim,
Anyway I like how you can get a slice of array that is just a view
into the original. If I modify the slice, it modifies the full
original array which can be very useful. If however I modify the
length of the slice which I was doing in an attempt to extend th
Vladimir Voinkov wrote:
std.regex can't be used in compile time function call. It's quite frustrating...
see dsource.org .. afaik there is a compile time regex project. hth
std.regex can't be used in compile time function call. It's quite frustrating...
Tim Matthews wrote:
> Kagamin wrote:
>> Tim Matthews Wrote:
>>
>>> I thought a slice would behave slighty different due to some sort of
>>> meta data that is a separate area of memory so it doesn't effect D's
>>> abi.
>>>
>> Current plan is to introduce new type - array - into the language.
>
>
Kagamin wrote:
Tim Matthews Wrote:
I thought a slice would behave slighty different due to some sort of
meta data that is a separate area of memory so it doesn't effect D's abi.
Current plan is to introduce new type - array - into the language.
Do you know the ng posts or where ever that w
Jesse Phillips wrote:
On Tue, 07 Jul 2009 12:04:43 +0200, Lars T. Kyllingstad wrote:
Jesse Phillips wrote:
I don't know if I'm misunderstanding the use of shell() or if this is a
bug. Trying to run some programs with shell error with a could not
close file. Sadly it I can come to any reasonabl
Tim Matthews Wrote:
> I thought a slice would behave slighty different due to some sort of
> meta data that is a separate area of memory so it doesn't effect D's abi.
>
Current plan is to introduce new type - array - into the language.
BCS wrote:
Hello Tim,
Anyway I like how you can get a slice of array that is just a view
into the original. If I modify the slice, it modifies the full
original array which can be very useful. If however I modify the
length of the slice which I was doing in an attempt to extend the
view, it bec
18 matches
Mail list logo