跳至內容

ALGOL六十八

出自Taiwan Tongues 台語維基
這是此頁批准,以及是最近的修訂。

ALGOL 六十八(源自英語:ALGOrithmic Language 一千九百六十八的縮寫), 一種指令式程式語言,為 ALGOL 家族的成員,是官方上的 ALGOL 六十後繼者。伊設計的目標,是提供閣較廣泛的應用,猶閣有閣較嚴格的語法定義。

概論

ALGOL 六十八由 IFIP Working Group 二嬸一負責設計。一九六八年十二月二十號,Working Group 二嬸一通過了這个語法規範,閣提交 IFIP 大會通過。伊的主要架構者為阿德里安 ・ 范 ・ 韋恩加登。

代碼樣例

下跤的樣例代碼實現了埃拉托斯特尼篩法來揣著小於等於一百的所有素素。` NIL ` 是 ALGOL 六十八中同其他的語言內底「空指針」的類似者。表示法 ` x OF y ` 訪問 ` STRUCT y ` 的成員 ` x `。

` ` ` BEGIN# Algol 枋六十八素增加法,函肪式抹做 #

PROCerror=(STRINGs )VOID: ( print ( ( newline , " error : " , s , newline ) ) ;GOTOstop ) ; PROCone to=(INTn )LIST: (PROCf=(INTm , n )LIST: ( m > n |NIL| cons ( m , f ( m + 一 , n ) ) ) ; f ( 一 , n ) ) ;

MODE'LIST=REF'NODE; MODE'NODE=STRUCT(INTh ,'LISTt ) ; PROCcons=(INTn ,'LISTl )LIST:HEAP'NODE  :=( n , l ) ; PROChd=(LISTl )'INT: ( lIS'NIL| error ( " hdNIL" ) ;SKIP| hOFl ) ; PROCtl=(LISTl )'LIST: ( lIS'NIL| error ( " tlNIL" ) ;SKIP| tOFl ) ; PROCshow=(LISTl )'VOID: ( lISNT'NIL|PRINT( ( " " , whole ( hd ( l ) , 零 ) ) ) ; show ( tl ( l ) ) ) ;

PROCfilter=(PROC(INT)BOOLp ,LISTl )LIST: 'IFlIS'NIL'THEN'NIL ELIFp ( hd ( l ) )THENcons ( hd ( l ) , filter ( p , tl ( l ) ) ) ELSEfilter ( p , tl ( l ) ) FI;

PROCsieve=(LISTl )LIST: 'IFlIS'NIL'THEN'NIL ELSE PROCnot multiple=(INTn )BOOL: nMODhd ( l ) ≠ 零 ; cons ( hd ( l ) , sieve ( filter ( not multiple , tl ( l ) ) ) ) FI;

PROCprimes=(INTn )LIST: sieve ( tl ( one to ( n ) ) ) ;

show ( primes ( 一百 ) ) END ` ` `

註解

外部連結

  • Revised Report on the Algorithmic Language ALGOL 六十八 The official reference for users and implementors of the language ( large pdf file , scanned from Algol Bulletin )
  • Revised Report on the Algorithmic Language ALGOL 六十八 Hyperlinked HTML version of the Revised Report
  • A Tutorial on Algol 六十八 , by Andrew S . Tanenbaum , in _ Computing Surveys _ , Vol . 八 , No . 二 , June 一千九百七十六 , with Corrigenda ( Vol . 九 , No . 三 , September 一千九百七十七 )
  • Algol 六十八 Genie–a GNU GPL Algol 六十八 compiler-interpreter
  • Open source Algol 六十八 implementations , on SourceForge
  • Algol 六十八 Standard Hardware representation ( . pdf )
  • Из истории создания компилятора с Алгол 六十八
  • Algol 六十八–二十五 Years in the USSR
  • Система программ динамической поддержки для транслятора с Алгол 六十八
  • C history with Algol 六十八 heritage
  • McJones , Paul , " Algol 六十八 implementations and dialects " , _ Software Preservation Group _ , Computer History Museum , 二千空一十一孵七孵五
  • Web enabled ALGOL 六十八 compiler for small experiments