On Wednesday, 29 April 2015 at 06:37:44 UTC, ketmar wrote:
subj. the code:
void main () {
import std.stdio;
char ch = '!';
switch (ch) {
int n = 42;
case '!': writeln(n, ": wow!"); break;
default:
}
}
i think that such abomination should:
1. be forbidden,
On Wednesday, 29 April 2015 at 06:37:44 UTC, ketmar wrote:
subj. the code:
void main () {
import std.stdio;
char ch = '!';
switch (ch) {
int n = 42;
case '!': writeln(n, ": wow!"); break;
default:
}
}
i think that such abomination should:
1. be forbidden,
On Wednesday, 29 April 2015 at 02:20:25 UTC, Vladimir Panteleev
wrote:
On Wednesday, 29 April 2015 at 01:38:17 UTC, Dennis Ritchie
wrote:
Hi,
Is it possible to write self-modifying code in D, who will
perform at runtime?
Not easily. Just the obvious approach to invoke the compiler
and run/lo
On 04/27/15 19:49, Jens Bauer via Digitalmars-d-learn wrote:
> I was wondering if there's a way to reduce my bulky startup files a bit.
>
> If using the GNU Assembler (GAS), then one can reduce the code using a macro
> like this:
>
>
> /* The EXC macro makes a weak+alias for the
> * symbol 'va
On Monday, 27 April 2015 at 21:19:02 UTC, extrawurst wrote:
here is the shortened version of the returned class CSteamID:
https://gist.github.com/Extrawurst/936f56ceaa87cf287257
this is the shortened interface (no destructors in the rest of
the code either):
https://gist.github.com/Extrawurst
On Tuesday, 28 April 2015 at 23:09:27 UTC, Per Nordlöw wrote:
On Tuesday, 28 April 2015 at 16:20:24 UTC, Per Nordlöw wrote:
I update my Github repo. I had forgotten to push my latest
changes.
I solved it.
On Wed, Apr 29, 2015 at 06:37:44AM +, ketmar via Digitalmars-d-learn wrote:
> subj. the code:
>
> void main () {
> import std.stdio;
> char ch = '!';
> switch (ch) {
> int n = 42;
> case '!': writeln(n, ": wow!"); break;
> default:
> }
> }
>
>
> i think
On Wednesday, 29 April 2015 at 13:58:14 UTC, Artur Skawina wrote:
On 04/27/15 19:49, Jens Bauer via Digitalmars-d-learn wrote:
I was wondering if there's a way to reduce my bulky startup
files a bit.
If using the GNU Assembler (GAS), then one can reduce the code
using a macro like this:
{s
On 04/29/2015 07:57 AM, H. S. Teoh via Digitalmars-d-learn wrote:
Switch statements in D allow all sorts of abominations, if only you
would try it. I think it was originally designed to support a particular
loop idiom (sorry I forgot what it was called
http://en.wikipedia.org/wiki/Duff%27s_d
Hi,
Is it possible to create simple D user-defined data types without
the use of classes and other OOP?
For example, in Ada is done as follows:
-
type balance is new Integer range -32_000 .. 32_000;
On 04/28/2015 07:20 PM, Vladimir Panteleev wrote:
On Wednesday, 29 April 2015 at 01:38:17 UTC, Dennis Ritchie wrote:
Hi,
Is it possible to write self-modifying code in D, who will perform at
runtime?
Not easily. Just the obvious approach to invoke the compiler and
run/load the created executab
On Wednesday, 29 April 2015 at 17:35:50 UTC, Ali Çehreli wrote:
SDC will make D such a language. :)
Ali
It remains to build SDC in the standard library of the future
DDMD :)
On Wednesday, 29 April 2015 at 17:17:07 UTC, Dennis Ritchie wrote:
Hi,
Is it possible to create simple D user-defined data types
without the use of classes and other OOP?
For example, in Ada is done as follows:
-
type balance is new Integer range -32_000 .. 32_000;
I think you can use
On 04/29/2015 10:17 AM, Dennis Ritchie wrote:
Hi,
Is it possible to create simple D user-defined data types without the
use of classes and other OOP?
For example, in Ada is done as follows:
-
type balance is new Integer range -32_000 .. 32_000;
Something similar to the following solution
Hi.
What's the best way to pass the contents of a file to the stream
parser without reading the whole thing into memory first? I get
an error if using byLine because the kind of range this function
returns is not what the stream parser is expecting.
There is an optional filename argument to
On Wednesday, 29 April 2015 at 13:55:46 UTC, Benjamin Thaut wrote:
On Monday, 27 April 2015 at 21:19:02 UTC, extrawurst wrote:
here is the shortened version of the returned class CSteamID:
https://gist.github.com/Extrawurst/936f56ceaa87cf287257
this is the shortened interface (no destructors i
When building the following (reduced by hand - I hope I didn't
take out something useful when doing so):
import std.stdio;
import std.getopt;
int main(string[] args)
{
string apiKey;
string startCode;
bool reverseOrder=false;
bool noReverse=false;
auto h
On Wednesday, 29 April 2015 at 17:52:27 UTC, Ali Çehreli wrote:
On 04/29/2015 10:17 AM, Dennis Ritchie wrote:
Hi,
Is it possible to create simple D user-defined data types
without the
use of classes and other OOP?
For example, in Ada is done as follows:
-
type balance is new Integer rang
On Tuesday, 28 April 2015 at 22:34:07 UTC, Justin Whear wrote:
if (startsWith!"icmp(a, b) == 0"(input, "0x"))
if (startsWith!"std.uni.icmp(a, b) == 0"(input, "0x"))
if (startsWith!((a,b) => icmp(a,b) == 0)(input, "0x"))
The issue is that those icmp functions take strings as
arguments
On Wednesday, 29 April 2015 at 19:43:44 UTC, Laeeth Isharc wrote:
I get the following errors under LDC (this is LDC beta, but
same problem under master) although the code compiles fine
under DMD.
Am I doing something wrong?
The help generating feature of std.getopt is new in 2.067. Use
bran
I'm trying to run this command:
wget -O - URL | gpg -d and get the result of the action, but I
can't quite work out to do it.
currently it looks like:
executeShell(escapeShellCommand("wget", "-O", "-", url, "|",
"gpg", "-D"));
But I can't work out how to pull the string returned with this.
On Wednesday, 29 April 2015 at 06:41:30 UTC, Jacob Carlborg wrote:
On 2015-04-28 19:46, Chris wrote:
I keep getting this message. Why?
Fetching: http://ftp.digitalmars.com/dmd.2.067.0.zip
[>] 56256/54884 KB
Installing: dmd-2.067.0
An unknown error occurr
On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby wrote:
After reading the following thread:
http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org
I wondered if it was possible to write a classic fizzbuzz[1]
example using a UFCS chain? I've tried and failed.
[1]: http:/
On 04/29/2015 12:53 PM, Dennis Ritchie wrote:
On Wednesday, 29 April 2015 at 17:52:27 UTC, Ali Çehreli wrote:
It should be easy to make a template of it. (I really think it should
already be in Phobos. :) )
Where can I find documentation on this subject?
Once a piece of code works for a par
On 04/29/2015 02:05 PM, William Dunne wrote:
I'm trying to run this command:
wget -O - URL | gpg -d and get the result of the action, but I can't
quite work out to do it.
currently it looks like:
executeShell(escapeShellCommand("wget", "-O", "-", url, "|", "gpg", "-D"));
But I can't work out
On 04/29/2015 02:54 PM, Ali Çehreli wrote:
executeShell returns the status and the output as a type
Certainly not. The output is an object of a special type, which the
documentation refers to as 'auto'. Grrr... :) Ok, maybe it's a Voldemort
type. Anyway...
Ali
On Wednesday, 29 April 2015 at 21:56:18 UTC, Ali Çehreli wrote:
Certainly not. The output is an object of a special type, which
the documentation refers to as 'auto'. Grrr... :) Ok, maybe
it's a Voldemort type. Anyway...
That's idiotic, to be frank, it should just be a traditional
struct decl
Hello.
Help me please to understand, how to show usage help to user, who
enter wrong options?
For example, user not provided required filename.
I want to show error message, and program usage help text.
But likely getopt don't provide help text until valid options
will be parsed.
Reduced cod
What you're trying to do is currently impossible. I filed a bug
(https://issues.dlang.org/show_bug.cgi?id=14525) because what
you're trying to do really should be possible.
import std.stdio : writefln;
import std.getopt;
void main(string[] args)
{
string fname;
try
{
getopt
On Wednesday, 29 April 2015 at 21:49:08 UTC, Ali Çehreli wrote:
On 04/29/2015 12:53 PM, Dennis Ritchie wrote:
On Wednesday, 29 April 2015 at 17:52:27 UTC, Ali Çehreli wrote:
It should be easy to make a template of it. (I really think
it should
already be in Phobos. :) )
Where can I find doc
if("0X".std.string.indexOf("0x", CaseSensitive.no) == 0)
should work
On 04/29/2015 03:48 PM, Dennis Ritchie wrote:
Thanks. And how can I stop all attempts to perform actions
arifmiticheskih the type int? Ie action to "t += b;" suppressed to compile.
Some operator overloading is needed. I am pretty sure someone must have
implemented such a type. What I add belo
On 04/29/2015 04:16 PM, Ali Çehreli wrote:
ref CustomInteger opOpAssign(string op, T2)(T2 rhs)
{
static if (is (T2 == CustomInteger)) {
mixin("value_ " ~ op ~ "= rhs.value_;");
return this;
} else {
return this.opOpAssign!(op,
C
On Wednesday, 29 April 2015 at 23:22:43 UTC, Ali Çehreli wrote:
On 04/29/2015 04:16 PM, Ali Çehreli wrote:
ref CustomInteger opOpAssign(string op, T2)(T2 rhs)
{
static if (is (T2 == CustomInteger)) {
mixin("value_ " ~ op ~ "= rhs.value_;");
return this;
On Wednesday, 29 April 2015 at 20:45:26 UTC, Anon wrote:
On Wednesday, 29 April 2015 at 19:43:44 UTC, Laeeth Isharc
wrote:
I get the following errors under LDC (this is LDC beta, but
same problem under master) although the code compiles fine
under DMD.
Am I doing something wrong?
The help g
On Wednesday, 29 April 2015 at 21:56:18 UTC, Ali Çehreli wrote:
On 04/29/2015 02:54 PM, Ali Çehreli wrote:
executeShell returns the status and the output as a type
Certainly not. The output is an object of a special type, which
the documentation refers to as 'auto'. Grrr... :) Ok, maybe
it'
dub build is running on centos7. It works well until today, It
becomes very slow suddenly. It will take minuties per
compilation, there is 10 files in project.
Has anyone experienced this?
On Thursday, 30 April 2015 at 02:02:50 UTC, zhmt wrote:
dub build is running on centos7. It works well until today, It
becomes very slow suddenly. It will take minuties per
compilation, there is 10 files in project.
Has anyone experienced this?
It is because:
The dub will connect to some web
On 4/29/15 5:25 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= "
wrote:
On Wednesday, 29 April 2015 at 06:37:44 UTC, ketmar wrote:
subj. the code:
void main () {
import std.stdio;
char ch = '!';
switch (ch) {
int n = 42;
case '!': writeln(n, ": wow!"); break;
default:
}
On Wednesday, 29 April 2015 at 14:46:04 UTC, Per Nordlöw wrote:
On Tuesday, 28 April 2015 at 23:09:27 UTC, Per Nordlöw wrote:
On Tuesday, 28 April 2015 at 16:20:24 UTC, Per Nordlöw wrote:
I update my Github repo. I had forgotten to push my latest
changes.
I solved it.
I started working on
On 04/29/2015 04:30 PM, Dennis Ritchie wrote:
> On Wednesday, 29 April 2015 at 23:22:43 UTC, Ali Çehreli wrote:
>> On 04/29/2015 04:16 PM, Ali Çehreli wrote:
>>
>>> ref CustomInteger opOpAssign(string op, T2)(T2 rhs)
>>> {
>>> static if (is (T2 == CustomInteger)) {
>>>
Thank you, Brian!
42 matches
Mail list logo