Thread overview
Re: More D newb questions.
May 07, 2008
terranium
May 07, 2008
BCS
May 07, 2008
Me Here
May 08, 2008
BCS
May 08, 2008
Me Here
May 07, 2008
Me Here Wrote:

>     junk.d(8): Error: Can only concatenate arrays, not (int ~ int)
> 
> which is silly. There's no technical reason for not allowing this.

This is not silly. This is what called a strongly typed language. D is good for people having experience with C, C++ or C# so they are fully acquainted with strong typing. BTW D and C# aren't pure because they have sytax sugar, so they're not the best choise to learn what a strong typing is.
May 07, 2008
terranium wrote:
> Me Here Wrote:
> 
> 
>>    junk.d(8): Error: Can only concatenate arrays, not (int ~ int)
>>
>>which is silly. There's no technical reason for not allowing this. 
> 
> 
> This is not silly. This is what called a strongly typed language.

That's kind of orthogonal. A strongly type language could very well allow the concatenation of 2 chars into a char[]. However I would expect to see it more often in weakly typed languages.
May 07, 2008
terranium wrote:

> Me Here Wrote:
> 
> >     junk.d(8): Error: Can only concatenate arrays, not (int ~ int)
> > 
> > which is silly. There's no technical reason for not allowing this.
> 
> This is not silly. This is what called a strongly typed language. D is good for people having experience with C, C++ or C# so they are fully acquainted with strong typing. BTW D and C# aren't pure because they have sytax sugar, so they're not the best choise to learn what a strong typing is.

You do yourself a disservice by making assumptions on the basis of little evidence. Don't make assumptions because I choose to use Perl's slices as examples.

My more years than I care to remember history starts with assembler(various), Fortran IV, Fortran 77, BLISS; moves through REXX, APL, PL/1, PLS/86 C, C++, side trips into COBOL, Java and ADA, not necessarially in that order . On to Perl & Ruby. Daliances with Python and Rebol. And in the last 3 years, serious and studious evaluations of Haskell, OCaml, ML, Erlang, Mozart/Oz, Clean and Q. Oh. And there's a little (serious) Pascal and Prologue in there somewhere too.

As someone else pointed out, strong typing is no barrier to allowing the construction of arrays through the concatenation of elements of its base type. Lookup Curry-Howard isomorphisms.

b.
-- 

May 08, 2008
Reply to Me,

> You do yourself a disservice by making assumptions on the basis of
> little evidence. Don't make assumptions because I choose to use Perl's
> slices as examples.

Please don't take offence. We routinely get everything from absolute beginners that haven't a clue how things work to officialy crowned gurus. Without asking for a resume, you end up having to assuming /something/, generally on little or no evidence. People get it wrong now and again but generally stuff sort's it's self out fairly quickly.


May 08, 2008
BCS wrote:
> 
> Please don't take offence.

None taken.

Just trying to throw back the red-herring of "scripters can't possibly understand type systems" before it gets mindspace. Though catching up on the "why; ?" thread(*), I see now that horse has a;ready bolted :)

Cheers, b.

(*) How does one link to previous discussion here?

-- 

May 08, 2008
"Me Here" wrote
> (*) How does one link to previous discussion here?

Find it on the web news reader (http://www.digitalmars.com/webnews/newsgroups.php).  There are shortcuts if you are using a news reader.  In my case, using Outlook Express, I look at the properties of the message, and there is a field:

Xref: digitalmars.com digitalmars.D:71186

You can use this information in the web newsreader url:

http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=71186

-Steve