[閒聊] 以下六個分別是什咩語言?
看板PLT (程式語言與理論)作者Schelfaniel (Schelfaniel)時間15年前 (2009/07/02 09:26)推噓4(4推 0噓 4→)留言8則, 5人參與討論串1/3 (看更多)
取自 PragProg Magazine 2009 7 月號
以下六個分別是什麼語言呢?
1.
Process Class Creator;
Begin
While true do begin
Activate New Consumer(Time);
Hold(Uniform(5, 15, 1));
End While;
End of Creator;
2.
<Any T, Any U> T first((T,U) tuple) {
(T t, U u) = tuple;
return t;
}
3.
PROC null.farm(CHAN OF ADDR.TASK.STREAM from.farm,
CHAN OF ADDR.RESULT.STREAM to.farm )
PAR
from.farm ? CASE no.more.task.packets
to.farm ! no.more.result.packets
:
4.
LET start() = VALOF
$( FOR i = 1 TO 5 DO writef("%n! = %i4*n", i, fact(i))
RESULTIS 0
$)
AND fact(n) = n=0 -> 1, n*fact(n-1)
5.
PROCEDURE speak*( VAR bird : Birds.Bird );
BEGIN
WITH bird : Cuckoos.Cuckoo DO
bird.sound := "Cuckoo!";
| bird : Ducks.Duck DO
bird.sound := "Quack!";
ELSE bird.sound := "Tweet!";
END;
END setSound;
6.
HAI
CAN HAS STDIO?
IM IN YR LOOP UPPIN YR NUM TIL BOTHSAEM NUM AN 10
VISIBLE SUM OF NUM AN 1
IM OUTTA YR LOOP
KTHXBYE
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.29.29.137
推
07/02 09:42, , 1F
07/02 09:42, 1F
推
07/02 09:48, , 2F
07/02 09:48, 2F
→
07/02 09:57, , 3F
07/02 09:57, 3F
→
07/02 09:57, , 4F
07/02 09:57, 4F
→
07/02 09:59, , 5F
07/02 09:59, 5F
推
07/02 10:49, , 6F
07/02 10:49, 6F
→
07/02 11:23, , 7F
07/02 11:23, 7F
推
07/02 12:45, , 8F
07/02 12:45, 8F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 3 篇):
PLT 近期熱門文章
PTT數位生活區 即時熱門文章