On 24.10.2015 15:18, Shriramana Sharma wrote:
int a[] = [1,2,3,4,5];
Aside: `int[] a;` is the preferred style for array declarations.
How to make it so that after clearing `a`, `b` will also point to the same
empty array? IOW the desired output is:
[1, 2, 3, 4, 5]
[1, 2, 3, 4, 5]
[]
[]
I'm afraid what you're asking for is impossible. Because 'a' and
'b' are both slices, they each have their own 'length' field.
When you do 'a = []', you're effectively doing 'a.length = 0'.
There's no way to change 'b.length' through 'a'. To get that
effect, you'd have to do something like
Jacob Carlborg writes:
> On 2015-10-24 12:01, Suliman wrote:
>
>> Would it be hard to add Windows/Linux host available? Would it be hard
>> to develop iOS apps on Windows in comparison of using MacOSX?
>
> It depends on what you mean. Microsoft already supports developing iOS
> apps
On Saturday, 24 October 2015 at 15:57:09 UTC, Dandyvica wrote:
Hi guys,
Apart from deriving from the same class and declaring an array
of that
root class, is there a way to create an array of templates?
This seems not possible since template are compile-time
generated, but just to be sure.
On Saturday, 24 October 2015 at 08:54:40 UTC, Nordlöw wrote:
Working first version at
https://github.com/nordlow/justd/blob/master/conv_ex.d#L207
Next I'll make it a range.
Made it a range:
https://github.com/nordlow/justd/blob/master/conv_ex.d#L207
On Saturday, 24 October 2015 at 13:18:26 UTC, Shriramana Sharma
wrote:
Hello. I had first expected that dynamic arrays (slices) would
provide a `.clear()` method but they don't seem to. Obviously I
can always effectively clear an array by assigning an empty
array to it, but this has unwanted
extrawurst writes:
> On Saturday, 24 October 2015 at 07:07:18 UTC, Dan Olson wrote:
>> This is another set of binaries and universal libs for the
>> experimental LDC iOS cross-compiler. It is now based on LDC 0.15.2
>> (2.066.1) and LLVM 3.6.1.
>>
>> [...]
>
> Cool work!
Hi guys,
Apart from deriving from the same class and declaring an array of
that
root class, is there a way to create an array of templates?
This seems not possible since template are compile-time
generated, but just to be sure. For example, it seems logical to
get an array of complex
On Saturday, 24 October 2015 at 16:58:58 UTC, qsdfghjk wrote:
On Saturday, 24 October 2015 at 15:57:09 UTC, Dandyvica wrote:
Hi guys,
Apart from deriving from the same class and declaring an array
of that
root class, is there a way to create an array of templates?
This seems not possible
While improving the DMD front-end's constant folding:
https://github.com/D-Programming-Language/dmd/pull/5229
I found out about DMD issue 14835:
https://issues.dlang.org/show_bug.cgi?id=14835
Briefly:
///
module main;
import std.stdio;
void reachIf(bool x)()
On Saturday, 24 October 2015 at 15:57:09 UTC, Dandyvica wrote:
Hi guys,
Apart from deriving from the same class and declaring an array
of that
root class, is there a way to create an array of templates?
This seems not possible since template are compile-time
generated, but just to be sure.
On Saturday, 24 October 2015 at 09:54:43 UTC, Jacob Carlborg
wrote:
When the template this parameter feature was added to the
language it was possible to use it for static methods:
class Foo
{
static void foo(this T)()
{
pragma(msg, T.stringof);
}
}
class Bar : Foo {}
On Tuesday, 20 October 2015 at 18:15:05 UTC, Bruno Medeiros wrote:
On 16/10/2015 08:02, Jacob Carlborg wrote:
On 2015-10-16 08:49, Dicebot wrote:
As far as I understand topic is about deprecating direct
field access of
synchronized classes, method calls in synhronized classes and
On Thursday, 22 October 2015 at 20:10:36 UTC, rsw0x wrote:
On Thursday, 22 October 2015 at 19:16:00 UTC, Laeeth Isharc
wrote:
On Thursday, 22 October 2015 at 18:23:08 UTC, Andrei
Alexandrescu wrote:
On 10/22/2015 09:08 AM, Walter Bright wrote:
[...]
This has been a homerun. Congratulations
https://issues.dlang.org/show_bug.cgi?id=14627
thomas.bock...@gmail.com changed:
What|Removed |Added
CC||thomas.bock...@gmail.com
---
On Saturday, 24 October 2015 at 17:06:13 UTC, Dandyvica wrote:
On Saturday, 24 October 2015 at 16:58:58 UTC, qsdfghjk wrote:
On Saturday, 24 October 2015 at 15:57:09 UTC, Dandyvica wrote:
Hi guys,
Apart from deriving from the same class and declaring an
array of that
root class, is there a
On Saturday, 24 October 2015 at 09:22:37 UTC, Jacob Carlborg
wrote:
Can these be implemented by the user just declaring a regular
container as immutable? The implement will recognize if it's
declared as immutable and adapt.
How can a type know it's qualifier?
struct Container(T)
{
//
Hello. I had first expected that dynamic arrays (slices) would provide a
`.clear()` method but they don't seem to. Obviously I can always effectively
clear an array by assigning an empty array to it, but this has unwanted
consequences that `[]` actually seems to allocate a new dynamic array and
On Saturday, 24 October 2015 at 09:54:43 UTC, Jacob Carlborg
wrote:
When the template this parameter feature was added to the
language it was possible to use it for static methods:
class Foo
{
static void foo(this T)()
{
pragma(msg, T.stringof);
}
}
class Bar : Foo {}
On Friday, 23 October 2015 at 06:55:37 UTC, Rory McGuire wrote:
I think IDE devs are supposed to use `dub describe` not read
the package
file directly.
That whole package loading section of dub should probably be a
library
though.
On Fri, Oct 23, 2015 at 8:47 AM, Eliatto via
On Saturday, 24 October 2015 at 13:18:26 UTC, Shriramana Sharma
wrote:
Hello. I had first expected that dynamic arrays (slices) would
provide a `.clear()` method but they don't seem to. Obviously I
can always effectively clear an array by assigning an empty
array to it, but this has unwanted
On Thursday, 22 October, 2015 02:50 AM, Adam D. Ruppe wrote:
Use the .exe installer and it will offer to download and install visual
studio for you as part for its process.
Sorry to ask this but could anyone please explain why Visual Studio is
required by DMD 64-bit? (I have been away far too
On Saturday, 24 October 2015 at 12:14:18 UTC, suliman wrote:
On Saturday, 24 October 2015 at 12:07:29 UTC, karabuta wrote:
On Friday, 23 October 2015 at 10:09:36 UTC, Chris wrote:
On Thursday, 22 October 2015 at 20:14:06 UTC, karabuta wrote:
On Tuesday, 20 October 2015 at 17:58:07 UTC, tcak
On Friday, 23 October 2015 at 17:44:55 UTC, deadalnix wrote:
void foo(T)(const Collection!const(T) c) {}
void main() {
Collection!T c;
foo(c); // Error, GTFO !
}
How about this?
void f(T)(const Collection!T c)
{
const Collection!(Unqual!T) cc = c;
}
On Saturday, 24 October 2015 at 23:26:09 UTC, stewart wrote:
Hi All,
Given this code:
---
import std.traits;
import std.range;
import std.stdio;
enum isSupportedRange(T) = (isInputRange!T &&
isIntegral!(ForeachType!T));
void func(T)(T vals)
{
static if(isSupportedRange!T) {
//
On Saturday, 24 October 2015 at 23:59:02 UTC, qsdfghjk wrote:
On Saturday, 24 October 2015 at 23:34:19 UTC, stewart wrote:
On Saturday, 24 October 2015 at 23:26:09 UTC, stewart wrote:
[...]
Oh and the workaround I'm using is this:
---
void func(T)(T vals) {
static if(isInputRange!T) {
On Saturday, 24 October 2015 at 23:59:02 UTC, qsdfghjk wrote:
On Saturday, 24 October 2015 at 23:34:19 UTC, stewart wrote:
On Saturday, 24 October 2015 at 23:26:09 UTC, stewart wrote:
[...]
Oh and the workaround I'm using is this:
---
void func(T)(T vals) {
static if(isInputRange!T) {
On 10/24/15 3:19 PM, Timon Gehr wrote:
Even if this was possible, it would not be a very good idea. Persistent
data structures have use cases that would be hindered by required
transitive immutability.
This part I don't quite get. Are there any languages that offer
containers with immutable
Hi, are there any tools for compilation time profiling? I'm
trying to find what part of the code increases compilation time
and don't want to stumble around.
https://issues.dlang.org/show_bug.cgi?id=15244
Issue ID: 15244
Summary: Misleading compiler warning: "Error: use .min_normal
property instead of .min"
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Hi All,
Given this code:
---
import std.traits;
import std.range;
import std.stdio;
enum isSupportedRange(T) = (isInputRange!T &&
isIntegral!(ForeachType!T));
void func(T)(T vals)
{
static if(isSupportedRange!T) {
// Do something with a range
} else {
// Do something
On Saturday, 24 October 2015 at 16:05:15 UTC, bitwise wrote:
[...]
class TypeInfo {}
class TypeInfoImpl(T) : TypeInfo {}
class BaseObject {
static TypeInfo typeInfo(this This)() {
return TypeInfoImpl!This();
}
static TypeInfo info = typeInfo();
}
class Foo : BaseObject {
An interesting article about memory fragmentation:
http://nfrechette.github.io/2015/06/25/out_of_memory/
On Saturday, 24 October 2015 at 21:56:05 UTC, tired_eyes wrote:
Hi, are there any tools for compilation time profiling? I'm
trying to find what part of the code increases compilation time
and don't want to stumble around.
There's this:
https://github.com/CyberShadow/DBuildStat
Example
On 10/24/2015 09:33 PM, David Nadlinger wrote:
On Friday, 23 October 2015 at 17:44:55 UTC, deadalnix wrote:
Collection!T and Collection!const(T) are 2 completely different types.
Isn't this also required anyway because of covariance vs. contravariance
considerations?
— David
(I'm
On Saturday, 24 October 2015 at 19:00:57 UTC, TheFlyingFiddle
wrote:
One thing about variant is that if the struct you are trying to
insert is larger then (void delegate()).sizeof it will allocate
the wrapped type on the gc heap.
This is not a concern if you want to have class templates as
On Saturday, 24 October 2015 at 18:40:02 UTC, TheFlyingFiddle
wrote:
To complete TemplateStruct simply forward the remaing members
of the
variant. Or use something like proxy!T in std.typecons. Or use
an alias this v.
(I don't really recommend alias this it has all kinds of
problems)
One
On 2015-10-24 15:38, Marc Schütz wrote:
It was changed in this PR:
https://github.com/D-Programming-Language/dmd/pull/1687
It's hard to tell whether it was intentional though. But IMO your code
should work, so I suggest you file a bug report.
I did that, back in 2013 [1]. It was closed as
Try this
https://github.com/filcuc/DOtherSide
How cross platform is dqml by the way?
I think it should be work on Linux too. On Windows it's fine.
Maybe even MacOSX will work. Also you may look at
http://www.dsfml.com/
On Saturday, 24 October 2015 at 04:59:02 UTC, suliman wrote:
On Thursday, 22 October 2015 at 19:00:07 UTC, Kai Nacke wrote:
Hi everyone,
LDC 0.16.0, the LLVM-based D compiler, is available for
download!
This release is based on the 2.067.1 frontend and standard
library and supports LLVM
On 10/24/2015 09:22 PM, Andrei Alexandrescu wrote:
On 10/24/15 3:19 PM, Timon Gehr wrote:
Even if this was possible, it would not be a very good idea. Persistent
data structures have use cases that would be hindered by required
transitive immutability.
This part I don't quite get.
The slots
On Saturday, 24 October 2015 at 23:34:19 UTC, stewart wrote:
On Saturday, 24 October 2015 at 23:26:09 UTC, stewart wrote:
[...]
Oh and the workaround I'm using is this:
---
void func(T)(T vals) {
static if(isInputRange!T) {
static if(isIntegral!(ForeachType!T)) {
//
On Saturday, 24 October 2015 at 18:29:08 UTC, TheFlyingFiddle
wrote:
Variant[] array;
array ~= S!int(...);
array ~= S!double(...);
array ~= S!long(...);
array ~= "I am a string!";
And this is probably not what you want.
You can do this if you want to ensure that items stored in the
variant
On 10/24/2015 11:22 AM, Jacob Carlborg wrote:
On 2015-10-21 13:05, Andrei Alexandrescu wrote:
1. Functional containers.
These are immutable; once created, neither their topology nor their
elements may be observably changed. Manipulating a container entails
creating an entire new container,
On Friday, 23 October 2015 at 17:44:55 UTC, deadalnix wrote:
Collection!T and Collection!const(T) are 2 completely different
types.
Isn't this also required anyway because of covariance vs.
contravariance considerations?
— David
On Saturday, 24 October 2015 at 12:07:29 UTC, karabuta wrote:
Thanks for the insights.
Sorry I meant tkd, not wxD.
On Saturday, 24 October 2015 at 09:14:40 UTC, Jacob Carlborg
wrote:
On 2015-10-24 01:23, Adam D. Ruppe wrote:
We just recently got it in for Windows, pretty well auto
generated, so I
should hope we can get it for Mac too.
Oh, I didn't know it was the automatically generated. My
concern are
hi all
what do you think about high level functions such as get, post,
put, delete returning a Request object with status code, headers
and content as its properties rather than just the content? this
would make things easier for n00bs and newcomers to D as everyone
would not have to create
rsw0x wrote:
> use std.container.array
Thanks all for all the recommendations. When would one use
std.array.appender with a built-in array vs std.container.array.Array? What
are the pros and cons on either side?
--
Shriramana Sharma, Penguin #395953
On 25/10/15 6:01 PM, Nerve wrote:
Hello D community! First time poster, I'm utterly fascinated with this
language's mix of features. It's powerful and expressive.
There are just two conveniences I'd like to see out of D. The first is
pattern matching, a functional construct which can unwrap
On 10/24/2015 04:15 AM, Cauterite wrote:
On Saturday, 24 October 2015 at 11:01:24 UTC, grumpyalittle wrote:
My name is Daisy and I was on Erasmus program in Poland. During
This looks like spam to me.
Of course spam but it's pretty amusing. :) It must have happened like this:
- Polish
On Sunday, 25 October 2015 at 05:05:47 UTC, Rikki Cattermole
wrote:
Since I have no idea what the difference between Some(_), None
and default. I'll assume it's already doable.
_ represents all existing values not matched. In this case,
Some(_) represents any integer value that is not 7. None
Just wondering if D's GC release memory back to the OS?
The documentation for the GC.minimize
(http://dlang.org/phobos/core_memory.html#.GC.minimize) seems to
imply that it does,
but watching my OS's memory usage for various D apps doesn't
support this.
On 25/10/15 9:05 AM, Kagamin wrote:
An interesting article about memory fragmentation:
http://nfrechette.github.io/2015/06/25/out_of_memory/
The last couple of streams + a bit of time off it.
I've spent quite a bit of it working on a host name + port router and
the optimization function
Hello D community! First time poster, I'm utterly fascinated with
this language's mix of features. It's powerful and expressive.
There are just two conveniences I'd like to see out of D. The
first is pattern matching, a functional construct which can
unwrap tuples or other containers, usually
On Sunday, 25 October 2015 at 03:22:39 UTC, Joakim wrote:
On Saturday, 24 October 2015 at 15:40:41 UTC, Jack Stouffer
wrote:
That's surprising given that many were worried that switching
to ddmd would slow compilation speeds down by at least 30%.
Also, this does not seem to be using any of
On Saturday, 24 October 2015 at 15:40:41 UTC, Jack Stouffer wrote:
On Saturday, 24 October 2015 at 03:11:30 UTC, Joakim wrote:
The associated travis CI run that finally went green with ldc
0.16.0 beta 2 took about as long as the other D compilers, so
performance of ldc-compiled ddmd seems
On Saturday, 24 October 2015 at 19:33:03 UTC, David Nadlinger
wrote:
On Friday, 23 October 2015 at 17:44:55 UTC, deadalnix wrote:
Collection!T and Collection!const(T) are 2 completely
different types.
Isn't this also required anyway because of covariance vs.
contravariance considerations?
On 25/10/15 6:45 PM, Nerve wrote:
On Sunday, 25 October 2015 at 05:05:47 UTC, Rikki Cattermole wrote:
Since I have no idea what the difference between Some(_), None and
default. I'll assume it's already doable.
_ represents all existing values not matched. In this case, Some(_)
represents any
On Saturday, 24 October 2015 at 12:07:29 UTC, karabuta wrote:
On Friday, 23 October 2015 at 10:09:36 UTC, Chris wrote:
On Thursday, 22 October 2015 at 20:14:06 UTC, karabuta wrote:
On Tuesday, 20 October 2015 at 17:58:07 UTC, tcak wrote:
On Tuesday, 20 October 2015 at 17:01:19 UTC, karabuta
This is another set of binaries and universal libs for the experimental
LDC iOS cross-compiler. It is now based on LDC 0.15.2 (2.066.1) and
LLVM 3.6.1.
https://github.com/smolt/ldc-iphone-dev/releases/tag/ios-0.15.2-151023
What's new?
- arm64 for iOS 64-bit devices
- C ABI compatibility
On 24-Oct-2015 02:45, Anon wrote:
On Friday, 23 October 2015 at 21:22:38 UTC, Vladimir Panteleev wrote:
That doesn't sound right. In fact, this puts into question why
dchar.max is at the value it is now. It might be the current maximum
at the current version of Unicode, but this seems like a
On 2015-10-24 02:57, Laeeth Isharc wrote:
I read it quickly so may have missed, but I meant in the vision document ;)
Oh, no I understand :). I guess it's not part of the vision. You have to
ask Andrei/Walter about that.
Personally, for me, it doesn't matter. I won't work more or less on
On 2015-10-21 13:05, Andrei Alexandrescu wrote:
1. Functional containers.
These are immutable; once created, neither their topology nor their
elements may be observably changed. Manipulating a container entails
creating an entire new container, often based on an existing container
(e.g. append
Hi ponce,
Thanks for your suggestion.
I think I may have found the beginning of a solution:
class E
{
import std.traits;
void apply(this F, U)(void delegate(U e) f)
if(is(Unqual!U == E))
{
f(this);
}
int val;
}
int main()
{
void setToZero(E e)
{
e.val = 0;
}
On Saturday, 24 October 2015 at 11:28:17 UTC, Sebastien Alaiwan
wrote:
Hi ponce,
Thanks for your suggestion.
I think I may have found the beginning of a solution:
class E
{
import std.traits;
void apply(this F, U)(void delegate(U e) f)
if(is(Unqual!U == E))
{
f(this);
}
int
On Friday, 23 October 2015 at 10:09:36 UTC, Chris wrote:
On Thursday, 22 October 2015 at 20:14:06 UTC, karabuta wrote:
On Tuesday, 20 October 2015 at 17:58:07 UTC, tcak wrote:
On Tuesday, 20 October 2015 at 17:01:19 UTC, karabuta wrote:
I hope I am wrong, but dlangui seems to be abandoned for
https://issues.dlang.org/show_bug.cgi?id=14835
--- Comment #6 from thomas.bock...@gmail.com ---
Here's a minimal compilable (requires dmd argument -wi, rather than -w)
example, for anyone trying to fix this:
module main;
import std.stdio;
void reachIf(bool x)()
{
if(!x)
return;
On 2015-10-24 12:01, Suliman wrote:
Would it be hard to add Windows/Linux host available? Would it be hard
to develop iOS apps on Windows in comparison of using MacOSX?
It depends on what you mean. Microsoft already supports developing iOS
apps on Windows, but the building is actually
On Saturday, 24 October 2015 at 11:01:24 UTC, grumpyalittle wrote:
My name is Daisy and I was on Erasmus program in Poland. During
This looks like spam to me.
On 2015-10-23 14:44, Steven Schveighoffer wrote:
Also, what type does 'id' map to?
I don't think that "id" is particular interesting. Apple is moving away
from it more and more. They added the "instancetype" feature for the
declarations of "init" and "alloc". They added generics for
Only binaries for OS X build host are available.
Would it be hard to add Windows/Linux host available? Would it be
hard to develop iOS apps on Windows in comparison of using MacOSX?
On 2015-10-24 01:23, Adam D. Ruppe wrote:
We just recently got it in for Windows, pretty well auto generated, so I
should hope we can get it for Mac too.
Oh, I didn't know it was the automatically generated. My concern are
these posts:
On 10/24/2015 01:36 AM, bitwise wrote:
On Friday, 23 October 2015 at 23:21:31 UTC, bigsandwich wrote:
On Friday, 23 October 2015 at 17:44:55 UTC, deadalnix wrote:
On Friday, 23 October 2015 at 11:03:37 UTC, Andrei Alexandrescu wrote:
[...]
Sure. We have a problem when it come to collection
On Tuesday, 20 October 2015 at 22:14:24 UTC, Brian Schott wrote:
On Tuesday, 20 October 2015 at 08:28:19 UTC, Dicebot wrote:
Which LDC is it supposed to build with? Trying latest stable
(0.15.1) I get:
src/server/autocomplete.d(23): Error: module logger is in file
'std/experimental/logger.d'
On Saturday, 24 October 2015 at 07:07:18 UTC, Dan Olson wrote:
This is another set of binaries and universal libs for the
experimental LDC iOS cross-compiler. It is now based on LDC
0.15.2 (2.066.1) and LLVM 3.6.1.
[...]
Cool work!
Can this be merged with official LDC eventually ?
Hi all,
I'm trying to get the following code to work.
(This code is a simplified version of some algebraic type).
Is it possible to only declare one version of the 'apply'
function?
Or should I declare the const version and the non-const version?
I tried using "inout", but I got the following
When the template this parameter feature was added to the language it
was possible to use it for static methods:
class Foo
{
static void foo(this T)()
{
pragma(msg, T.stringof);
}
}
class Bar : Foo {}
Foo.foo(); // prints "Foo"
Bar.foo(); // prints "Bar"
For some reason
https://issues.dlang.org/show_bug.cgi?id=14835
Marc Schütz changed:
What|Removed |Added
CC||schue...@gmx.net
--
My name is Daisy and I was on Erasmus program in Poland. During
this period I decided to try to learn this language, what I
thought couldn’t be easy. I went to school of Polish (called
Prolog, more info here: www.polishcourses.com) and I started with
no expectations. But now I’m really glad
I am trying to write a function to merge two named structs, but
am completely stuck on how to do that and was wondering if anyone
good provide any help. I know I can access the different names
with tup.fieldNames, but basically can't work out how to use that
to build the new return type. Below
https://issues.dlang.org/show_bug.cgi?id=15243
Sebastien Alaiwan changed:
What|Removed |Added
CC||ac...@free.fr
--
https://issues.dlang.org/show_bug.cgi?id=15243
Issue ID: 15243
Summary: rejects-valid on variadic
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: normal
Priority: P1
On Saturday, 24 October 2015 at 08:51:58 UTC, Sebastien Alaiwan
wrote:
Hi all,
I'm trying to get the following code to work.
(This code is a simplified version of some algebraic type).
Is it possible to only declare one version of the 'apply'
function?
Or should I declare the const version
On Thursday, 22 October 2015 at 21:52:05 UTC, anonymous wrote:
On 22.10.2015 21:13, Nordlöw wrote:
Hmm, why isn't this already in Phobos?
Working first version at
https://github.com/nordlow/justd/blob/master/conv_ex.d#L207
Next I'll make it a range.
85 matches
Mail list logo