Thread overview
Yıl 1988: D'nin Temellerinin Atıldığı Bir Tartışma
Jul 27, 2012
Salih Dinçer
Jul 27, 2012
Salih Dinçer
Jul 27, 2012
Salih Dinçer
Jul 27, 2012
Salih Dinçer
July 27, 2012

Alıntı ("comp.lang.c/The D Programming Language (Chris Torek)"):

>

-In article 24996@cca.CCA.COM g-rh@cca.CCA.COM (Richard Harter) writes:
-}As a side point, I like the suggestion that someone made that there be
-}a fallthrough statement rather than automatic fallthrough.

In article 222965b9@ralf.home Ralf.Brown@B.GP.CS.CMU.EDU writes:
-So, you would like to have to write

  •    switch(var)
    
  •       {
    
  •       case foo: fallthrough;
    
  •       case bar: fallthrough;
    
  •       case baz: fallthrough;
    
  •       case mung: /* code to do something for all four cases */
    
  •       }
    

While this would work, if we assume D has aggregate constructors,
there is a handsomer way:

    switch (e) {
    case [1, 2, 3, 5, 7, 13, 19, 23]: ...
    }
    /* syntax above is only for demonstration */

--
In-Real-Life: Chris Torek, Univ of MD Computer Science, +1 301 454 7163
(still on trantor.umd.edu because mimsy is not yet re-news-networked)
Kaynak: https://groups.google.com/d/msg/comp.lang.c/y0uGj6tHe2E/R3gJ4buDV9QJ

İlk önce bu yukarıdaki dikkatimi çekti ve D'de var...:)

Gerçi final takısını kullanmak gerekiyor ama çok daha iyisi var ki ardışık gidenler için şöyle bir örnek verilebilir:

enum Rakamlar { Sıfır, Bir, İki, Üç, Dört, Beş, Altı, Yedi, Sekiz, Dokuz }

switch (1) {
   case 0: writeln(Rakamlar.Sıfır);
       break;
   case 1: .. case 9: for(auto rakam = Rakamlar.min;
                               rakam < Rakamlar.max;
                               rakam++, rakam.writeln) {}
       break;
   case 10: writeln("On");
       break;
   default: writeln("Bu sayıyı bilmiyorum!");
}

Ancak şunun gibi 'şeyle'r yok ve eksikliğini çekiyorum. Çünkü GoLang (http://golang.org) gibi genç dillerde vardı...

Alıntı ("comp.lang.c/The D Programming Language (Dave Sill)"):

> >

Some years ago I invented the hypothetical notation "e1 ,, e2", which would be
like the comma operator in that it evaluates its left operand before its
right operand, but (unlike comma) the result would be the value of the left
operand. Look what this buys us:
'> a,, a=b /* displacement operator, like a :=:= b /
a=(b,, b=a) /
a simple swap /'
x,, ++x /
same as x++; but generalizable /
free(stack,, stack=stack->next) /
pop stack /
stack->value,, pop(stack) /
pop and return stacked value */

I like it. Nice and general, fills a gap missing in C. It's not C,
but it could be D (it should be D, not P (pee?)).

Maybe we should start a new newsgroup/mailing-list for the discussion
of such things. It seems like a lot of the current discussion here is
about things that will never make it into ANSI C such as a power
operator, `noalias' :-) et cetera. Sure would improve the S/N ratio
for those interested only in C.

=========
The opinions expressed above are mine.

"The limits of my language mean the limits of my world."
-- Ludwig Wittgenstein
Kaynak: https://groups.google.com/d/msg/comp.lang.c/y0uGj6tHe2E/FhRthsdC9R0J

--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]

July 27, 2012

Evet, bence de ilginç...

Herhalde o zaman Google'da yoktu ve bu listeyi oradan (comp.lang.c) naklediyor. E-posta adreslerine dikkat ederseniz çoğu üniversite ve kurum. Henüz internet küreselleşmeden (Türkiye'de herhalde BBS'ler bile yoktu!) D'yi, amiyane tabirle yakın markaja almışlar...:)

Sanırım D'nin İngilizce'de söylenişi çoğunluğun hoşuna gidiyor ki başka biri Dave'e cevap olarak şöyle yazmış:
Alıntı:

>

In article 11702@brl-adm.ARPA dsill@NSWC-OAS.arpa (Dave Sill) writes:

>

but it could be D (it should be D, not P (pee?)).

Maybe we should start a new newsgroup/mailing-list for the discussion
of such things. It seems like a lot of the current discussion here is
about things that will never make it into ANSI C such as a power
operator, `noalias' :-) et cetera. Sure would improve the S/N ratio
for those interested only in C.

Sounds good to me.

I've been collecting interesting ideas about ``D'' off the net for a while.
If y'all would like to send me your 1 or two favorite "improvements" to
C to be incorporated in "D", I'll send you a summary in response.

Not that I intend to write D or P or whatever, but if somebody wants my
ideas (take my ideas, please!)

    ;-D on  (Creativity is ... hard to define)  Pardo

    pardo@cs.washington.edu                ..!ucbvax!uw-beaver!uw-june!pardo

--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]

July 27, 2012

Alıntı (acehreli):

>

Ama burada önerilen D ismi ya unutulmuş ya da çok sonradan tekrar hatırlanmış olmalı. Çünkü Walter'ın seneler sonra geliştirdiği dilin adı önce Digital Mars imiş ama birileri "D daha uygun" demişler...
Doğrudur, aklın yolu bir ya...:)

Sanırım buradaki tartışmada Digital Mars'ın temsilcileri yer almamış olabilir. Bu arada David Keppel ilgimi çekti ve bir kaç kitabı (http://www.informatik.uni-trier.de/~ley/db/indices/a-tree/k/Keppel:David.html) varmış:

--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]

July 27, 2012

Ooov...

Ben görmemişim! Hatta 'for()' içine koşullu bir goto'lu örnek (-bknz. aşağıdakini) göndermiş...:)

Hoş, biz onu diğer dillerde de tek satırda halledebiliyoruz! Ben şu ana kadar goto'nun olmazsa olmaz bir faydasını görebilmiş değilim...

/*
   forgoto.d (27.07.2012)
*/
import std.stdio;

void main(){
 bool a;
 version(1) a = true;
 int i;

 for(if(a)i=2; i < 10; i++) i.write("\t");

 writeln("\nBu örnek, aşağıdakiler ile eşdeğer sayılır...");

 int b() {
   return 2;
 }

 if(a) {
   i = b();
   goto L1;
 }

 for(i = 0; i < 10; i++) {
   L1: i.write("\t");
 }

 writeln;
}

--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]

July 27, 2012

Çok ilginç. :) O tarihlerde internet yok sayılırdı.

Ama burada önerilen D ismi ya unutulmuş ya da çok sonradan tekrar hatırlanmış olmalı. Çünkü Walter'ın seneler sonra geliştirdiği dilin adı önce Digital Mars imiş ama birileri "D daha uygun" demişler... diye duymuştum... Önemli değil tabii...

Ali

--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]

July 27, 2012

Alıntı (Salih Dinçer):

>

Sanırım buradaki tartışmada Digital Mars'ın temsilcileri yer almamış olabilir.

Ben o tartışmada Walter Bright'ın ismini görüyorum. goto'nun derleyicinin branch prediction'ına aslında kötü etkisi olmadığını anlatıyor.

Bir arkadaşım o tarihlerde Walter'ın yazdığı Zortech C++ derleyicisini kullanıyordu. (Ben C++ bilmiyordum ve özeniyordum. :)) Tek resimlik bir sitesi bile var:

http://www.zortech.com/

Ali

--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]

July 27, 2012

Alıntı (Salih Dinçer):

>

Ben şu ana kadar goto'nun olmazsa olmaz bir faydasını görebilmiş değilim...

Aynı konu şu sıralarda Digital Mars haber gruplarında da tartışılıyor:

http://forum.dlang.org/thread/pzhwiumzhktkzdmvlpig@forum.dlang.org

Söylediklerine göre en anlamlı kullanımı sonlu durum makinasına (finite state matchine) uygunmuş.

Ali

--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]