D versus C#/.NET module systems

2012-05-17 Thread Eduardo Cavazos
This question on "programmers.stackexchange.com" questions the complexity of the C#/.NET namespace/module/dll system in relation to more elegant approaches taken by other languages. http://programmers.stackexchange.com/questions/149056/why-do-net-modules-separate-module-file-names-from-namespaces

Element-wise addition of arrays

2010-08-19 Thread Eduardo Cavazos
Hello, Here's a short program which compares via 'benchmark' two ways to perform element-wise addition of two arrays. -- import std.stdio ; import std.date ; import std.random ; void main () { double [2] a ; double [2] b

Scope/block behaviour

2010-08-19 Thread Eduardo Cavazos
Hello, I was surprised that these seem to not be allowed in D: void main () { auto a = 20 ; { auto a = 30 ; } } void main () { { int f0 () { return 10 ; } } { int f0 () { return 20 ; } } } Perhaps I missed something in the FAQ. Is there anywhere (manual or TDPL) I can read up

TDPL ebook

2010-08-19 Thread Eduardo Cavazos
Hello, Is there a legal/official way to purchase a full PDF of TDPL? The Safari site says you get 45 days of access to the book online if you purchase the book. It also says that you can download individual chapters but you have to collect enough "tokens"... Ed

re: welcome!

2010-08-19 Thread Eduardo Cavazos
Thanks Graham! D is a lot of fun. Using it (language and compiler) is like a breath of fresh air. It raises the bar in so many ways. Ed -- Programming languages are like revolutions And revolutions are like bicycles When they stop moving forward, they fall over

re: Scope/block behaviour

2010-08-20 Thread Eduardo Cavazos
> void main () > { > { int f0 () { return 10 ; } } > > { int f0 () { return 20 ; } } > } Stewart Gordon wrote: > Looks like a bug. The compiler recognizes the situation and reports it as an error, so it seems like this is not a bug, but something which is not supported: ~/scratch $

re: Scope/block behaviour

2010-08-21 Thread Eduardo Cavazos
Andrei Alexandrescu wrote: > Mind submitting a bug report please? Done: http://d.puremagic.com/issues/show_bug.cgi?id=4699 Ed

The type of an element-wise arithmetic expression

2010-08-21 Thread Eduardo Cavazos
Hello, This program: -- import std.stdio ; void f0 ( double [2] a ) { writeln ( a ) ; } void main () { double [2] a = [ 1.0 , 2.0 ] ; double [2] b = [ 3.0 , 4.0 ] ; f0 ( a[] - b[] ) ; } -

map on fixed-size arrays

2010-08-21 Thread Eduardo Cavazos
Hello, The 'map' from std.algorithm doesn't seem to work with fixed-size arrays: -- import std.stdio ; import std.math ; import std.algorithm ; T sq ( T ) ( T x ) { return x*x ; } void main () { double [2] a = [ 1.0 , 2.0 ]

Overloading + on points

2010-08-31 Thread Eduardo Cavazos
(Discussion originally on digitalmars-d-learn. Moving to digitalmars-d list.) Eduardo Cavazos wrote: > Here's a short program which creates a type for points and overloads '+' > to do element wise addition as well as addition to floats, however i

Overloading + on points

2010-09-02 Thread Eduardo Cavazos
Eduardo Cavazos wrote: Here's a short program which creates a type for points and overloads '+' to do element wise addition as well as addition to floats, however it produces an error: -- import std.std