On 07/11/2010 21:29, Tomek Sowiński wrote:
This wraps up a thread from a few days ago. Pascal featured my D
examples on his Scriptometer site.
http://rigaux.org/language-study/scripting-language/
D comes 17th out of 28, so it's so-so for scripting.
Hum, nice, I think this is a very
On 11/11/2010 13:50, Alexander Malakhov wrote:
Perhaps a module std.scripting could help quite a lot, too.
module std.script;
public import std.stdio, std.file, std.process, std.algorithm, ... etc
I use at least some of these for most of my programs/scripts. And
std.all is probably a
spir Wrote:
On Tue, 16 Nov 2010 09:44:06 +0100
Per Ã
ngström d-n...@autark.se wrote:
On 2010-11-16 01:10, Daniel Murphy wrote:
I think allowing the second expression in the ternary operator to be
omitted
would be a better fit for D, and provide the same function.
ie.
By the way, I found a bug that I think is quite serious if DMD wants to
hit the scripting languages world:
http://d.puremagic.com/issues/show_bug.cgi?id=5243
Copied for convenience:
dmd -run potentially removes user files
See this example:
$ mkdir x
$ echo 'void main() {}' x/test.d
$ echo my
On 2010-11-16 01:10, Daniel Murphy wrote:
I think allowing the second expression in the ternary operator to be omitted
would be a better fit for D, and provide the same function.
ie.
auto x = a ? a : b;
auto x = a ? : b;
Personally I had '|||' in mind, but I'm OK with '?:'. I think it should
On Tue, 16 Nov 2010 09:44:06 +0100
Per Ångström d-n...@autark.se wrote:
On 2010-11-16 01:10, Daniel Murphy wrote:
I think allowing the second expression in the ternary operator to be omitted
would be a better fit for D, and provide the same function.
ie.
auto x = a ? a : b;
auto x =
Daniel Murphy, el 16 de noviembre a las 10:10 me escribiste:
Per �ngstr�m d-n...@autark.se wrote in message
news:ibr8bs$22m...@digitalmars.com...
return s || default;
I think allowing the second expression in the ternary operator to be omitted
would be a better fit for D, and provide
Script mode (actually - simple wrapper) would be better:
It could do simple parsing of script, bringing all import clauses to
the beginning and add some default imports (like std.stdio). It seems
that all code below imports can be wrapped into main declaration. So
for
writeln(hello, world!);
we
Script mode (actually - simple wrapper) would be better:
It could do simple parsing of script, bringing all import
clauses to the beginning and add some default imports
(like std.stdio). It seems that all code below imports can be
wrapped into main declaration.
My rund.d program does this.
I really think that it would be good to ship something like this with
dmd and promote it default D script handler.
May be, parsing must be more complicated (I'm not sure that all
features will work inside main()), but as D is easy for
parsing I see no big problems.Of cource, we can add more
On 2010-11-07 22:29, Tomek Sowiński wrote:
This wraps up a thread from a few days ago. Pascal featured my D
examples on his Scriptometer site.
http://rigaux.org/language-study/scripting-language/
D comes 17th out of 28, so it's so-so for scripting.
I'm wondering whether the issue of D's
On Mon, 15 Nov 2010 13:15:50 +0100
Per Ångström d-n...@autark.se wrote:
On 2010-11-07 22:29, Tomek Sowiński wrote:
This wraps up a thread from a few days ago. Pascal featured my D
examples on his Scriptometer site.
http://rigaux.org/language-study/scripting-language/
D comes 17th out
spir:
I *want* my language of choice to let me write clear code --
During the design stages of Python3 I've even asked to remove those dirty
boolean shortcuts of Python2 :-)
Bye,
bearophile
On 2010-11-15 14:27, spir wrote:
On Mon, 15 Nov 2010 13:15:50 +0100
Per Ångströmd-n...@autark.se wrote:
string func(string s)
{
/++
// A handy feature of many scripting languages, but not in D
// (in D, the type of the or-expression is bool):
// The type of the
Per Ångström d-n...@autark.se wrote:
/++
Simulates type-returning or-expression
+/
template or(T) {
T _(T a, lazy T b) {T tmp = a; return tmp ? tmp : b;}
}
You should probably use a function template[1] or at least an eponymous
template here:
// function template:
auto or( T )( T a,
On 2010-11-15 18:40, Simen kjaeraas wrote:
Per Ångström d-n...@autark.se wrote:
/++
Simulates type-returning or-expression
+/
template or(T) {
T _(T a, lazy T b) {T tmp = a; return tmp ? tmp : b;}
}
You should probably use a function template[1] or at least an eponymous
template here:
//
Per Ångström d-n...@autark.se wrote in message
news:ibr8bs$22m...@digitalmars.com...
return s || default;
I think allowing the second expression in the ternary operator to be omitted
would be a better fit for D, and provide the same function.
ie.
auto x = a ? a : b;
auto x = a ? : b;
I
Leandro Lucarella l...@llucax.com.ar писал(а) в своём письме Sat, 13 Nov
2010 21:13:42 +0600:
retard, el 13 de noviembre a las 08:24 me escribiste:
void main(string[] args){
import std.stdio; // 1. will not compile void main(string[]
args){
writeln(hello);
}
...
On 2010-11-14 13:40, Alexander Malakhov wrote:
Even if there are technical issues, special case for unit tests sounds
like a good improvement of usability
Another thing that comes to mind about things not allowed in unittest
scope that could facilitate unit testing: defining templates.
--
spir denis.s...@gmail.com писал(а) в своём письме Sat, 13 Nov 2010
16:15:39 +0600:
On Fri, 12 Nov 2010 14:42:38 -0500
sybrandy sybra...@gmail.com wrote:
2. Make Windows to open .d files with rdmd by default, so I could run
them with simple double-click
Yes. Maybe Alexander meant this
Fri, 12 Nov 2010 23:01:24 +0600, Alexander Malakhov wrote:
Gary Whatmore n...@spam.sp писал(а) в своём письме Thu, 11 Nov 2010
20:07:35 +0600:
Alexander Malakhov Wrote:
...
Maybe it would be better to just make rdmd to surround source code
with:
//- rdmd generated text BEGIN
public
On Fri, 12 Nov 2010 23:21:55 +0600
Alexander Malakhov a...@programmer.net wrote:
btw, does --eval make import std.all or some set of modules ?
Btw, I just had an idea about std imports -- not only for scripting, but for
general use of D as well: What if D automagically imported a std set of
On Fri, 12 Nov 2010 14:42:38 -0500
sybrandy sybra...@gmail.com wrote:
2. Make Windows to open .d files with rdmd by default, so I could run them
with simple double-click
You should be able to do this yourself quite easily by right-clicking on
the D file and associating it with rdmd.
On 11/13/2010 05:15 AM, spir wrote:
On Fri, 12 Nov 2010 14:42:38 -0500
sybrandysybra...@gmail.com wrote:
2. Make Windows to open .d files with rdmd by default, so I could run them
with simple double-click
You should be able to do this yourself quite easily by right-clicking on
the D file
spir denis.s...@gmail.com wrote in message
news:mailman.322.1289642939.21107.digitalmar...@puremagic.com...
On Fri, 12 Nov 2010 23:21:55 +0600
Alexander Malakhov a...@programmer.net wrote:
btw, does --eval make import std.all or some set of modules ?
Btw, I just had an idea about std imports
Gary Whatmore n...@spam.sp писал(а) в своём письме Thu, 11 Nov 2010
20:07:35 +0600:
Alexander Malakhov Wrote:
...
Maybe it would be better to just make rdmd to surround source code with:
//- rdmd generated text BEGIN
public import std.stdio, ...
void main( string[] args ){
//- rdmd
Alexander Malakhov wrote:
import std.stdio; // 1. will not compile
I wrote a little rund helper program, and a PHP style D interpreter
in another thread a couple days ago, that solves this by a simple
string scan.
http://arsdnet.net/dcode/rund.d
http://arsdnet.net/dcode/dhp.d
It scans the
Andrei Alexandrescu seewebsiteforem...@erdani.org писал(а) в своём
письме Thu, 11 Nov 2010 21:12:33 +0600:
On 11/11/10 5:50 AM, Alexander Malakhov wrote:
Maybe it would be better to just make rdmd to surround source code with:
//- rdmd generated text BEGIN
public import std.stdio, ...
On 11/12/10 9:21 AM, Alexander Malakhov wrote:
Andrei Alexandrescu seewebsiteforem...@erdani.org писал(а) в своём
письме Thu, 11 Nov 2010 21:12:33 +0600:
On 11/11/10 5:50 AM, Alexander Malakhov wrote:
Maybe it would be better to just make rdmd to surround source code with:
//- rdmd
Adam D. Ruppe destructiona...@gmail.com писал(а) в своём письме Fri, 12
Nov 2010 23:13:13 +0600:
Alexander Malakhov wrote:
import std.stdio; // 1. will not compile
I wrote a little rund helper program, and a PHP style D interpreter
in another thread a couple days ago, that solves this by
Andrei Alexandrescu seewebsiteforem...@erdani.org писал(а) в своём
письме Fri, 12 Nov 2010 23:44:18 +0600:
On 11/12/10 9:21 AM, Alexander Malakhov wrote:
I was unable to pass file to --eval, is this possible ?
It is:
rdmd --eval $(cat filename)
I know... it's cheating :o). But if you
2. Make Windows to open .d files with rdmd by default, so I could run them
with simple double-click
You should be able to do this yourself quite easily by right-clicking on
the D file and associating it with rdmd. I'd give better instructions
except I'm not on a Windows machine right now.
On 12/11/2010 19:42, sybrandy wrote:
2. Make Windows to open .d files with rdmd by default, so I could run
them
with simple double-click
You should be able to do this yourself quite easily by right-clicking on
the D file and associating it with rdmd. I'd give better instructions
except I'm
On 11/12/10 11:42 AM, sybrandy wrote:
2. Make Windows to open .d files with rdmd by default, so I could run
them
with simple double-click
You should be able to do this yourself quite easily by right-clicking on
the D file and associating it with rdmd. I'd give better instructions
except I'm
2010/11/12 div0 d...@sourceforge.net
On 12/11/2010 19:42, sybrandy wrote:
2. Make Windows to open .d files with rdmd by default, so I could run
them
with simple double-click
You should be able to do this yourself quite easily by right-clicking on
the D file and associating it with rdmd.
On 11/12/2010 03:06 PM, div0 wrote:
On 12/11/2010 19:42, sybrandy wrote:
2. Make Windows to open .d files with rdmd by default, so I could run
them
with simple double-click
You should be able to do this yourself quite easily by right-clicking on
the D file and associating it with rdmd. I'd
That sounds good until you think of comparable situations. Python does this,
Perl does this, heck, if allowing powerful things to start with an
inadvertent click, why do we have batch files? Why do we have executables?
Being able to run things by clicking on them is a feature, not a security
[started separate thread]
On Thu, 11 Nov 2010 00:58:31 +0100
Tomek Sowiński j...@ask.me wrote:
Andrei Alexandrescu napisał:
Speaking of getopt, when writing the 'grep' snippet I missed anonymous
options a lot:
bool h, i; string expr; string[] files;
getopt(args, h,h,
spir Wrote:
[started separate thread]
On Thu, 11 Nov 2010 00:58:31 +0100
Tomek SowiÅski j...@ask.me wrote:
Andrei Alexandrescu napisaÅ:
Speaking of getopt, when writing the 'grep' snippet I missed anonymous
options a lot:
bool h, i; string expr; string[] files;
On Wed, 10 Nov 2010 19:12:26 -0500, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 11/10/10 3:58 PM, Tomek Sowiński wrote:
Andrei Alexandrescu napisał:
Speaking of getopt, when writing the 'grep' snippet I missed anonymous
options a lot:
bool h, i; string expr; string[]
ruben niemann Wrote:
spir Wrote:
[started separate thread]
On Thu, 11 Nov 2010 00:58:31 +0100
Tomek SowiÅski j...@ask.me wrote:
Andrei Alexandrescu napisaÅ:
Speaking of getopt, when writing the 'grep' snippet I missed anonymous
options a lot:
bool h, i;
spir wrote:
I thought once at a default interface between the command-line and a
program's startup routine, main().
We could actually do this with a mixin.
==
int findword (string filename, string word, bool verbose=false) {...}
mixin MakeMain!(findword);
==
And that MakeMain
Perhaps a module std.scripting could help quite a lot, too.
module std.script;
public import std.stdio, std.file, std.process, std.algorithm, ... etc
I use at least some of these for most of my programs/scripts. And
std.all is probably a bit too heavy.
std.script could basically
Alexander Malakhov Wrote:
Perhaps a module std.scripting could help quite a lot, too.
module std.script;
public import std.stdio, std.file, std.process, std.algorithm, ... etc
I use at least some of these for most of my programs/scripts. And
std.all is probably a bit too
On Thu, 11 Nov 2010 13:45:33 +, Adam Ruppe wrote:
I actually wrote something that does this already, though my goal was to
automate the creation of web apps, it also (used to - I broke it in my
last revision) works for command line programs.
http://arsdnet.net/dcode/web.d
[...]
I
On 11/11/10 5:50 AM, Alexander Malakhov wrote:
Perhaps a module std.scripting could help quite a lot, too.
module std.script;
public import std.stdio, std.file, std.process, std.algorithm, ... etc
I use at least some of these for most of my programs/scripts. And
std.all is probably a
Perhaps a module std.scripting could help quite a lot, too.
Andrei
Also, something I just thought of this morning is to create something
similar to std.variant for variables where every variable is the same
type. Perl, for example, may store the same value multiple times in the
same
Steven Schveighoffer napisał:
I still don't see added value over the existing situation. Currently
getopt leaves whatever wasn't an option in args[1 .. $] (without
shuffling order), so the code above would simply use args[1] for expr
and args[2 .. $] for files.
1. uses same type
sybrandy napisał:
Foo x = 27;
x += 15; // X is now 42
Foo y = X is ~ x; // Here, x is now treated like a string.
std.variant?
--
Tomek
spir napisał:
// Let's match assignments.
auto args = [program.exe, .*=.*;, file1.d, file2.d, file3.d];
bool h, i; string expr; string[] files;
getopt(args, h,h, i,i, expr, files);
assert(!h);
assert(!i);
assert(expr == .*=.*;);
assert(files == [file1.d, file2.d, file3.d]);
assert(args
Andrei Alexandrescu napisał:
I'm having trouble thinking of something that would go in this module
that wouldn't be a better fit somewhere else. What do you envision?
I thought of it for a bit, but couldn't come up with anything :o). I
think you're right!
Yeah, I think std.all would be
Tomek Sowiński wrote:
Andrei Alexandrescu napisał:
foreach (line; File.byLine(args[1 .. $]) {
...
}
}
I hypothetically made byLine a static method inside File to avoid
confusing beginners (one might think on first read that byLine goes line
by line through an array of strings).
The
On 11/10/10 1:45 PM, Tomek Sowiński wrote:
Andrei Alexandrescu napisał:
I'm having trouble thinking of something that would go in this module
that wouldn't be a better fit somewhere else. What do you envision?
I thought of it for a bit, but couldn't come up with anything :o). I
think you're
Andrei Alexandrescu napisał:
Speaking of getopt, when writing the 'grep' snippet I missed anonymous
options a lot:
bool h, i; string expr; string[] files;
getopt(args, h,h, i,i,expr,files);
They can be implemented with relatively little effort.
Not getting the example. How would
On 11/10/10 3:58 PM, Tomek Sowiński wrote:
Andrei Alexandrescu napisał:
Speaking of getopt, when writing the 'grep' snippet I missed anonymous
options a lot:
bool h, i; string expr; string[] files;
getopt(args, h,h, i,i,expr,files);
They can be implemented with relatively little effort.
On 11/7/10 9:12 PM, Eric Poggel wrote:
On 11/7/2010 8:49 PM, Andrei Alexandrescu wrote:
On 11/7/10 5:34 PM, Jesse Phillips wrote:
Tomek Sowiñski Wrote:
This wraps up a thread from a few days ago. Pascal featured my D
examples
on his Scriptometer site.
Andrei:
Someone proposed to add something like
http://docs.python.org/library/fileinput.html to Phobos. I think it's a
good idea.
Good. That someone was me (But I don't use Python fileinput often, so I have
never written an enhancement request on this).
Bye,
bearophile
On 11/09/2010 06:12 PM, Andrei Alexandrescu wrote:
On 11/7/10 9:12 PM, Eric Poggel wrote:
On 11/7/2010 8:49 PM, Andrei Alexandrescu wrote:
On 11/7/10 5:34 PM, Jesse Phillips wrote:
Tomek Sowiñski Wrote:
This wraps up a thread from a few days ago. Pascal featured my D
examples
on his
On 8/11/10 1:49 AM, Andrei Alexandrescu wrote:
On 11/7/10 5:34 PM, Jesse Phillips wrote:
Tomek Sowiñski Wrote:
This wraps up a thread from a few days ago. Pascal featured my D
examples
on his Scriptometer site.
http://rigaux.org/language-study/scripting-language/
D comes 17th out of 28, so
Pelle Månsson Wrote:
On 11/09/2010 06:12 PM, Andrei Alexandrescu wrote:
On 11/7/10 9:12 PM, Eric Poggel wrote:
On 11/7/2010 8:49 PM, Andrei Alexandrescu wrote:
On 11/7/10 5:34 PM, Jesse Phillips wrote:
Tomek Sowiñski Wrote:
This wraps up a thread from a few days ago. Pascal featured
Jesse Phillips Wrote:
Tomek Sowiñski Wrote:
This wraps up a thread from a few days ago. Pascal featured my D examples
on his Scriptometer site.
http://rigaux.org/language-study/scripting-language/
D comes 17th out of 28, so it's so-so for scripting.
--
Tomek
When I
On Wed, Nov 10, 2010 at 2:04 AM, Gary Whatmore n...@spam.sp wrote:
I think optimizing this particular test is important for the publicity of D.
Once the scripting community acknowledges D, we could redesign it. We should
make all current test cases one liners, if possible. I'm dreaming of a
Tomek Sowiñski Wrote:
This wraps up a thread from a few days ago. Pascal featured my D examples
on his Scriptometer site.
http://rigaux.org/language-study/scripting-language/
D comes 17th out of 28, so it's so-so for scripting.
--
Tomek
When I looked over his scoring from the
On 11/7/10 5:34 PM, Jesse Phillips wrote:
Tomek Sowiñski Wrote:
This wraps up a thread from a few days ago. Pascal featured my D examples
on his Scriptometer site.
http://rigaux.org/language-study/scripting-language/
D comes 17th out of 28, so it's so-so for scripting.
--
Tomek
When I
On 11/7/2010 8:49 PM, Andrei Alexandrescu wrote:
On 11/7/10 5:34 PM, Jesse Phillips wrote:
Tomek Sowiñski Wrote:
This wraps up a thread from a few days ago. Pascal featured my D
examples
on his Scriptometer site.
http://rigaux.org/language-study/scripting-language/
D comes 17th out of 28,
Hello Tomek,
This wraps up a thread from a few days ago. Pascal featured my D
examples on his Scriptometer site.
http://rigaux.org/language-study/scripting-language/
D comes 17th out of 28, so it's so-so for scripting.
The link from D seems dead to me (missing ':' after http).
66 matches
Mail list logo