On Sunday, 6 September 2015 at 10:12:58 UTC, ParticlePeter wrote:
In the end all that I want is "just" to disable access to
array.length through vector and alias this array.
struct Vec(T, size_t n = 3)
{
T[n] data;
alias data this;
@disable @property size_t length() const;
}
be optional anyway.
It would be a compiler bug. As far as I know, accepter() and
accepter!()() has no difference in IFTI.
I filed the issue in bugzilla.
https://issues.dlang.org/show_bug.cgi?id=14174
Kenji Hara
request to fix compiler.
Kenji Hara
of the AAs or can I preserve my
convenient foreach over the AAs in the `static this` to
automatically get the integer value to be stored?
Note that this does not segdefault on latest stable DMD 2.066.
It's a regression in git-head.
https://issues.dlang.org/show_bug.cgi?id=14038
Kenji Hara
as a construction for
the field Bar.foo.
Kenji Hara
a) { writeln(typeof(a).stringof);
return a; }
float foo_float (float a) { writeln(typeof(a).stringof);
return a; }
}
alias foo = foo_double;
alias foo = foo_float;
void main()
{
double d;
float f;
foo(d); // prints double
foo(f); // prints float
}
Kenji Hara
!
I commented in github.
Kenji Hara
On Monday, 31 March 2014 at 11:51:50 UTC, Olav Lindekleiv wrote:
Here's the issue:
http://d.puremagic.com/issues/show_bug.cgi?id=12498
Fixed in git-head.
https://github.com/D-Programming-Language/dmd/commit/2c4d8ad711ccb7c94d349830523dd500580b0130
Kenji Hara
already
reported, someone will close it as a duplicate
-Steve
I filed it.
https://d.puremagic.com/issues/show_bug.cgi?id=12508
Kenji Hara
On Sunday, 9 March 2014 at 11:21:19 UTC, Jack Applegame wrote:
This fails to compile
http://dpaste.dzfl.pl/e9a90e808af4
It's a compiler bug.
https://d.puremagic.com/issues/show_bug.cgi?id=12334
https://github.com/D-Programming-Language/dmd/pull/3371
Kenji Hara
, 5, 6]s) would easily cause
memory corruption. I don't want to hurt language future by the
trivial syntactic sugar.
Kenji Hara
literal should
match _only_ dynamic array types, it would never work.
Because compiler will try to match array literal to static array
T[n]. The feature which I have described is working here.
Kenji Hara
code bloat.
void foo(T)(T arg) { ... }
foo(aaa); // instantiate foo!(char[3])
foo(); // instantiate foo!(char[4])
foo([1,2]);// instantiate foo!(int[2])
foo([1,2,3]); // instantiate foo!(int[3])
So their types were changed to dynamic array by default.
Kenji Hara
both to
int[] and int[3].
And, int[3] is more specialized than int[], so overload
resolution will choose the first 'bar'.
Kenji Hara
on Linux with 64 bit, but it fails on Windows
7 32 bit.
Bug, feature or my fault?
Compiler bug.
https://d.puremagic.com/issues/show_bug.cgi?id=11662
Kenji Hara
; // also NG, my_integer cannot *initialize* by
int value
num = my_interger(n); // OK
}
}
Kenji Hara
it has
more bugs.
Bye,
bearophile
It's a known front-end issue.
https://d.puremagic.com/issues/show_bug.cgi?id=11545
Kenji Hara
is needed
thanks to everyone
I found two compiler issues:
https://d.puremagic.com/issues/show_bug.cgi?id=11627
https://d.puremagic.com/issues/show_bug.cgi?id=11629
Kenji Hara
, not
a compiler dev.
- Jonathan M Davis
I opened a new pull request to fix the compiler issue.
https://github.com/D-Programming-Language/dmd/pull/2832
Kenji Hara
() {
auto d = new D();
assert(d.foo() == 3);// calls D.foo
assert(d.B.foo() == 1); // calls B.foo
assert(d.C.foo() == 2); // calls C.foo
d.test();
}
=
Kenji Hara
Kenji Hara
, but currently it isn't. It's a compiler bug.
http://d.puremagic.com/issues/show_bug.cgi?id=11382
Kenji Hara
the
current ABI definition issue (== #2) is a language spec bug or
not...
Kenji Hara
/show_bug.cgi?id=11286
https://github.com/D-Programming-Language/dmd/pull/2677
Kenji Hara
/issues/show_bug.cgi?id=11187
And, a week ago it is fixed. 2.064 beta1 contains the fix.
Kenji Hara
attributes of
the underlying type's methods.
std.typecons.Proxy is designed to work transparently for the
underlying method qualifiers. But I also agree that the
implementation is still insufficient.
Could you show us the not working case? It would be much help.
Kenji Hara
are
treated as if they are just imported at the mixed-in scope.
Therefore, even from main.d, the two mixed-in functions 'a' have
same closeness, and the call is ambiguous because they have
exactly same signature.
Kenji Hara
to value type, but the
behavior was not changed.
As far as I know, there was no discussion about that, but at
least it is not fundamentally wrong.
Kenji Hara
And what is your personal opinion?
I think an implicit cast between signed / unsigned would be
acceptable even with static arrays. It were
the
behavior was expected.
In D2, static array had changed to value type, but the behavior
was not changed.
As far as I know, there was no discussion about that, but at
least it is not fundamentally wrong.
Kenji Hara
.
But UFCS cannot find module level function 's', then compiler
reports irrelevant error message no property 's'
Kenji Hara
(); }
mixin template Foo()
{
override int foo() { return 1; }
}
class C1 : I {
mixin Foo!();
}
class C2 : I
{
int foo() { return 10; }
mixin Foo!();
// mixed-in foo is not stored in vtbl
}
void main()
{
assert(new C1().foo() == 1);
assert(new C2().foo() == 10);
}
Kenji
!(to) isn't
a template
}
Should the constraint on opDispatch allow the UFCS to call on
S?
That's a compiler bug.
http://d.puremagic.com/issues/show_bug.cgi?id=10526
Kenji Hara
for that, but unfortunately it
is not yet merged.
https://github.com/D-Programming-Language/dmd/pull/1660
Kenji Hara
,
time.month, time.day, time.hour, time.minute, time.second);
}
In this case, format std.string.format function should work under
the `safe annotation.
I recently worked to make it possible.
https://github.com/D-Programming-Language/phobos/pull/1337
Kenji Hara
, (C, B, A,
Object)
Kenji Hara
(getAttributes, mixin(`a.`
~ it)));
writeln(`passing: `, tp[0]);
bar!(tp[0])();
}
}
Kenji Hara
))
{
return cast(T)as!(OriginalType!T);
}
}
void main() {
S val = S(-20);
assert(val.as!int == -20);
assert(val.as!E == E.F); // val.as!E causes a compile time
error.
}
---
This is a compiler regression in 2.063 release.
http://d.puremagic.com/issues/show_bug.cgi?id=10197
Kenji
On Wednesday, 29 May 2013 at 14:50:36 UTC, bearophile wrote:
Dicebot:
I think this is a bug.
It will be fixed progressively in the next two or three DMD
versions.
Bye,
bearophile
Please file it in bugzilla.
Kenji Hara
T1 = Tuple!(int, int);
alias T2 = Tuple!(int,x, int,y);
auto t1 = T1(10, 20);
auto t2 = T2(100, 200);
t1 = t2; // OK.
t2 = t1; // OK?
}
std.typecons.Tuple supports structural assignment before the
change.
The code also works with 2.062.
Kenji Hara
situations they act in
a structural typing way. I think this mix of behaviours is a
little confusing.
Basically Tuple would follow structural typing. Even if it is
impossible, it would follow true subtyping right now. That's the
purpose of my change.
Kenji Hara
but *not* the runtime
assert. Why cant the function Blah.blah() find the array
implementation of front?
This is a known UFCS name look-up issue.
In 2.063dev, the bug is fixed. Please wait the release.
Kenji Hara
of language design.
Kenji Hara
On Thursday, 9 May 2013 at 18:25:39 UTC, Mike Linford wrote:
On Thursday, 9 May 2013 at 09:52:12 UTC, Kenji Hara wrote:
On Thursday, 9 May 2013 at 05:01:15 UTC, Mike Linford wrote:
I'm not sure whether or not I've encountered a bug or whether
my understanding of scoped imports is just faulty
be rejected statically)
}
If compiler does not reject escape...
void main()
{
const int[] a = [3, 4, 5];
auto dg = foo(a);
// typeof(dg) == inout(int[]) delegate(inout(int[]))
int[] b = dg([]);
assert(b.ptr == a.ptr); // type-system breaking!
}
Kenji Hara
, `alias TX` will bind the template Tuple. There is no problem.
Kenji Hara
on that.
Kenji Hara
On Monday, 28 January 2013 at 03:16:24 UTC, cal wrote:
This fails:
void main() {
int z;
typeof((int a){return z;}) dg;
dg = (int a) {return z;};
}
Error: cannot implicitly convert expression (__lambda2) of type
int delegate(int a) nothrow @safe to int delegate(int a) pure
nothrow
', and it is
treated as a part of parameter type.
'inout' is also treated as a type qualifier, and then is the same.
Kenji Hara
a bug in the compiler to me.
What do you guys think?
This issue looks like bug8093.
http://d.puremagic.com/issues/show_bug.cgi?id=8093
And the code works correctly in git head (dmd2.061alpha).
Therefore, I think that the bug is fixed very recently.
Kenji Hara
this on numerous occasions, and
it's among
his top thousand wanted features. :p
I think this is a bug in IFTE.
Please file it into bugzilla.
Kenji Hara
, and it's not
buffer's field itself.
Your code is equivalent with:
foreach(i,_; buffer.tupleof) {
auto _t = buffer.tupleof[i];// _t is a normal variable
writefln(%s@: %s, _t.stringof, _t.offsetof);
}
Then you cannot get offsetof property from _t;
Regards.
Kenji Hara
On Tuesday, 7 August 2012 at 16:11:05 UTC, Andrej Mitrovic wrote:
On 8/7/12, Øivind oivind@gmail.com wrote:
How can I call this function with an already-constructed tuple
but pass the pule as an expressiontuple?
auto v = tuple(1, 2, 3);
f(v);
Use the .expand property:
f(v.expand)
You
On Wednesday, 8 August 2012 at 23:21:32 UTC, Ellery Newcomer
wrote:
say I have
template T(alias fn) {
}
class Foo {
int i();
void i(int);
}
alias T!(Foo.i) Biz;
Is there a way to get a handle to both of the overloads of
Foo.i inside T?
Actually, all I really need for that is to get
id.
Implicit Copy CTor? ;)
Array appending and struct postblit behavior is now broken.
I've suggested a pull request to fix these bugs.
https://github.com/D-Programming-Language/dmd/pull/1037
Bye.
Kenji Hara
Kenji Hara
ticket.
That's what I do now. Thanks a lot for your help.
Today I posted a pull to detect recursive alias this dependency.
https://github.com/D-Programming-Language/dmd/pull/1028
Bye.
Kenji Hara
://d.puremagic.com/issues/show_bug.cgi?id=6036
As far as I know, there is no workaround...
Kenji Hara
() without
using templates as in g()?
The type of 'alias this' symbol works as like the super class of
user defined class.
Therefore, Ranged!(...) is always implicitly convertible to int
by 'alias _value this', and there is no way to disable such
conversion.
Kenji Hara
://d.puremagic.com/issues/show_bug.cgi?id=6336
I've already posted a pull request to fix the bug, but it has
been hold a while.
Kenji Hara
string always throws exception.
Kenji Hara
On Thursday, 21 June 2012 at 10:33:41 UTC, Namespace wrote:
To solve the problem of converting a Object to a specific
template class i wrote this little function.
But the mixin disturbs me. How i can get the type (in this
example Vector2D) without to mix a mixin and T.stringof?
[code]
T
, it is a bug.
Kenji Hara
On Wednesday, 6 June 2012 at 18:12:39 UTC, Namespace wrote:
If i have this code:
class Bar {
public:
Foo GetFoo() {
return this._foo;
}
alias GetFoo this;
}
to allow access to Foo methods from Bar i get the error, that
GetFoo isn't a property if i use -property.
Why?
The solution
On Saturday, 19 May 2012 at 18:17:16 UTC, Matthias Walter wrote:
On 2012-05-19 15:28, Philippe Sigaud wrote:
On Sat, May 19, 2012 at 12:23 PM, Matthias Walter
xa...@xammy.homelinux.net wrote:
I would open a bug report with the following code which is a
bit smaller
than my first wrong
On Sunday, 20 May 2012 at 06:57:20 UTC, Kenji Hara wrote:
On Saturday, 19 May 2012 at 18:17:16 UTC, Matthias Walter wrote:
Using the current git version of dmd I realized that C works!
Hence, as
a workaround it can be used by creating a local alias A and
subsequently
using A.Alias
On Sunday, 20 May 2012 at 06:57:20 UTC, Kenji Hara wrote:
On Saturday, 19 May 2012 at 18:17:16 UTC, Matthias Walter wrote:
On 2012-05-19 15:28, Philippe Sigaud wrote:
On Sat, May 19, 2012 at 12:23 PM, Matthias Walter
xa...@xammy.homelinux.net wrote:
I would open a bug report
On Thursday, 10 May 2012 at 07:32:42 UTC, Namespace wrote:
Can you explain me how TemplateThisParameter works? I read in
the
manual but a more detail explanation would help me a lot.
Hmm, I have thought following code should work about foo, but
doesn't.
import std.stdio;
struct Proxy
{
On Wednesday, 9 May 2012 at 06:42:09 UTC, Namespace wrote:
On Wednesday, 9 May 2012 at 04:49:39 UTC, Kenji Hara wrote:
On Tuesday, 8 May 2012 at 22:58:07 UTC, Namespace wrote:
In my development of the Ref / NotNull structure, I came
across a
problem: All the methods of Proxy aren't inout. Has
, typeof(o) == inout
p.g();
}
'Proxy' object should forward its 'this' type to original object.
For the purpose, TemplateThisParameter ('this T') works as
expected.
Kenji Hara
, there is not yet general way.
The definition of unformatValue for user-defined type in
different module isn't considered by std.format module. D's
module system is closed in basic.
Kenji Hara
}
Is that a bug or a feature? I might have opened it but I don't
remember now. :)
Ali
Bye.
Kenji Hara
Hello, but doesn't with the type
string.
(string is an aliased name of immutable(char)[], and it is
built-in array type.)
http://dlang.org/template.html#TemplateAliasParameter
Kenji Hara
/struct.html#StructLiteral
and it is an expression.
Bye.
Kenji Hara
the code above accept the const(int []) ?
Should do. It is a compiler bug.
I've filed this issue in bugzilla:
http://d.puremagic.com/issues/show_bug.cgi?id=7929
And posted a pull request to fix compiler code:
https://github.com/D-Programming-Language/dmd/pull/884
Thanks.
Kenji Hara
* a; };
Bye.
Kenji Hara
std.format doesn't support const class formatting with
upcasting to mutable Object and using mutable toString().
Is this good/expected?
It is a gap between language const system and object.Object class
interface.
I think Phobos should not break const system in basic.
Kenji Hara
On Tuesday, 27 March 2012 at 13:42:30 UTC, Tongzhou Li wrote:
Hello again! I'm learning D, and I encountered a problem.
I tried this code:
http://ideone.com/hkpT6
It works well. (Have no idea why codepad.org failed to compile
it)
I tried to write a lambda instead of function f, but I got
On Friday, 23 March 2012 at 23:01:43 UTC, Timon Gehr wrote:
On 03/23/2012 11:58 PM, David wrote:
Am 23.03.2012 23:52, schrieb H. S. Teoh:
Code:
struct S {
int f(K)(K x) {
return 1;
}
void func(K)(inout(K) x) {
auto h = f(x);
}
}
void main() {
S s;
s.func(abc); // This is line 44
}
This
On Wednesday, 21 March 2012 at 01:26:23 UTC, bearophile wrote:
import std.stdio;
void main() {
auto mat = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]];
writefln(%(%(%d %)\n%), mat);
writeln();
writefln([%(%(%d %)\n%)], mat);
writeln();
79 matches
Mail list logo