the compromise we came up with.
--
Derek Parnell
On Thu, 15 Mar 2012 08:52:26 +1100, Andrei Alexandrescu
wrote:
On 3/14/12 3:00 PM, Simen Kjærås wrote:
template to(T...) {
alias T to;
}
auto from(T...)(T t) {
struct Result { T t; alias t this; }
return Result( t );
}
void main( ) {
int a = 3;
int b = 4;
to!(a, b) = from(b, a);
assert(
On Thu, 15 Mar 2012 18:09:37 +1100, so wrote:
Hello,
Not related to D but this is a community which i can find at least a few
objective person. I want to invest some "quality" time on a dynamic
language but i am not sure which one. Would you please suggest one?
To give you an idea what i
for the flight.
--
Derek Parnell
when 'a' is an integer of any size or sign.
This should *not* be a compiler error as it is a convenient shorthand for
some coders. Personally, I try not to code this idiom because I find it
misleading in terms of self documentation ... but then I'm against using
goto as well ;-)
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ty. Spelling variations that are "cute" or "modern", are
fine in other contexts but not really in a technical forum where there are
readers from many different cultures and spoken languages. Using the
standard form of English is also a sign of politeness and inclusiveness. In
general, we are attempting to communicate our thoughts here so we need to
do that in a way that makes it easy for all potential readers in the forum.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
that you trying to help
others understand ... now I understand you a bit more.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Thu, 04 Jun 2009 19:42:52 -0400, superdan wrote:
> my philosophy lesson's worth wut u paid fer it.
Yes it is.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
of small integral value or golf
> scores relative to par.
Or sound wave sample points [-127, 127]
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
how one can remember all the equivalent HTML tags.
I really would not like depending solely on a GUI application to write
source code that has embedded documentation.
There is a valid place for both models of creating a HTML page.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
n type for byte and ubyte is short. Byte and ubyte
have overlapping ranges of values (-127 to 127) and (0 to 255) so a common
type would have to be able to hold both these ranges at least, and short
(16-bit signed integer) does that.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
in
you: dmd main.d foo.d
me: bud main
you: dmd main.d foo.d and.d lots.d of.d other.d stuff.d
me: bud main
you: 90% of the time that I need more than that, I'm
getting into non D build steps so nothing short
of a fully general system able to run arbitrary
command will cut it
it that these are not method names I would have choosen, as I
would have preferred names more like ... isEmpty(), getFront(),
moveForwards(), getBack(), moveBackwards(), getElement(N), addElement(E),
but the bikeshed gods have more wisdom than me ... and not that I'm
complaining of course.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Thu, 18 Jun 2009 21:00:08 -0400, bearophile wrote:
> Thank you Derek Parnell for your nice summary about ranges:
> with to your post my understanding of this topic has gone
> from 10% to 15% :-)
LOL ... glad to have helped a tiny bit.
> There are things I don't understand f
On Thu, 18 Jun 2009 19:07:06 -0700, Robert Fraser wrote:
> I think an OutputRange doesn't have to be an InputRange. It just needs
> put().
You're right. I misread the documentation on that one.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Thu, 25 Jun 2009 14:10:10 +0200, Don wrote:
> Derek Parnell wrote:
>>>> On Thu, Jun 18, 2009 at 11:56 AM, BCS wrote:
>>>>
>>>>> Hello steel,
>>>>>
>>>>> build tools: ??? haven't followed that much. I use a command
On Thu, 25 Jun 2009 20:44:04 +0100, Robert Clipsham wrote:
> Bud hasn’t
> been updated in a long time, which is annoying, since there are some
> really irritating bugs.
Like what? Have these been reported?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Thu, 25 Jun 2009 18:28:53 -0400, Jarrett Billingsley wrote:
> All of the bugs I've run into in bud have already been reported by
> others.
I think I know what I'm doing this weekend ;-)
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
one. I'll try to reproduce it but
not sure if I can yet. I don't really want to download gtk or tango if I
can help it.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
urce control.
> It's in phobos/docsrc.
What does "in phobos/docsrc" mean? Is that a partial URL or something that
is in the download package. In either case, I don't seem to be able to find
it. Can you be a lot more specific?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
write. this is not
> china and you are not the great firewall.
> grow up.
>
> if you want a moderated NG than ask Walter to create one. This is *not*
> such a NG and people *will* discuss whatever they want, whether you like
> it or not.
I agree with both of you.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
.".
LOL ... yeah, right.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
multithreading
> problems - hope D will help here in the future
Ok then ... so optlink is going to be rewritten in D - excellent! And good
luck to the brave developer too.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ing, and work on it!
I've picked the docs. I'm attempting to remove all hardcoded HTML tags from
the .dd files. To what address do I send the updated files?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
eive any acknowledgement that they have been received so I don't
actually know if Mr B is getting them.
What I'd like is Walter to tell me/us where to send such things. I've
scanned the website for information but can't find anything there.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
he .dd files. To what address do I send the updated files?
>>
>
> I'd e-mail patches to Walter or attach them to an issue in the issue tracker.
> Either way make sure Walter knows about them.
By the way, I'm using Windows so I don't know how to do a 'patch'
idea of how I can do this?
>>
>
> Use SVN. I'm assuming you got the .dd files that way. I think the command
> line tools will do it and I know tortoiseSVN can. It even tags the result
> with the version it's off of.
Thanks, that worked perfectly.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
; for the bad half, do you comment in the bug reports about why you think the
>> patches are bad?
>
> Sometimes, but not usually. I doubted anyone cared as long as they got
> fixed one way or another.
Bzzzt ... wrong answer.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
because
you can get a 99% correct program shipped without having to spend 200% of
the money available.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Sun, 05 Jul 2009 18:55:57 -0700, David B. Held wrote:
> I just upgraded
> to 2.029 and now I have this problem:
I have this too, and I'm using 2.030. It works fine with v1.045.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Tue, 07 Jul 2009 04:35:56 -0400, Mike James wrote:
>
> Or you introduce a new keyword :-)
Ooooh you said the 'k' word, naughty boy.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
reak;
case 2,5,7,10 .. 17, 24, 32: funcB(); break;
case 3,6,8,18 .. 23: funcC(); break;
}
In other words, allowing a range of value inside a list of values.
How is this possible in today's D?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Tue, 07 Jul 2009 10:50:08 -0700, Walter Bright wrote:
> I like:
>
> a .. b+1
>
> to mean inclusive range.
LOL, now that *is* funny.
And I like the Euphoria language's version ...
case X to Y
but so what, eh?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
n inclusive range was being requested by
the coder.
Walter's example, using a function call, could be useful as the function
can have side-effects that influence the next sub-expression "x + 3".
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Wed, 8 Jul 2009 07:48:07 +1000, Derek Parnell wrote:
> On Tue, 07 Jul 2009 10:50:08 -0700, Walter Bright wrote:
>
>> I like:
>>
>> a .. b+1
>>
>> to mean inclusive range.
>
> LOL, now that *is* funny.
>
> And I like the Euphoria languag
e me
very clever or very stupid ... h?
By the way, I don't like triple-dot either, but just making a point.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
inclusive.
Currently, ('a' .. 'z'+1)
Logically, ('a' .. 'z')
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
this idea?
I would not complain if trailing dot and leading dot were disallowed.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Tue, 07 Jul 2009 19:42:00 -0500, Andrei Alexandrescu wrote:
> Derek Parnell wrote:
>> On Tue, 07 Jul 2009 19:29:21 -0500, Andrei Alexandrescu wrote:
>>
>>> There is no need for a right-closed range in the language. It can be
>>> defined with ease as a library
I think that I'm not ready for the D programming language after all. I'll
drop by the sandbox from time to time out of curiosity, I suppose. Good
luck and thanks for all the fish.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ations. Safe coding practices should not be penalized.
The C/C++ programming language is inherently "unsafe" in this regard, and
that is not news to anyone. The D programming language does not have to
follow this paradigm.
I'm still not ready to use D for anything, but I watch it in hope.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ing" and then has to switch tracks "oh no,
this actually means we are using a template this time". I'm *so* over the
amount of symbol and keyword overloading that goes on in D and C-like
languages. It's as if they were devised by academics during the days when
data transmission times were slow and only they looked at source code.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
d are
having no significant commits are those that might be worthy of relegation.
Your suggestions implies that only active incomplete projects (or ones that
are constantly being beautified) are worthwhile. Projects that are
complete, or at least stable in terms of bug fixing, would drop off t
as the last item in a range. It seems really, really
odd; rather contrived actually.
I think intutive words for the first and last items in a range would be
'first' and 'last'.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ately precedes the current (B) element.
My preferences are ...
(A) first
(B) last
(C) firstpart
(D) lastpart
(E) midpart
(F) current
(G) dropfirst
(H) droplast
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
my vote as I can't see my name
anywhere.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
more choises if needed, or Andrei could create his own poll or
> whatever.
Curious that first/last didn't get a mention in your poll?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Fri, 30 Jan 2009 14:46:28 -0800, Andrei Alexandrescu wrote:
> Names are important. "take" is taken from Haskell.
No it hasn't. Haskell still has it so its been "copied" from Haskell. :-)
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
e for
> short functions that don't need access to local state, their efficiency
> is exemplary, and their error messages are not half bad.
And syntax-highlighting editors just love them ;-) Knowing which strings
contain code and which don't is a piece of cake, no?
--
Derek Parn
On Sat, 31 Jan 2009 16:26:08 -0800, Andrei Alexandrescu wrote:
> The language can help here. q{stuff} is a "token string"
I was not aware of the q{} syntax. That should work for smart editors.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ng elements, whereas in a
sequence an element can be predicted using only the existing element
values.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
-- Move along to the next element pair.
a.next;
b.next;
-- And repeat.
} while (true);
return sqrt(result);
}
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
rams have is conflating value types with reference types.
In D, what is the recommend technique to derive one user-defined value type
from another?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Sun, 08 Feb 2009 14:37:18 -0800, Walter Bright wrote:
> Derek Parnell wrote:
>> On Sun, 08 Feb 2009 11:13:00 -0800, Walter Bright wrote:
>>
>>> In particular, classes are *meant* to be used as reference types, but
>>> the program is trying to treat them
On Tue, 10 Feb 2009 13:08:03 +0100, Don wrote:
> A&&B is not so terrible, since you can do it by nesting, as above.
> The big problem is A || B. It creates a mess.
version(A) version = AorB;
version(B) version = AorB;
version(AorB) {
. . .
}
--
Derek Parnell
Melbourne, A
a satisfactory
solution. Duplicating (nearly all of a) source file is NOT, repeat NOT, a
satisfatory solution.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Tue, 10 Feb 2009 14:01:29 -0800, Walter Bright wrote:
> Derek Parnell wrote:
>> ... it creates a new problem; code
>> duplication.
>
> I don't think that duplicating a small run of code is a problem.
My apology. The problem is more than run-time performance
t quite all, the logic is identical
between both operating systems. This is the sort of scenario that will
cause bugs to be introduced.
The fine line that divides when to duplicate and when not to duplicate, is
hard to see clearly. I tend to favour the less duplication approach, but
only when it leads to lower maintenance costs.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
or [a, b)?
I prefer [a,b] as the default, and I'm thinking integers too.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Sat, 14 Feb 2009 19:07:52 +0200, Yigal Chripun wrote:
> I see.
> Having 3 functions: malloc(), expand() and free() is indeed a very good
> design.
Unless you need to contract the allocated memory ;-) I believe that
realloc() does expansions and contractions, no?
--
Derek Parnell
On Sun, 15 Feb 2009 03:01:24 + (UTC), John Reimer wrote:
> So you approve of the material on the website then?
Hell no! I suspect that the Elvis image has definitely been digitally
re-touched.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
the role perfectly with the malice that expresses them (not to say person
> should swear when he is angry :) ). It's no wonder that the expression of
> them becomes confusing when they merge back into everyday speech for no
> apparent
> reason.
Yep, I think your right here.
A
though, he actually has some
good things to say, its just a pity they take too much effort to translate
into English.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
wanted to ask whether y'all could stomach yet
> another rewritten API or you'd rather use std.regexp as it is for the
> time being.
If your changes are going to make things better for coding and maintenance
then go for it.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Thu, 19 Feb 2009 07:01:56 -0800, Andrei Alexandrescu wrote:
> These all put the regex before the string, something many people would
> find unsavory.
I don't. To me the regex is what you are looking for so it's like saying
"find this pattern in that string".
--
Derek Parnell
ike X" means that I'm undecided about whether or not I
like X but I probably do not like it.
"I don't think I like X" means that I *know* that I don't like X, there is
no uncertainty.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Thu, 19 Feb 2009 07:46:47 -0800, Andrei Alexandrescu wrote:
> Derek Parnell wrote:
>> On Thu, 19 Feb 2009 07:01:56 -0800, Andrei Alexandrescu wrote:
>>
>>> These all put the regex before the string, something many people would
>>> find unsavory.
>>
xpression
is attempting to say something about one's level of certainty about liking
something. That is to say, one might not be positive if they *know* if they
like something or not, therefore they *think* (suspect, but not have
definitive evidence) of their stance.
> Anyway: g is from Perl. Let's keep it that way.
Perfect justification ;-)
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Thu, 19 Feb 2009 17:59:13 -0500, Jarrett Billingsley wrote:
> On Thu, Feb 19, 2009 at 4:06 PM, Derek Parnell wrote:
>> On Thu, 19 Feb 2009 10:45:44 -0500, Jarrett Billingsley wrote:
>>
>>> Also, "I think I don't like X" is not proper English. Say "
in other languages already
exist, they will be promptly removed. Also, C is still the lingua-franca of
the programming community, so examples in *any* other language are usually
subject to 'special' editoral scrutiny.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
writefln(__FUNCTION__);
}
class One
{
void foo()
{
writefln(__FUNCTION__);
}
}
struct Two
{
void foo()
{
writefln(__FUNCTION__);
}
}
--
Any problems so far?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Sat, 28 Feb 2009 17:27:27 -0500, Jarrett Billingsley wrote:
> On Sat, Feb 28, 2009 at 5:24 PM, Derek Parnell wrote:
>> void foo()
>> {
>> writefln(__FUNCTION__);
>> }
>>
>> void foo(int x)
>> {
>> writefln(__FUNCTION__);
>> }
g into an ASCII version of
APL.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
stems already do.
I see locale support in D as being a platform-independant method of
invoking existing operating system functionality.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
lementer to develop messages whose word order is correct for
their target language.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Mon, 02 Mar 2009 18:36:09 -0800, Andrei Alexandrescu wrote:
> Phobos has supported Posix positional syntax since 2.006.
>
> http://digitalmars.com/d/2.0/phobos/std_stdio.html
Thank you. I was behind the times (again).
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Tue, 03 Mar 2009 11:00:36 -0800, Walter Bright wrote:
> Contracts are not for input validation!
Hear! Hear! This is exactly correct.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
validation. Output validation is an attempt to prove that the function's
logic is correct.
Input validation is not a debugging tool. It is a chance to inform the
program's user that they might have given the program some wrong
information to work with.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
in-place.
I'm not advocating or rejecting this ... just trying to recall the original
poster's suggestion.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
biggest plot
> cliches: People being put into danger by their own creations (2001, Matrix,
> Terminator, Battlestar Gallactica...and probably a whole ton of others I
> can't think of right now.)
Predated by "Prometheus" from Greek mythology and by Mary Shelly's
"F
onst(char)[]" type because that means that the coder and compiler says
that this function won't change the input but we don't particularly care if
the input is immutable, or mutable by something else.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
the compiler's place to tell me that my code is unmaintainable.
The compiler is your friend, and friends sometimes have to be brutally
honest.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
l mnemonics for these is a good idea.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
table. It
is a pity that D's term "string" is being used in discussions as if it is
synonymous with character array - but it is not. It only refers to certain
types of character arrays - the invariant ones. We really need some simple
terms for const and mutable character arrays.
--
ons and not so
much as aliases in our code.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
modify any of them. If the caller passes invariant data then your function
cannot modify the arguments. If the caller passes mutable data, the
compiler won't allow your function to modify the parameters either, due to
the const signature. So why is it important that the function should know
the mutability of the passed data?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
// defensive copy in case foo keeps a reference to s
In foo's defence, if it takes a private reference, then it should also take
a copy. In fact, should it be allowed to take a private reference of data
which might be modified after it returns?
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
];
writef ("a=%s b=%s\n", a [0], b[0]);
a [0] += b [0];
writef ("a=%s b=%s\n", a [0], b[0]);
}
The problem is that we have declared 'b' as invariant, but the program is
allowed to change it. That is the issue.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Sun, 08 Mar 2009 00:36:06 -0800, Walter Bright wrote:
> Derek Parnell wrote:
>> import std.stdio;
>> void main()
>> {
>> int [] a = new int [1];
>>
>>a [0] = 1;
>>
>>invariant (int) [] b = cast (invariant (int) []) a;
>>
&g
On Sun, 08 Mar 2009 01:19:15 -0800, Walter Bright wrote:
> Derek Parnell wrote:
>> Walter, you have side-stepped the problem in question by talking about a
>> totally different problem.
>
> It's the same issue. When you use a cast, you are subverting the type
> syst
to be immutable. You should only
declare immutable those things that you know actually are already immutable
- like literals or stuff which is only ever assigned to once.
On the other hand, I think this should be a bug.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
ply ...
void str()
{
char[] s;
}
But you knew (no pun intended) that already.
What you were actually asking for is more like ...
struct dynary
{
size_t len;
void *data;
}
void str()
{
auto s = cast(char[]*)(new dynary);
}
void main()
{
str();
}
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
in some months.
Got it in one.
I'm waiting for D2 before enhancing Bud any more.
... then there's my unreleased text processor (macros) that also waits for
D2.
... and the version of the Euphoria language in D.
D1 is a non-starter for me now.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
life kicks in.
I'm 54 years old, BTW
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Mon, 23 Mar 2009 03:30:22 +0300, Denis Koroskin wrote:
> I wouldn't recommend using that to anyone. That's a *dirty* hack!
That goes without saying ;-) TO BE AVOIDED AT ALL COSTS.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
On Thu, 26 Mar 2009 21:21:47 +0100, Don wrote:
> I use bud. Even though it hasn't been touched since rebuild began. :-(.
How would like Bud to be 'touched'. I'm happy to make it better but I'm not
sure what you need from it.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
to same value
a = 42;
b = 42;
c = 42;
or even ...
// Set all to c's value
c = 42;
b = c;
a = c;
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
al vessels from our near future find themselves back in
the Pacific war of 1942.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
Yes!
I've never been happen with the awkwardness of the current syntax. It looks
just plain wrong and certainly not intuitive or helpful when reading code.
And as you suggest 'in' and 'out' are already special words (and Walter has
a special love for overloading keywords)
On Wed, 08 Apr 2009 19:24:10 -0400, superdan wrote:
> ill get hands dirty n maybe report more.
If you do, can you report back using English. I'm not very good at
translating your, presumably excellent, insights otherwise.
--
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell
1 - 100 of 181 matches
Mail list logo