On 11/16/2013 11:21 PM, Meta wrote:
>> First, just a reminder: Classes in D are reference types so in most
>> cases there is no need for ref; it already is a reference to the
>> actual object.
>
> Just out of curiosity, what does ref Object actually do?
It allows changing the actual object that
First, just a reminder: Classes in D are reference types so in
most cases there is no need for ref; it already is a reference
to the actual object.
Just out of curiosity, what does ref Object actually do? Is it
just a no-op?
On Saturday, 16 November 2013 at 23:34:55 UTC, Jonathan M Davis
wrote:
If you want to use the type system to try and protect against
dereferencing
null, then having wrapper which guarantees that the object
_isn't_ null makes
a lot more sense, particularly when just because you used
Optional ins
unfortunately this problem keeps arising every so often and the only thing
we have are workarounds
to name a few:
digitalmars.D - Typesafe variadics in any position
feature request: special optional argument (__FILE__, ...) AFTER variadic
template
On Sat, Nov 16, 2013 at 3:55 PM, Jonathan M Davi
Namespace:
It is always surprising how quickly one has found its own
solution, after you have posted here... :)
This is a well known psychological phenomenon: when you explain
your problem to other people you lay down the problem very well,
its constraints, its invariants, your needs, and th
On Sunday, November 17, 2013 00:09:53 Namespace wrote:
> On Saturday, 16 November 2013 at 22:57:35 UTC, Namespace wrote:
> > Hi.
> > Is it possible to write something like that?
> >
> > void error(Args...)(string msg, Args args, string file =
> > __FILE__, size_t line = __LINE__) { ... }
> > -
On Saturday, November 16, 2013 11:18:38 Meta wrote:
> On Saturday, 16 November 2013 at 05:04:42 UTC, Jonathan M Davis
>
> wrote:
> > I really don't understand this. Optional is one of the most
> > useless ideas
> > that I've ever seen in Java. Just use null. It's built into the
> > language. It
>
On Saturday, 16 November 2013 at 08:42:05 UTC, rumbu wrote:
I suppose that these two are related.
Are these bugs or it's not possible to have templated functions
in an interface?
It is possible to define templates on interfaces however they
have to be implemented in the interface using the
N
Le 16/11/2013 23:26, Rene Zwanenburg a écrit :
On Saturday, 16 November 2013 at 16:22:17 UTC, Piotr Podsiadły wrote:
On Saturday, 16 November 2013 at 14:41:46 UTC, Maxim Fomin wrote:
What kind of problem you try to solve by manual defining system data
structures? Why not use platform independen
On Saturday, 16 November 2013 at 22:57:35 UTC, Namespace wrote:
Hi.
Is it possible to write something like that?
void error(Args...)(string msg, Args args, string file =
__FILE__, size_t line = __LINE__) { ... }
?
Currently not, but how could it be done? I wont like to write:
err
Hi.
Is it possible to write something like that?
void error(Args...)(string msg, Args args, string file =
__FILE__, size_t line = __LINE__) { ... }
?
Currently not, but how could it be done? I wont like to write:
error(format(msg, args));
Thanks in advance. :)
On Saturday, November 16, 2013 08:10:30 Ali Çehreli wrote:
> On 11/15/2013 06:55 AM, Alexandr Druzhinin wrote:
> > I'd like to get slice that's consist of begining one other slice and end
> > of yet another slice (all slices belong to the same array of course). Is
> > it possible? With iterators it
On Saturday, 16 November 2013 at 16:22:17 UTC, Piotr Podsiadły
wrote:
On Saturday, 16 November 2013 at 14:41:46 UTC, Maxim Fomin
wrote:
What kind of problem you try to solve by manual defining
system data structures? Why not use platform independent valid
declarations? Why did you decide that _
On 11/16/2013 08:59 AM, ilya-stromberg wrote:
> I think it's good to listen a little critics from newcomers. I belive
> that it helps Ali Cehreli to improve the book.
Exactly! :) Two quotes from the Introduction chapter:
"If you come across chapters that you find to be particularly difficult,
On Friday, 15 November 2013 at 22:22:32 UTC, Jacek Furmankiewicz
wrote:
Sohow does Facebook handle it with their new D code?
No GC at all, explicit memory management?
AFAWK, Facebook doesn't use D for its core business yet, only for
buiding tools. OTOH, Andrei has been working hard on mem
On 11/16/13 7:41 AM, Max Klyga wrote:
On 2013-11-16 05:04:20 +, Jonathan M Davis said:
I really don't understand this. Optional is one of the most useless
ideas
that I've ever seen in Java. Just use null.
Optional specifies explicitly that value can be absent and forces client
to check be
On Friday, 15 November 2013 at 23:51:42 UTC, Jacek Furmankiewicz
wrote:
Thanks for the book! I printed it, all 673 pages of it. Immense
work you have there.
I think it's good to listen a little critics from newcomers. I
belive that it helps Ali Cehreli to improve the book.
Also, you can use
On 11/16/2013 12:42 AM, rumbu wrote:
> interface I
> {
> void foo(T)(T t);
Hm? What would the meaning of that declaration be? Would the interface
be happy with any instantiation of foo?
> }
>
> class C: I
> {
> }
> //bug 1: compiler does not complain about the fact that C doesn't
> imple
On 11/16/2013 06:08 AM, Jeroen Bollen wrote:
I cannot seem to pass values to functions by referece.
--
@safe public nothrow this(ref Socket socket) {
// Inside class modulename.classname
this.
On Saturday, 16 November 2013 at 14:41:46 UTC, Maxim Fomin wrote:
What kind of problem you try to solve by manual defining system
data structures? Why not use platform independent valid
declarations? Why did you decide that _JBLEN is 64, 256, 528
according to version? Why did you decide that ha
On 11/15/2013 06:55 AM, Alexandr Druzhinin wrote:
I'd like to get slice that's consist of begining one other slice and end
of yet another slice (all slices belong to the same array of course). Is
it possible? With iterators it's simple, but I can't manage do it with
slices.
http://dpaste.dzfl.pl/
Jeroen Bollen:
Same error, but "is not callable using argument types
(TcpSocket)"...
Have you used an auxiliary value inside the main with the cast?
Bye,
bearophile
On Friday, 15 November 2013 at 22:33:34 UTC, Brad Anderson wrote:
Appender in std.array is probably what you are looking for.
std.algorithm.joiner is also useful (no allocations at all
even) but the use case is a bit different.
Is Appender considered up to Phobos' current standards? I vaguely
On Saturday, 16 November 2013 at 14:14:24 UTC, Piotr Podsiadły
wrote:
Hello,
I'm trying to use setjmp and longjmp on Windows with DMD
compiler (version 2.064). When compiled as 64-bit application,
it works, but 32-bit version crashes inside longjmp. What
should be changed to get it to work?
On Saturday, 16 November 2013 at 14:28:45 UTC, bearophile wrote:
Jeroen Bollen:
Why is that?
It's caused by the cast. The solution is to use an auxiliary
value inside the main, or remove the cast.
Bye,
bearophile
Same error, but "is not callable using argument types
(TcpSocket)"...
Jeroen Bollen:
Why is that?
It's caused by the cast. The solution is to use an auxiliary
value inside the main, or remove the cast.
Bye,
bearophile
Hello,
I'm trying to use setjmp and longjmp on Windows with DMD compiler
(version 2.064). When compiled as 64-bit application, it works,
but 32-bit version crashes inside longjmp. What should be changed
to get it to work?
I tried changing value of _JBLEN for x86 to some bigger number
(like
I cannot seem to pass values to functions by referece.
--
@safe public nothrow this(ref Socket socket) {
// Inside class modulename.classname
this.socket = socket;
}
---
On Sat, 2013-11-16 at 00:04 -0500, Jonathan M Davis wrote:
[…]
> I really don't understand this. Optional is one of the most useless ideas
> that I've ever seen in Java. Just use null. It's built into the language. It
> works just fine. And wrapping it in a class isn't going to make it go away.
16.11.2013 18:38, Jonathan M Davis пишет:
Well, if you want to get a slice which refers to the same thing as that slice
but includes elements which are in what is being sliced but which aren't in
that slice, you can only get the slice that you want be reslicing whatever the
slices came from. So,
On Friday, November 15, 2013 22:21:03 Alexandr Druzhinin wrote:
> 15.11.2013 22:13, bearophile пишет:
> > Alexandr Druzhinin:
> >
> > A simple solution is to keep two indexes, and use them to find the
> > slices when you need them.
>
> I did it the first. But then I decided to make it more D-ish
On 2013-11-15 16:27, Jacek Furmankiewicz wrote:
One of the nice features of Go is that when you compile an app, it pulls
in ALL the dependencies (i.e. the full SDK + all libraries your app
depends on) and generates a single binary (around 2 MB for a Hello World
app).
This is extremely useful for
On 2013-11-16 05:04:20 +, Jonathan M Davis said:
I really don't understand this. Optional is one of the most useless ideas
that I've ever seen in Java. Just use null.
Optional specifies explicitly that value can be absent and forces
client to check before using the value.
Also, if Optiona
On Saturday, 16 November 2013 at 05:04:42 UTC, Jonathan M Davis
wrote:
I really don't understand this. Optional is one of the most
useless ideas
that I've ever seen in Java. Just use null. It's built into the
language. It
works just fine. And wrapping it in a class isn't going to make
it go awa
What fails is that initialization of the mutable reference on
the left-hand side from the const reference on the right-hand
side.
Ali
Ah, right. In D a copy is a move followed by a post-blit and the
move fails because the source is const, got it.
It's still silly, though. In theory the com
interface I
{
void foo(T)(T t);
}
class C: I
{
}
//bug 1: compiler does not complain about the fact that C doesn't
implement foo(), even if C is instantiated somewhere.
void bar(I i)
{
i.foo(2);
}
//bug 2: Error 42: Symbol Undefined
_D4main1I10__T3fooTiZ3fooMFiZv (void main.I.foo!(int
On Friday, 15 November 2013 at 22:39:40 UTC, Jacek Furmankiewicz
wrote:
Many other languages are starting to frown on returning null
values from methods (due to NullPointerException risks, etc)
and wrapping them instead in an Optional like in
Scala:
http://blog.danielwellman.com/2008/03/using-
37 matches
Mail list logo