home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / beta-language-faq / text0000.txt < prev   
Encoding:
Text File  |  1997-12-16  |  175.9 KB  |  4,560 lines

  1. BETA: Frequently Asked Questions (FAQ)
  2.  
  3. ----------------------------------------------------------------------------
  4. This question-and-answer list is posted regularly to the BETA mail group,
  5. and to the Usenet newsgroups comp.lang.beta, comp.answers, and news.answers.
  6.  
  7. Please send corrections, additions and comments to Jorgen Lindskov Knudsen
  8. (jlk@daimi.aau.dk).
  9.  
  10. This information is abstracted and condensed from the posts of many
  11. different contributors. No guarantees are made regarding its accuracy.
  12. ----------------------------------------------------------------------------
  13. There are several ways to get this document:
  14.  
  15.    * E-mail: The FAQ can be obtained by sending a message to
  16.      info@mjolner.com with the following message body:
  17.  
  18.         send BETA beta-language-faq
  19.  
  20.    * FTP: The FAQ can be fetched via anonymous ftp from ftp.daimi.aau.dk as
  21.  
  22.         pub/beta/faq/beta-language-faq.txt
  23.  
  24.    * WWW: The FAQ is available in hypertextualized form on the World Wide
  25.      Web at URL
  26.  
  27.         http://www.daimi.aau.dk/~beta/FAQ.
  28.  
  29.      (This site always contains the most recent version.)
  30.  
  31. More information on BETA can be found on:
  32.  
  33.    * The BETA Home Page:
  34.  
  35.         http://www.daimi.aau.dk/~beta/
  36.  
  37.    * The Mjolner System Home Page:
  38.  
  39.         http://www.mjolner.com/
  40.  
  41. ----------------------------------------------------------------------------
  42.  
  43. Changes since version 1.10
  44.  
  45. New entries:
  46.  
  47.    * Why does my guienvsystemenv program stop at startup? (B09)
  48.    * What is the maximum length of a BETA identifier? (L24)
  49.    * What is the exact qualification rules for nested patterns? (L25)
  50.    * Does BETA work on Motorola machines? (M05)
  51.    * Known bugs, limitations and inconveniences in release 4.0.2 (W06)
  52.    * Known bugs, limitations and inconveniences in release 4.1 (W07)
  53.    * What are the system requirements to run BETA on HPUX workstations?
  54.      (HP01)
  55.    * What are the system requirements to run BETA on Linux machines? (Lx01)
  56.    * Why does GuiEnv demos segmentation fail? [error in r4.0 & r4.0.1]
  57.      (Lx03)
  58.    * What are the system requirements to run BETA on Sun workstations?
  59.      (Sun01)
  60.    * Using BETA on IRIX 6 machines(SG04)
  61.    * How to format BETA programs in LaTeX? (Q19)
  62.    * xxx? (ref)
  63.    * New features in version 5.3 of the Compiler (C14.1)
  64.  
  65. Changed entries:
  66.  
  67.    * What are the system requirements to run BETA on Macintosh? (M01)
  68.    * What is MPW. Where do I get it? (M02)
  69.    * Does BETA work on PowerPC machines? (M04)
  70.    * SDK Requirements for Windows 95 or Windows NT (W02) [Updated info
  71.      related to r4.0.1]
  72.    * Limitations, bugs and inconveniences (SG05)
  73.    * Disclaimer (Slow startup of tools) (SG06)
  74.    * xxx? (ref)
  75.  
  76. Removed entries:
  77.  
  78.    * System Requirements for specific platforms (old Q19)
  79.  
  80. In addition, a number of minor changes and corrections have been made to
  81. other entries.
  82. ----------------------------------------------------------------------------
  83.  
  84. Contents
  85.  
  86.    * Part I: Frequently Asked Questions
  87.         o Q01) What is BETA?
  88.         o Q02) Where did BETA come from?
  89.         o Q03) What BETA products are available?
  90.         o Q04) Are there any school or student discounts?
  91.         o Q05) Is BETA available in the public domain?
  92.         o Q06) What books are available for learning about BETA?
  93.         o Q07) Does an introduction to BETA besides the BETA book exist?
  94.         o Q08) Are any magazines or newsletters concerning BETA available?
  95.         o Q09) Are there any user groups related to BETA?
  96.         o Q10) Are there any mailing lists related to BETA?
  97.         o Q11) Are there any newsgroups related to BETA?
  98.         o Q12) Is there an archive of BETA postings?
  99.         o Q13) Are there any conferences for BETA users?
  100.         o Q14) Is BETA available on PC, Mac, NeXT, Amiga, Atari, ...?
  101.         o Q15) Are there standards for the BETA language?
  102.         o Q16) What is Mjolner, Sif, Valhalla, Bifrost, Yggdrasil, etc.?
  103.         o Q17) Is it possible to obtain an evaluation version of the Mjolner
  104.           System?
  105.         o Q18) What is the origin of the name BETA?
  106.         o Q19) How to format BETA programs in LaTeX?
  107.    * Part II: Language Issues
  108.         o L01) What features do BETA have?
  109.         o L02) What changes have been made to the BETA language definition?
  110.         o L03) How do I deal with concurrency in BETA?
  111.         o L04) How do I deal with persistence in BETA?
  112.         o L05) How do I deal with distribution in BETA?
  113.         o L06) How do I deal with exception handling in BETA?
  114.         o L07) Can classes be treated as first-order elements in BETA?
  115.         o L08) What about garbage collection in BETA?
  116.         o L09) How do I create a "parameterized class"?
  117.         o L10) What is the difference between a virtual binding, a further
  118.           binding and a final binding (i.e. between :<, ::<, and ::)?
  119.         o L11) What about invariants in BETA?
  120.         o L12) What about change propagation in BETA?
  121.         o L13) What about futures in BETA?
  122.         o L14) Why can't local variables be accessed in INNER?
  123.         o L15) How do I implement a copy (or clone) operation?
  124.         o L16) Why doesn't BETA have multiple inheritance?
  125.         o L17) What is the rationale behind the syntax of BETA?
  126.         o L18) How do the scope rules of BETA actually work?
  127.         o L19) What is a pattern?
  128.         o L20) Are identifiers and keyworks case-sensitive in BETA?
  129.         o L21) What characters are allowed in BETA identifiers?
  130.         o L22) What is the exact semantics of leave P and restart P, when P
  131.           is the name of a pattern?
  132.         o L23) What is the BETA lexem syntax?
  133.         o L24) What is the maximum length of a BETA identifier?
  134.         o L25) What is the exact qualification rules for nested patterns?
  135.    * Part III: Environment Issues
  136.         o E01) What is the Mjolner System?
  137.         o E02) What does the Mjolner System contain?
  138.         o E03) What libraries come with the Mjolner System?
  139.         o E04) What frameworks come with the Mjolner System?
  140.         o E05) What tools come with the Mjolner System?
  141.         o E06) Does a beta-mode for Emacs exist?
  142.    * Part IV: Specific Issues
  143.         o Section I: The Fragment System
  144.              + F01) What is the purpose of the fragment system?
  145.              + F02) How do I separate implementation and specification code?
  146.              + F03) How do I work around "*****Only pattern-declarations may
  147.                appear in a fragment of category 'attributes'"?
  148.              + F04) Why can't I have instances in attributes-fragments?
  149.              + F05) Why can't I have virtual declarations/bindings in
  150.                attributes-fragments?
  151.              + F06) What are the differences between the INCLUDE facilities
  152.                of BETA and C?
  153.              + F07) Why doesn't the compiler complain about a missing inner
  154.                in a body fragment?
  155.              + F08) Can <<Attributes>> be used instead of <<AttributeDecl>>?
  156.         o Section II: The X libraries
  157.              + X01) Why does my label widget sometimes get the attribute
  158.                name as label-string, and sometimes not?
  159.              + X02) Why do I get the error "There must be only one non-shell
  160.                widget which is son of Toplevel"?
  161.              + X03) How do I get a separate window for my widget?
  162.              + X04) Why do I get the error "clockWidgetClass: undefined"
  163.                when linking my AwEnv program? [corrected in r4.0]
  164.              + X05) Why do I get the error "Error: NULL ArgVal in
  165.                XtGetValues" when executing my Xt program? [corrected in
  166.                r4.0]
  167.              + X06) How do I set font information in MotifStrings?
  168.              + X07) Resource specification errors in Xt/v1.9
  169.         o Section III: The BETA compiler
  170.              + C01) What is the execution speed of BETA programs?
  171.              + C02) How do I get rid of the warning: "A run-time
  172.                qualification check will be inserted here"?
  173.              + C03) What *does* that Qua-check warning mean, anyway?
  174.              + C04) How do I work around "*****Repetition of non simple
  175.                patterns is not implemented"? [corrected in r4.0]
  176.              + C05) How do I work around "Labeled imperative not
  177.                implemented"?
  178.              + C06) Why does a BETA program called test.bet cause problems
  179.                on some UNIX installations?
  180.              + C07) How do I disable qualification check warnings?
  181.              + C08) What is the difference between P and &P?
  182.              + C09) What does "virtual prefix not implemented" mean?
  183.                [corrected in r4.0]
  184.              + C10) What should I do if the compiler prints "Please report
  185.                the error to Mjolner Informatics" and stops?
  186.              + C11) What are the known errors the compiler?
  187.                   + C11.1) Bugs in version 5.0
  188.                   + C11.2) Bugs in version 5.1
  189.                   + C11.3) Bugs in version 5.2
  190.              + C12) Tracing the work of compiler?
  191.              + C13) Problem with floating point expressions in connection
  192.                with repetitions
  193.              + C14) New features introduced in the Compiler
  194.                   + C14.1) New features in version 5.3 of the Compiler
  195.                   + C14.2) New features in version 5.2 of the Compiler
  196.                   + C14.3) New features in version 5.1 of the Compiler
  197.                   + C14.4) New features in version 5.0 of the Compiler
  198.         o Section IV: The Basic libraries
  199.              + B01) How do you compare text strings in BETA?
  200.              + B02) How do you read and write text in BETA?
  201.              + B03) Why does getInt followed by getLine not necessarily work
  202.                as expected?
  203.              + B04) What is the rationale behind the Mjolner System file
  204.                directory structures?
  205.              + B05) What do the (* idx+ *), etc. comments mean?
  206.              + B06) Error in v1.4/seqContainer.bet? [corrected in r4.0]
  207.              + B07) Error in v1.4/regexp.bet? [corrected in r4.0]
  208.              + B08) Error in v1.4/basicsystemenv.bet? [corrected in r4.0]
  209.              + B09) Why does my guienvsystemenv program stop at startup?
  210.    * Part V: Platform Specific Issues
  211.         o Section V: BETA on Macintosh
  212.              + M01) What are the system requirements to run BETA on
  213.                Macintosh?
  214.              + M02) What is MPW. Where do I get it?
  215.              + M03) Do I need a floating point unit to use BETA?
  216.              + M04) Does BETA work on PowerPC machines?
  217.              + M05) Does BETA work on Motorola machines?
  218.              + M06) Known bugs, limitations and inconveniences in release
  219.                4.0.2
  220.              + M07) Known bugs, limitations and inconveniences in release
  221.                4.1
  222.         o Section VI: BETA on Windows 95 and Windows NT
  223.              + W01) What are the system requirements to run BETA on Windows
  224.                95 and Windows NT?
  225.              + W02) SDK Requirements for Windows 95 or Windows NT
  226.              + W03) Why do I need a MAKE facility?
  227.              + W04) Error in directory scan using Borland SDK? [corrected in
  228.                r4.0]
  229.              + W05) Make-error for lazyref_gc.c using Borland SDK?
  230.                [corrected in r4.0.2]
  231.              + W06) Known bugs, limitations and inconveniences in release
  232.                4.0.2
  233.         o Section VII: BETA on HPUX
  234.              + HP01) What are the system requirements to run BETA on HPUX
  235.                workstations?
  236.              + HP02) Why do some callbacks cause "Illegal Instruction" on
  237.                hpux9pa (using v5.0 of the compiler)?
  238.         o Section VIII: BETA on Linux
  239.              + Lx01) What are the system requirements to run BETA on Linux
  240.                machines?
  241.              + Lx02) How to make the BETA compiler version 5.0/5.1 work with
  242.                Linux ELF libraries [corrected in r4.0]
  243.              + Lx03) Why does GuiEnv demos segmentation fail? [error in r4.0
  244.                & r4.0.1]
  245.         o Section IX: BETA on Silicon Graphics
  246.              + SG01) What are the system requirements to run BETA on Silicon
  247.                Graphics workstations?
  248.              + SG02) Gnu C Compiler gcc not supported
  249.              + SG03) Remember to set LD_LIBRARY_PATH
  250.              + SG04) Using BETA on IRIX 6 machines
  251.              + SG05) Limitations, bugs and inconveniences
  252.              + SG06) Disclaimer (Slow startup of tools)
  253.         o Section X: BETA on Sun workstations
  254.              + Sun01) What are the system requirements to run BETA on Sun
  255.                workstations?
  256.  
  257. ----------------------------------------------------------------------------
  258.  
  259. PART I: Frequently Asked Questions
  260.  
  261. ----------------------------------------------------------------------------
  262.  
  263. Q01) What is BETA?
  264.  
  265. BETA is a modern object-oriented language with comprehensive facilities for
  266. procedural and functional programming. BETA has powerful abstraction
  267. mechanisms than provide excellent support for design and implementation,
  268. including data definition for persistent data. The abstraction mechanisms
  269. include support for identification of objects, classification, and
  270. composition. BETA is a strongly typed language (like Simula, Eiffel, and
  271. C++), with most type checking being carried out at compile-time.
  272.  
  273. The abstraction mechanisms include class, procedure, function, coroutine,
  274. process, exception, and many more, all unified into the ultimate abstraction
  275. mechanism: the pattern. In addition to the pattern, BETA has subpattern,
  276. virtual pattern, and pattern variable.
  277.  
  278. BETA does not only allow for passive objects as in Smalltalk, C++, and
  279. Eiffel. BETA objects may also act as coroutines, making it possible to model
  280. alternating sequential processes and quasi-parallel processes. BETA
  281. coroutines may also be executed concurrently with supported facilities for
  282. synchronization and communication, including monitors and rendezvous
  283. communication.
  284. ----------------------------------------------------------------------------
  285.  
  286. Q02) Where did BETA come from?
  287.  
  288. BETA originates from the Scandinavian school of object-orientation where the
  289. first object-oriented language Simula was developed. Object-oriented
  290. programming originated with the Simula languages developed at the Norwegian
  291. Computing Center, Oslo, in the 1960s. The first Simula language, Simula I,
  292. was intended for writing simulation programs. Simula I was later used as a
  293. basis for defining a general-purpose programming language, Simula 67 (later
  294. renamed to Simula). Simula has been used by a relatively small community for
  295. a number of years, although it has had a major impact on research in
  296. computer science.
  297.  
  298. The BETA language development process started out in 1975 with the aim to
  299. develop concepts, constructs and tools for programming, partly based on the
  300. Simula languages. The BETA language team consists of Bent Bruun Kristensen,
  301. Birger Moller-Pedersen, Ole Lehrmann Madsen, and Kristen Nygaard. Kristen
  302. Nygaard was one of the two original designers of the Simula languages.
  303. ----------------------------------------------------------------------------
  304.  
  305. Q03) What BETA products and services are available?
  306.  
  307. Currently there is only one supplier of BETA products, namely Mjolner
  308. Informatics, who is marketing an entire development system (the Mjolner
  309. System) based on the BETA language.
  310.  
  311. In the US, the MacTech Magazine Mail Store is the distributor of the Mjolner
  312. System.
  313.  
  314. In France and the French parts of Belgium and Switzerland, the Mjolner
  315. System is distributed by BCDL-ObjectLand.
  316.  
  317. In UK, the Mjolner System is distributed by InterGlossa.
  318.  
  319. Mjolner Informatics offers the Mjolner System technology to other commercial
  320. organizations who are interested in building BETA products (such as
  321. alternative development systems), or who are interested in developing
  322. value-added products for the Mjolner System. This offer is based on
  323. licensing of the implementation of the existing system (including source
  324. code, if needed).
  325.  
  326.      Mjolner Informatics
  327.           Gustav Wieds Vej 10
  328.           DK-8000 Aarhus C
  329.           Denmark
  330.           Phone: +45 86 12 20 00
  331.           Fax: +45 86 12 20 22
  332.           E-mail: info@mjolner.com
  333.           WWW: http://www.mjolner.com
  334.           WWW Sales: http://www.mjolner.com/warehouse/
  335.  
  336.      MacTech Magazine, Mail Order Store
  337.           Xplain Corporation
  338.           P.O. Box 250055
  339.           1617 Pontius Avenue, 2nd Floor
  340.           Los Angeles, CA 90025-9555, USA
  341.           Phone: +1 310 575 4343
  342.           Fax: +1 310 575 0925
  343.           AppleLink: MACTECHMAG
  344.           CompuServe: 71333,1064
  345.           Internet: neil_ticktin@xplain.com
  346.           America Online: MACTECHMAG
  347.           GEnie: MACTECHMAG
  348.  
  349.      BCDL-ObjectLand
  350.           26 rue Jules Lanery
  351.           F-59240 Dunkerque
  352.           France
  353.           Phone: +33 28 66 53 00
  354.           Fax: +33 28 66 53 01
  355.           E-mail: ObjectLand@netinfo.fr
  356.           WWW: http://www.netinfo.fr/ObjectLand/ (Journal of
  357.           ObjectLand, the newsletter)
  358.           WWW: http://www.netinfo.fr/BCDL/ (Home Page of BCDL)
  359.  
  360.      InterGlossa Ltd
  361.           59, Alexandra Road
  362.           Reading RG1 5PG
  363.           UK
  364.           Phone: +44 1734 561919
  365.           Fax: +44 1734 561920
  366.           E-mail: Tom.Lake@glossa.co.uk
  367.           WWW: http://www.glossa.co.uk
  368.  
  369. ----------------------------------------------------------------------------
  370.  
  371. Q04) Are there any school or student discounts?
  372.  
  373. Mjolner Informatics offers substantial discounts for educational purposes
  374. (e.g. 45/%}. Also included in educational site licenses are attractive
  375. offers for the institutions to freely distribute Personal Edition versions
  376. of the system to those students, following the cources, in which BETA is
  377. used.
  378.  
  379. Generally, the Personal Edition versions of the system is freely available
  380. directly from Mjolner Informatics. Visit the download area for more
  381. information.
  382. ----------------------------------------------------------------------------
  383.  
  384. Q05) Is BETA available in the public domain?
  385.  
  386. The BETA language definition is in the public domain. A reference manual on
  387. the language is in progress (release-date not fixed yet).
  388.  
  389. The Personal Edition versions of the system is freely available from Mjolner
  390. Informatics. Visit the download area for more information.
  391.  
  392. Kai Petzke has initiated a project for writing a freeware compiler for BETA.
  393. It is implemented as a translator of BETA to C. For more information and to
  394. download a working copy of the compiler, that understands most of BETA's
  395. grammatical terms, see the web page:
  396. http://troubadix.physik.tu-berlin.de/~petz0433/beta/eindex.html.
  397. ----------------------------------------------------------------------------
  398.  
  399. Q06) What books are available for learning about BETA?
  400.  
  401. The ultimate source of information on the BETA language is:
  402.  
  403.      Ole Lehrmann Madsen, Birger Moller-Pedersen, Kristen Nygaard:
  404.      "Object-Oriented Programming in the BETA Programming Language"
  405.      Addison-Wesley and ACM Press, 1993
  406.      ISBN 0-201-62430-3
  407.  
  408. An german introduction to BETA can be found in the book:
  409.  
  410.      Ernst Erich Doberkat, Stefan Di▀mann:
  411.      "Einfⁿhrung in die objectkorientierte Programmierung mit BETA"
  412.      Addison-Wesley-Longman, 1996
  413.      ISBN 3-8273-1026-1
  414.  
  415. The Mjolner System and the BETA language is also extensively described in
  416. the book:
  417.  
  418.      Jorgen Lindskov Knudsen, Mats Lofgren, Ole Lehrmann Madsen, Boris
  419.      Magnusson (eds.):
  420.      "Object-Oriented Environments: The Mjolner Approach"
  421.      Prentice-Hall, 1993
  422.      ISBN 0-13-009291-6
  423.  
  424. ----------------------------------------------------------------------------
  425.  
  426. Q07) Does an introduction to BETA besides the BETA book exist?
  427.  
  428. The previously mentioned book: "Object-Oriented Environments: The Mjolner
  429. Approach" contains an introductory chapter on the BETA language.
  430.  
  431. Besides, various current activities indicate that introductory material in
  432. the form of tutorials are in the pipeline.
  433.  
  434. See also question Q08.
  435. ----------------------------------------------------------------------------
  436.  
  437. Q08) Are any magazines or newsletters concerning BETA available?
  438.  
  439. The BETA language has been presented in several conference papers, including
  440. the OOPSLA, ECOOP, and TOOLS conferences. BETA has also been described in a
  441. couple of articles in Dr. Dobb's Journal, #206, October 1993. Furthermore,
  442. Communications of the ACM, Vol. 37, No. 2, February 1994, is a special issue
  443. on Hypermedia, including three papers on the use of the Mjolner System (and
  444. the BETA language) for building hypermedia systems.
  445.  
  446. Mjolner Informatics produces a quarterly 8-page newsletter called "Mjolner
  447. BETA Newsletter".
  448. ----------------------------------------------------------------------------
  449.  
  450. Q09) Are there any user groups related to BETA?
  451.  
  452. Yes, there is a user group hosted by Mjolner Informatics. The user group is
  453. primarily organized around the BETA mailing list: usergroup@mjolner.com
  454.  
  455. The BETA user group is one of the important sources of information on the
  456. developments of the Mjolner System, and an important source of information
  457. to Mjolner Informatics on the users' expectations for future developments.
  458.  
  459. See also question Q10.
  460. ----------------------------------------------------------------------------
  461.  
  462. Q10) Are there any mailing lists related to BETA?
  463.  
  464. There is a mailing list for BETA, organized by Mjolner Informatics:
  465.  
  466.    usergroup@mjolner.com
  467.  
  468. In order to be added to, or removed from the mailing list, please send a
  469. mail to:
  470.  
  471.    usergroup-request@mjolner.com
  472.  
  473. (Do not send subscription requests to usergroup@mjolner.com as they will be
  474. mirrored onto comp.lang.beta.)
  475.  
  476. Mail sent to the mailing list is automatically forwarded to the
  477. comp.lang.beta newsgroup and news posted on the newsgroup is automatically
  478. forwarded (moderated) to the mailing list.
  479. ----------------------------------------------------------------------------
  480.  
  481. Q11) Are there any newsgroups related to BETA?
  482.  
  483. The comp.lang.beta Usenet newsgroup is available for discussing issues
  484. related to the BETA language.
  485.  
  486. Postings to comp.lang.beta are automatically forwarded (moderated) to the
  487. usergroup@mjolner.com mailing list and mails to the mailing list is
  488. automatically posted to the newsgroup.
  489. ----------------------------------------------------------------------------
  490.  
  491. Q12) Is there an archive of BETA postings?
  492.  
  493. Mjolner Informatics keeps an archive of the BETA mailing list.
  494.  
  495. In addition, the University of Aarhus maintains an archive of all postings
  496. to the comp.lang.beta newsgroup, available at:
  497.  
  498.    * http://www.daimi.aau.dk/~beta/News/
  499.    * ftp://ftp.daimi.aau.dk/pub/beta/comp.lang.beta
  500.  
  501. The former is updated daily, the latter annually.
  502. ----------------------------------------------------------------------------
  503.  
  504. Q13) Are there any conferences for BETA users?
  505.  
  506. There are no conferences devoted entirely to the BETA language and
  507. development system. BETA shares the spotlight with other object-oriented
  508. languages including C++, Eiffel, and Smalltalk in conferences like:
  509.  
  510. TOOLS
  511.      the major international conference devoted to the applications of
  512.      Object-Oriented technology.
  513. ECOOP
  514.      the European Conference on Object-Oriented Programming.
  515. OOPSLA
  516.      the major international conference on Object-Oriented Programming,
  517.      Systems, Languages, and Applications.
  518.  
  519. ----------------------------------------------------------------------------
  520.  
  521. Q14) Is BETA available on PC, Mac, NeXT, Amiga, Atari, ...?
  522.  
  523. Currently, BETA is available on UNIX workstations, on PowerPC Macintosh and
  524. on Intel-based PCs.
  525.  
  526. On UNIX, the platforms supported are: Sun Sparc (Solaris), HP 9000 (series
  527. 700) and Silicon Graphics MIPS machines running IRIX 5.3 or 6.
  528.  
  529. Mjolner System is also available for Linux (386/486/Pentium). Linux is a
  530. very popular freely available UNIX implementation for Intel processors (for
  531. more information, see the Linux FAQ).
  532.  
  533. Mjolner System is also available for Windows 95 and Windows NT
  534. (386/486/Pentium).
  535.  
  536. There are no current plans to port the Mjolner System to neither DOS nor
  537. Windows 3.1 due to the 16-bit addressing and 8-character filename
  538. limitations.
  539.  
  540. Although not officially confirmed by Mjolner Informatics, users of the
  541. Mjolner System have reported that the Mjolner System can be effectively used
  542. on Amiga 4000 machines under the MacOS simulator, with an execution speed
  543. reported to be comparable to that of an HP 9000/425 workstation.
  544.  
  545. The following additional info is kindly supplied by Juha Makinen
  546. <Juha.Makinen@cs.Helsinki.FI>:
  547.  
  548.      Actually this program is an emulator, because it can run native
  549.      Apple Macintosh 680x0-code in Amigas. The name of this program is
  550.      an Emplant and it is a 99,9% compatible Apple Macintosh emulator.
  551.      It emulates the Machintosh (like Quadra) even faster than an
  552.      equivalent Macintosh is running with the same processor and
  553.      clock-speed. (This is due to separate graphics, I/O etc.
  554.      co-processors found on motherboard of the Amiga. Some programs
  555.      show two times better performance.)
  556.  
  557.      The program is an multi-platform -emulator and can also multitask
  558.      another emulation and/or AmigaOS on the backgroud. There is a
  559.      rival (Amax IV) for this emulation-program, but it is only 99,5%
  560.      Macintosh-compatible and is not supported as widely as this one
  561.      is. (I'm not sure which one the original author refers to, but I'm
  562.      quite sure that you can run Beta-compiler on Emplant with
  563.      Macintosh Emulation. Every program which run in original Quadra
  564.      should run on Emplant.)
  565.  
  566.      And as an addition, you can run Emplant-emulator also on the Amiga
  567.      3000 (and A2000 if you have a processor-card with MMU).
  568.  
  569. ----------------------------------------------------------------------------
  570.  
  571. Q15) Are there standards for the BETA language?
  572.  
  573. The definition of the BETA language is in the public domain. This definition
  574. is controlled by the original designers of the BETA language: Bent Bruun
  575. Kristensen, Ole Lehrmann Madsen, Birger Moller-Pedersen, and Kristen
  576. Nygaard. This means that anyone or any company may create a compiler,
  577. interpreter, or whatever having to do with BETA.
  578.  
  579. Currently, no language definition document exist. Work is in progress to
  580. write this language definition document. The definition will be given in
  581. strict natural language.
  582.  
  583. See section Q06 and L02 for information on available language descriptions
  584. and latest changes to the language.
  585.  
  586. The BETA and the Mjolner System trademarks are owned and controlled by
  587. Mjolner Informatics.
  588. ----------------------------------------------------------------------------
  589.  
  590. Q16) What is Mjolner, Sif, Valhalla, Bifrost, Yggdrasil, etc.?
  591.  
  592. Many have wondered about the origins of the strange product names used for
  593. parts of the Mjolner System. Due to the origin of the Mjolner BETA System,
  594. many of the components of the system bear Nordic names. These Nordic names
  595. originate from the Nordic Mythology, and are thus names within the common
  596. cultural background of people in the entire Nordic region:
  597.  
  598. Mjolner:
  599.      is the name of the hammer of the god Thor. According to the Mythology,
  600.      this hammer is the perfect tool that cannot fail, that grows with the
  601.      task, and always returns to the hand of Thor if he throws it at
  602.      something. Finally about the pronunciation of Mjolner. For English
  603.      speaking people, the "spelling of the pronunciation" could be:
  604.      "Myolner" or "Myulner", and for French speaking people it could be:
  605.      "Mieulnor".
  606. Yggdrasil:
  607.      is the name of the Tree of the World, the ash tree of which the crown
  608.      covers the whole world. The tree gets it power from the gods, from the
  609.      evil giants, and from the kingdom of the dead. Everything in the world
  610.      happens under the mighty crown of Yggdrasil. Yggdrasil is the name of
  611.      the metaprogramming system.
  612. Bifrost:
  613.      is the name of the luminous bridge, the rainbow, that leads from
  614.      Midgaard to Asgaard. Midgaard is the place where the human beings live,
  615.      and Asgaard is the habitat of the Gods in the middle of the world.
  616.      Bifrost is the name of the graphics system.
  617. Valhalla:
  618.      is the name of Odin's hall to where all dead warriors come when they
  619.      have fallen as heroes on the battlefield. Valhalla is the name of the
  620.      source-level debugger.
  621. Sif:
  622.      is the name of the wife of Thor. Sif is famous for her golden hair. Sif
  623.      is the name of the hyper structure editor.
  624. Freja:
  625.      is the name of the goddess of love. She lives in Folkvang and is the
  626.      most beautiful of all women in Asgaard. She owns the golden piece of
  627.      jewelry Brisingemen. Freja is the name of the CASE tool.
  628. Frigg:
  629.      is the name of the wife of Odin and queen of Asgaard. Frigg is the name
  630.      of the user interface editor.
  631. Odin:
  632.      is the name of the highest ranking god in Asgaard.
  633. Thor:
  634.      is the name of the strongest of all gods. He is the god for all
  635.      peasants. He is the son of Odin and Frigg and lives together with his
  636.      wife Sif in Trudvang on the farm Bilskirner which is the biggest house
  637.      in the world, with 540 floors.
  638.  
  639. ----------------------------------------------------------------------------
  640.  
  641. Q17) Is it possible to obtain an evaluation version of the Mjolner System?
  642.  
  643. Well, yes and no. Mjolner Informatics has previously offered a demo version
  644. of the Mjolner System for the cost of media and shipment.
  645.  
  646. Due to the introduction of the very cheap Personal Edition versions on all
  647. platforms, the demo offer has, however, been stopped. For evaluation
  648. purposes, Mjolner Informatics suggests purchase of a PE system (price
  649. currently US$ 60+VAT, media and shipment). Write info@mjolner.com for
  650. details.
  651. ----------------------------------------------------------------------------
  652.  
  653. Q18) What is the origin of the name BETA?
  654.  
  655. [Ole Lehrmann Madsen (olm@daimi.aau.dk) writes:]
  656.  
  657. Originally Beta was just one of a series of languages developed at Nordic
  658. universities.
  659.  
  660. The first object-oriented language Simula was originally designed as a
  661. simulation language but it was soon realised that the main ideas could be
  662. used for programming in general and this lead to Simula 67, which has class,
  663. subclass, virtual function coroutines, etc. It also supplied the first
  664. object-oriented framework in the form of Class Simulation which is a set of
  665. classes to support the original goal of Simula to write simulation programs.
  666.  
  667. It turned out that many users of Simula seemed to get more understanding of
  668. their problem domain by having to develop a model using Simula than of the
  669. actual simulation results.
  670.  
  671. Kristen Nygaard and others then decided to develop a successor for Simula,
  672. but with main focus of system description - not execution. This lead to a
  673. language called
  674.  
  675.      Delta
  676.  
  677. In Delta you could express true concurrent objects and use predicates to
  678. express state changes. Delta could, however, not be executed. Delta means
  679. 'participate' in Norwegian'. [E. Holbaek-Hannsen, P Haandlykken, K. Nygaard:
  680. System Description and the Delta Language. Norwegian Computing Center, Publ.
  681. no 523, 1973]
  682.  
  683. When Kristen Nygaard was a visiting professor at Aarhus University in
  684. 1973-75, a project was started to develop a programming language based on
  685. the Delta ideas. This language should be a (programming language) successor
  686. to Simula and was called
  687.  
  688.      Gamma
  689.  
  690. In the seventies, it was often assumed that a general programming language
  691. was not usable as a systems programming langauge. It was therefore decided
  692. to define a systems programming langauge which should also be used to
  693. implement Gamma. This language was called
  694.  
  695.      BETA
  696.  
  697. Finally the machine level languages were referred to as
  698.  
  699.      Alpha
  700.  
  701. Long story:-)
  702.  
  703. So what happened to Delta and Gamma?
  704.  
  705. There is a (big) report describing Delta and there has later been some
  706. related work on Delta including using it in a few projects, but it is no
  707. longer being used or developed. The language
  708.  
  709.      Epsilon
  710.  
  711. was a simplified version of Delta and the result of attempts to formalize
  712. Delta by means of Petri Nets.
  713.  
  714. The Gamma language was never developed. During the work on Beta it was soon
  715. realized that there was no need for Gamma. It turned out that by having
  716. powerful abstraction mechanisms in Beta, the Gamma-level could be handled by
  717. supplying class libraries and frameworks. You may thus think on the
  718. Gamma-level as the libraries and frameworks of the Mjolner System.
  719.  
  720. And this is where we are today.
  721.  
  722. Some of the stuff in Delta could be handled by adding constraints to BETA
  723. and supporting invariants and pre/post conditions. (The idea of invariants
  724. and pre/post conditions for classes were originally suggested by Tony Hoare
  725. for Simula. [C.A.R. Hoare: Proof of correctness of data representation, Acta
  726. Informatics, 4, 271-281, 1972]
  727.  
  728. The Mjolner System has some libraries supporting initial versions of
  729. constraints and invariants.
  730.  
  731. It has often discussed changing the name BETA - to avoid the beta-testing
  732. jokes. The suggestion for a name change is Scala - Scandinavian Language and
  733. also Scala means 'going up'... But so far it has been decided to stick with
  734. Beta.
  735. ----------------------------------------------------------------------------
  736.  
  737. Q19) How to format BETA programs in LaTeX?
  738.  
  739. The best way to format BETA programs in the LaTeX formatting system is by
  740. using the lgrind LaTeX package.
  741.  
  742. You can use the following lgrind style:
  743.  
  744. beta|the BETA programming language:\
  745.         :pb=(^\d?\p\d?\:\d?\p?\d?\(#\d?:\
  746.         :id=_:\
  747.         :bb=\d(\(#|\(if|\(for)\d:\
  748.         :be=\d(#\)|if\)|for\))\d|;:\
  749.         :oc:\
  750.         :cb=\(*:\
  751.         :ce=*\):\
  752.         :sb=':\
  753.         :se=':\
  754.         :tb=%%:\
  755.         :te=%%:\
  756.         :mb=%\$:\
  757.         :me=\$%:\
  758.         :vb=%\|:\
  759.         :ve=\|%:\
  760.         :kw=if then else for repeat\
  761.             do inner none this enter exit leave restart suspend\
  762.             and or xor mod div\
  763.             stop:
  764.  
  765. This lgrind style can be made available in two different ways:
  766.  
  767.    * Included in the among standard lgrind styles. This is done by copying
  768.      the above definition into the lgrindefs styles file, which is installed
  769.      as part of the lgrind installation (possibly in the
  770.      /usr/share/local/lib/lgrindefs file - dependent on your local setup).
  771.      This installation must be done by the local systems administrator.
  772.    * You can also copy the lgrind style onto a file in your personal file
  773.      system. Let us for further reference assume that this file is called:
  774.      $HOME/lgrind/lgrindefs.
  775.  
  776. Q19.1) How to use the BETA lgrind style
  777.  
  778. When the lgrind style is made available (as above), you can use it in the
  779. following way.
  780.  
  781. Let us assume, that you have a BETA source file called prog.bet.
  782.  
  783.    * If the lgrind style is saved among the standard lgrind styles, you
  784.      execute:
  785.  
  786.         lgrind -lbeta -i prog.bet > prog.tex
  787.  
  788.    * If the lgrind style is saved in your personal file system, you execute:
  789.  
  790.         lgrind -lbeta -d $HOME/lgrind/lgrindefs -i prog.bet > prog.tex
  791.  
  792. You are now ready to include the BETA source into a LaTeX document. You do
  793. this by inserting the following in the start of the LaTeX document:
  794.  
  795.    \usepackage{lgrind}
  796.  
  797. Please note, that you only need to insert this once.
  798.  
  799. This implies, that the lgrind LaTeX style is available. At the position in
  800. the document, where you wish the BETA source code, you just insert one of
  801. the following:
  802.  
  803.    * \lgrindfile{prog}
  804.      which will simply include the file at that point of text, and will draw
  805.      horizontal lines before and after the listing.
  806.    * \lagrind[htbp]{prog.tex}{caption}{label}
  807.      which will put the listing also within a figure environment, using the
  808.      float options, caption and label you gave.
  809.  
  810. You insert one lgridfile or lagrind command for each piece of BETA source
  811. code, you wish to include in the document.
  812. ----------------------------------------------------------------------------
  813.  
  814. PART II: Language Issues
  815.  
  816. ----------------------------------------------------------------------------
  817.  
  818. L01) What features do BETA have?
  819.  
  820. BETA replaces classes, procedures, functions, and types by a single
  821. abstraction mechanism, called the pattern. It generalizes virtual procedures
  822. to virtual patterns, streamlines linguistic notions such as nesting and
  823. block structure, and provides a unified framework for sequential, coroutine,
  824. and concurrent execution. The resulting language is smaller than Simula in
  825. spite of being considerably more expressive.
  826.  
  827. The pattern concept is the basic construct. A pattern is a description from
  828. which objects may be created. Patterns describe all aspects of objects, such
  829. as attributes and operations, as seen in traditional object-oriented
  830. languages, but also aspects such as parameters and actions, as seen in
  831. procedures.
  832.  
  833. Objects are created from the patterns. Objects may be traditional objects as
  834. found in other languages, but they may also be objects which correspond to
  835. procedure or function activations, exception occurrences, or even coroutines
  836. or concurrent processes.
  837.  
  838. Objects may be created statically or dynamically and the objects are
  839. automatically garbage collected by the runtime system when no references
  840. exist to them any longer.
  841.  
  842. Patterns may be used as superpatterns to other patterns (the subpatterns).
  843. This corresponds to traditional class hierarchies, but since patterns may
  844. describe other types of objects, inheritance is a structuring means
  845. available also for procedures, functions, exceptions, coroutines, and
  846. processes.
  847.  
  848. Patterns may be virtual. This corresponds to traditional virtual procedures
  849. but again the generality of the pattern construct implies that also classes,
  850. exceptions, coroutines, and processes may be virtual.
  851.  
  852. Virtual patterns in the form of classes are similar to generic templates in
  853. other languages. The prime difference is that the generic parameters (that
  854. is, the virtual class patterns) may be further restricted without actually
  855. instantiating the generic template. The generality of the pattern also
  856. implies that genericity is available for classes, procedures, functions,
  857. exceptions, coroutines, and processes.
  858.  
  859. Patterns may be be handled as first-order values in BETA. This implies the
  860. possibility of defining pattern variables which can be assigned pattern
  861. references dynamically at runtime. This gives the possibilities for a very
  862. dynamic handling of patterns at runtime.
  863.  
  864. You can find more introductions to the BETA language by looking at the BETA
  865. Language Tutorial.
  866. ----------------------------------------------------------------------------
  867.  
  868. L02) What changes have been made to the BETA language definition?
  869.  
  870. The BETA language definition has been stable since 1992, apart form the
  871. following minor changes:
  872.  
  873. L02.1) String Literals as References
  874.  
  875. The pattern text enters and exits a char repetition. This means, that a text
  876. may be initialized using constant strings as follows:
  877.  
  878.       t: @text;
  879.    do 'hello' -> t;
  880.  
  881. Many operations involving texts, however, takes references to texts as
  882. enter/exit parameters. This is mainly for efficiency reasons.
  883.  
  884. To allow easy invocation of such operations on string literals, the
  885. following is also allowed:
  886.  
  887.       t: ^text;
  888.    do 'hello' -> t[];
  889.  
  890. The semantics of this is, that a text object is instantiated, initialized by
  891. the constant string, and finally assigned to the text reference.
  892.  
  893. L02.2) Simple If
  894.  
  895. Often the following If statement is used:
  896.  
  897.       b: @boolean;
  898.    do (if b//TRUE then ... else ... if);
  899.  
  900. The current version of the compiler supports an extension to the BETA
  901. language called Simple If. This extension means, that the case-selector //
  902. may be omitted, if the evaluation on the left hand side exits a boolean.
  903. That is, the above may be written
  904.  
  905.       b: @boolean;
  906.    do (if b then ... else ... if);
  907.  
  908. Like in the general if-statement, the else part if optional.
  909.  
  910. L02.3) Xor Primitive
  911.  
  912. An xor primitive is supported as a basic operation on booleans. That is
  913.  
  914.       b1, b2, b3: @boolean
  915.    do b1 xor b2 -> b3
  916.  
  917. is possible.
  918.  
  919. L02.4) Short-circuit Boolean Expressions
  920.  
  921. Boolean expressions are implemented as short-circuit. That is, in
  922.  
  923.       B1 or B2
  924.  
  925. B2 is not evaluated if B1 is true, and
  926.  
  927.       B1 and B2
  928.  
  929. B2 is not evaluated if B1 is false.
  930.  
  931. L02.4) Labelled imperatives
  932.  
  933. Labelled imperatives were previously defined in the language in two forms:
  934.  
  935.    L: Imp;
  936.  
  937. and
  938.  
  939.    (L: Imp1; ...; :L)
  940.  
  941. The second form has now been removed from the language. Instead, the
  942. compiler offers the form
  943.  
  944.    L: (# do Imp1; ... #)
  945.  
  946. Note that this form is implemented very efficiently in the case where there
  947. are no declarations in the object descriptor (i.e. between (# and do).
  948. ----------------------------------------------------------------------------
  949.  
  950. L03) How do I deal with concurrency in BETA?
  951.  
  952. The processes of BETA (concurrent objects) are based on a simple
  953. fork-mechanism and semaphores. Based on these mechanisms, pattern
  954. definitions are available for shared variables in the form of monitors, and
  955. for synchronous process communication based on a port communication
  956. metaphor. The abstractions also contain facilities for utilizing future
  957. values in connection with process interactions.
  958. ----------------------------------------------------------------------------
  959.  
  960. L04) How do I deal with persistence in BETA?
  961.  
  962. The Mjolner System contains a library that implements a persistent store for
  963. BETA objects. Any BETA object can be stored into the persistent store and
  964. subsequent obtained from the store in a type-safe way. There are no
  965. requirements that the persistent objects must inherit from any specific
  966. superpattern, and persistent objects are fully type-checked both when saved
  967. in the persistent store, and when retrieved from the persistent store.
  968. ----------------------------------------------------------------------------
  969.  
  970. L05) How do I deal with distribution in BETA?
  971.  
  972. The Mjolner System contains a distributed object system in which BETA
  973. objects may reside on different hosts, and communicate transparently with
  974. each others, just as if they were residing on the same host. The objects may
  975. even be residing on different host types (e.g. on Macintosh and Unix
  976. workstations, respectively).
  977. ----------------------------------------------------------------------------
  978.  
  979. L06) How do I deal with exception handling in BETA?
  980.  
  981. Exception handling is dealt with through a predefined library containing
  982. basic exception handling facilities. The exception handling facilities are
  983. fully implemented within the standard BETA language in the form of a library
  984. pattern, and the usage is often in the form of virtual patterns, inheriting
  985. from this library pattern.
  986. ----------------------------------------------------------------------------
  987.  
  988. L07) Can classes be treated as first-order elements in BETA?
  989.  
  990. Yes, they can. This is possible by using the pattern variable construct in
  991. BETA. A pattern variable may dynamically be assigned pattern references.
  992. Pattern variables may be used to dynamically create instances of the
  993. pattern, currently contained in the pattern variable.
  994. ----------------------------------------------------------------------------
  995.  
  996. L08) What about garbage collection in BETA?
  997.  
  998. Garbage collection is conducted automatically by the BETA runtime system
  999. when it is discovered that no references to the object exist. The garbage
  1000. collection mechanism is based on generation-based scavenging. The
  1001. implemented garbage collection system is very efficient.
  1002. ----------------------------------------------------------------------------
  1003.  
  1004. L09) How do I create a "parameterized class"?
  1005.  
  1006. A parameterized class (a template in C++ or a generic class in Eiffel) is
  1007. created in BETA by using the virtual pattern mechanism. The generic
  1008. parameter is specified as a virtual attribute of the pattern, and
  1009. subpatterns of this patterns may now make further restrictions on the
  1010. generic parameter by further binding the virtual attribute. Generic
  1011. instantiation is done by either making a final binding of the virtual
  1012. attribute, or by instantiating an object directly from the pattern.
  1013. ----------------------------------------------------------------------------
  1014.  
  1015. L10) What is the difference between a virtual binding, a further binding and
  1016. a final binding (i.e. between :<, ::<, and ::)?
  1017.  
  1018. To illustrate the difference between new and further-bindings, consider
  1019.  
  1020.    p:  (# v:<  (# do ...; inner #) #);
  1021.    q: p(# v::< (# do ...        #) #);
  1022.    r: p(# v:<  (# do ...        #) #);
  1023.  
  1024. in which a pattern p with a virtual attribute v, and two subpatterns, q and
  1025. r, are declared. Pattern q further-binds p's virtual attribute, while
  1026. pattern r declares a new virtual attribute v which has no connection to p's
  1027. v, except that it happens to have the same name. [This may or may not be
  1028. what the programmer intended, so perhaps a warning should be issued in this
  1029. case.]
  1030.  
  1031. Thus, if rp is a pointer of type p, and rp happens to denote a q object,
  1032. then calling rp.v will cause q's v part to be executed in addition to p's
  1033. (because v has been further-bound in q). However, if rp denotes an r object,
  1034. then calling rp.v will cause only p's v part to be executed, not r's
  1035. (because p's v attribute has not been further-bound). [Of course, if rr
  1036. denotes a pointer of type r, then rr.v will cause r's v part to be
  1037. executed.]
  1038.  
  1039. A final binding has the same effect as a further-binding, except that it
  1040. specifies that the virtual may not be further-bound from this point on.
  1041. There are (at least) three different reasons why you might want to use final
  1042. bindings:
  1043.  
  1044.    * Modelling: Final-bindings are often considered to be a nice feature
  1045.      from a purely object-oriented modelling perspective since it indicates
  1046.      that the model is no longer extensible with respect to this attribute.
  1047.    * Efficiency: The compiler is able to generate tighter code when it is
  1048.      known that a pattern is not virtual (any longer).
  1049.    * Inheritance: It is not allowed to inherit from a virtual pattern; but
  1050.      it is ok to inherit from a final-bound one.
  1051.  
  1052. ----------------------------------------------------------------------------
  1053.  
  1054. L11) What about invariants in BETA?
  1055.  
  1056. Invariants are not an integrated part of the BETA language. However, it is
  1057. possible to create an invariant system as a framework or library, entirely
  1058. written in BETA. In the Mjolner System, an experimental invariant system is
  1059. available. The system offers class invariants as well as pre- and
  1060. post-conditions for operations. The invariant system also offers the ability
  1061. to control whether the invariants are checked or not, either on individual
  1062. object basis or system-wide.
  1063. ----------------------------------------------------------------------------
  1064.  
  1065. L12) What about change propagation in BETA?
  1066.  
  1067. Change propagation (as in Model-View-Control - MVC) is also available in
  1068. BETA (with extended facilities). Change propagation is available as an
  1069. experimental part of the current system.
  1070. ----------------------------------------------------------------------------
  1071.  
  1072. L13) What about futures in BETA?
  1073.  
  1074. Futures are used in concurrent programming to return results from a
  1075. concurrent computation, even before they have been calculated. The result
  1076. can then be passed around as any other value, and only when an attempt is
  1077. made to access it, the reader will be blocked until the result is made
  1078. available by the concurrent computation. Based on the existing BETA
  1079. facilities, futures can easily be implemented, and an experimental futures
  1080. library is available as part of the current system.
  1081. ----------------------------------------------------------------------------
  1082.  
  1083. L14) Why can variables declared in execution blocks not be accessed in
  1084. INNER?
  1085.  
  1086. Consider the following code fragment:
  1087.  
  1088.    P: (# do ...; (# x: ... do inner P #); ... #)
  1089.    PP: P(# do ... #)
  1090.  
  1091. According to the BETA visibility rules, x may not be referenced from the
  1092. do-part of PP. Why?
  1093.  
  1094. The answer lies in the fact that patterns may have more than one inner
  1095. section. Consider the following (slightly modified) example, where inners
  1096. are placed in different inserted descriptors, each containing declarations
  1097. of different sets of local variables:
  1098.  
  1099.    P: (#
  1100.       do ...;
  1101.          (# x: ... do inner P #);
  1102.          ...;
  1103.          (# y: ... do inner P #);
  1104.           ...;
  1105.       #)
  1106.    PP: P(# do ... #)
  1107.  
  1108. In this case, the do-part of PP is executed twice via inner, but with
  1109. different sets of local variables (x and y, respectively). It is therefore
  1110. meaningless to refer to any one of these in the do-part of PP.
  1111. ----------------------------------------------------------------------------
  1112.  
  1113. L15) How do I implement a copy (or clone) operation?
  1114.  
  1115. It is often useful to be able to make a genuine copy of an object. It is
  1116. currently being discussed to introduce a 'clone' operation into the object
  1117. pattern, which should take care of this copying automatically, but no
  1118. decision has been made as to how and when.
  1119.  
  1120. Until then, the following trick does the job:
  1121.  
  1122.    P: (# (* internal P structures *)
  1123.          copy:< (* generic copy operation *)
  1124.            (# copyType: ##P;
  1125.               theCopy: ^P;
  1126.            do this(P)##->copyType##;
  1127.               ©Type[]->theCopy[];
  1128.               (* insert here code to  implement the copying
  1129.                * of internal P structures into theCopy *)
  1130.               INNER copy;
  1131.               (* possible finalization of the copying process *)
  1132.            exit theCopy[]
  1133.            #)
  1134.       #);
  1135.  
  1136.    Q: P(# (* internal Q structures *)
  1137.           copy::<
  1138.             (# Qcopy: ^Q
  1139.             do theCopy[]->Qcopy[];
  1140.               (* insert here code to  implement the copying
  1141.                * of internal Q structures into Qcopy *)
  1142.               INNER copy;
  1143.               (* possible finalization of the Q copying process *)
  1144.             #)
  1145.        #);
  1146.  
  1147.    R: Q(# (* internal R structures *)
  1148.           copy::<
  1149.             (# Rcopy: ^R
  1150.             do theCopy[]->Rcopy[];
  1151.               (* insert here code to  implement the copying
  1152.                * of internal R structures into Rcopy *)
  1153.               INNER copy;
  1154.               (* possible finalization of the R copying process *)
  1155.             #)
  1156.        #);
  1157.  
  1158. Given the declarations
  1159.  
  1160.    a: @R;
  1161.    aCopy: ^R;
  1162.  
  1163. then
  1164.  
  1165.    a.copy->aCopy[]
  1166.  
  1167. will make a copy of the a object with the proper qualification (here R), and
  1168. a state that is a copy of the state of a.
  1169.  
  1170. Note: The
  1171.  
  1172.       Rcopy: ^R
  1173.    do theCopy[]->Rcopy[]
  1174.  
  1175. part of the copy further binding is an inconvenience, but is necessary to
  1176. persuade the type system to allow remote access to the R-parts of the
  1177. theCopy object.
  1178. ----------------------------------------------------------------------------
  1179.  
  1180. L16) Why doesn't BETA have multiple inheritance?
  1181.  
  1182. [Ole Lehrmann Madsen (olm@daimi.aau.dk) writes:]
  1183.  
  1184. I shall try to explain why there is no (traditional) multiple inheritance in
  1185. BETA. Please note that I am not trying to argue against MI. The following is
  1186. only an attempt to explain why it is not in BETA.
  1187.  
  1188. When BETA was designed we did not think that the concept of multiple
  1189. inheritance was ready for being incorporated in the language. One of the
  1190. main design goals for BETA was that it should be good for modelling. Most
  1191. usages of MI seemed to be for pure code reuse, i.e. a new class may be
  1192. defined by inheriting from a number of classes and then redefining the parts
  1193. that should differ. Often this is done without there being any conceptual
  1194. relation between the new class and the ones it inherits from. We did not
  1195. like that way of using inheritance.
  1196.  
  1197. MI in BETA should be there to model classification hierarchies which are
  1198. non-tree structured. In my experience, such hierarchies are rare in
  1199. practice. What is more common is that you may want several independent
  1200. tree-structured classification hierarchies for the same objects. A set of
  1201. person objects might be classified according to their profession,
  1202. nationality, and religion. This gives three class-hierarchies. People often
  1203. handle such situation using MI, but this will merge the hierarchies in a way
  1204. that makes it difficult to identify the three original ones.
  1205.  
  1206. We would like to support such independent classification hierarchies in
  1207. BETA, but no concrete proposal exists.
  1208.  
  1209. The various proposals for solving name conflicts and overlapping
  1210. superclasses also seemed rather complex. We did not want the semantics of
  1211. basic constructs to be complicated to understand.
  1212.  
  1213. For BETA there are a number of additional problems:
  1214.  
  1215.    * Virtual patterns from a common superclass may have conflicting bindings
  1216.      in the superclasses:
  1217.  
  1218.         A: (# V:< A1; ... do ... inner ... #);
  1219.         B: A(# V::< A2; ... do ... inner ... #);
  1220.         C: A(# V::< A3; ... do ... inner ... #);
  1221.         D: B & C (# V:: A4; ... do ... #);
  1222.  
  1223.      (The syntax B & C has tentatively been used for MI in BETA.)
  1224.  
  1225.      Here A2 and A3 must both be subclasses of A1, and A4 must be a subclass
  1226.      of both A2 and A3. (In her Ph.D. Thesis, Kristine Thomsen defined a
  1227.      language along these lines, which handled virtual bindings a la those
  1228.      in BETA. It should be available from the Computer Science Department,
  1229.      Aarhus University.)
  1230.  
  1231.    * The semantics for combining inners of multiple superclasses must also
  1232.      be defined. In the example above, should B's do-part be executed before
  1233.      C's or vice versa? Since we are not in favour of making the order of
  1234.      superclasses significant, we were considering letting the execution
  1235.      order of B and C be non-deterministic, in the sense that the
  1236.      implementation may execute B or C in any order. (Thomsen's thesis also
  1237.      deals with combing inners and proposes a number of other alternatives.
  1238.      You may also want to take a look at: K. S. Thomsen: "Inheritance on
  1239.      Processes, Exemplified on Distributed Termination Detection",
  1240.      International Journal of Parallel Programming, pages 24-37, November
  1241.      1988.)
  1242.  
  1243. Finally, we have not felt an strong need to support MI in the traditional
  1244. sense, since BETA has other means for handling some of the most common MI
  1245. cases:
  1246.  
  1247. In BETA you may inherit from part-objects and at the same time further-bind
  1248. its virtuals:
  1249.  
  1250.    A: (# f:< ... #);
  1251.    B: (# g:< ... #);
  1252.    C: (# ...
  1253.          X: @A(# f::< (# ... #); ... #);
  1254.          Y: @B(# g::< (# ... #); ... #);
  1255.          ...
  1256.       #);
  1257.  
  1258. X and Y are singular part-objects; due to BETA's block structure the virtual
  1259. bindings of f and g may refer to variables in the enclosing C-object.
  1260.  
  1261. Given the declaration W: ^C, the functions f and g may be invoked as W.X.f
  1262. and W.Y.g. The difference from MI is that you have to qualify using X and Y.
  1263. Some people think of this as an inconvenience; others think of it as an
  1264. advantage since it forces them to be explicit about name conflicts between A
  1265. and B. If you prefer writing W.f and W.g, you may define f and g functions
  1266. in C and let them forward the calls to X.f and Y.g.
  1267.  
  1268. Given the declaration V: ^A, then W.X[]->V[] is possible, and an invocation
  1269. of V.f calls the further-binding of f in X, thereby possibly
  1270. accessing/changing the state of C.
  1271.  
  1272. To sum up, this form of multiple inheritance via part objects is very
  1273. similar to non-overlapping inheritance in C++.
  1274.  
  1275. As a final example, consider the following well-known MI case:
  1276.  
  1277.                   Window
  1278.                  /      \
  1279.    WindowWithBorder    WindowWithTitle
  1280.                  \      /
  1281.          WindowWithBorderAndTitle
  1282.  
  1283. In BETA this may be handled using block-structure
  1284.  
  1285.    Window:
  1286.      (# ...
  1287.         Border: (# ... #);
  1288.         Title: (# ... #);
  1289.      #);
  1290.    W1: @Window(# B: @Border; T: @Title #);
  1291.    W2: @Window(# T1,T2: @Title #);
  1292.  
  1293. Here W1 has a border and a title, whereas W2 has no border and two titles.
  1294. (For a further discussion, see K. Osterby: "Parts, Wholes, and Subclasses",
  1295. Proceedings of the 1990 European Simulation Multiconference, pages 259-263,
  1296. 1990.)
  1297.  
  1298. To sum up, we did not think that traditional MI has been worth the
  1299. complications it will add to the language, since many of the MI cases can be
  1300. handled by other means. We are, however, still discussing MI, and it may end
  1301. up being supported more directly.
  1302. ----------------------------------------------------------------------------
  1303.  
  1304. L17) What is the rationale behind the syntax of BETA?
  1305.  
  1306. [Ole Lehrmann Madsen (olm@daimi.aau.dk) writes:]
  1307.  
  1308. When we designed BETA, we spent a lot of time discussing syntax - it is one
  1309. of those things people can really disagree about. We tried to develop what
  1310. we considered to be a nice and readable syntax with as few long keywords as
  1311. possible.
  1312.  
  1313. The following type of brackets are used:
  1314.  
  1315.      (# ... #)     object
  1316.      (* ... *)     comment
  1317.     (if ... if)    if-imperative
  1318.    (for ... for)   for-imperative
  1319.  
  1320. We did consider using { and } for objects or comments, but ended up not
  1321. doing it; we did not feel a strong need to have BETA look like C.
  1322.  
  1323. As we did not like long keywords (as in Pascal or Ada), BETA uses symbols
  1324. like @, ^, |, and :< instead. We believe that for a small language like
  1325. BETA, it is an advantage to have a compact syntax. This way, you can have
  1326. more code on a page or in a window. (Of course, {,} is shorter than (#,#),
  1327. but we preferred the syntax to be consistent with (if,if), etc.)
  1328.  
  1329. It is not our experience that the syntax of BETA presents any obstacle to
  1330. learning the language. BETA has very few constructs (and symbols), and while
  1331. they may seem strange at first, they are easy to learn and use. Try it!
  1332.  
  1333. You can find a quick overview of the BETA syntax by looking at the BETA
  1334. Quick Reference Card
  1335. ----------------------------------------------------------------------------
  1336.  
  1337. L18) How do the scope rules of BETA actually work?
  1338.  
  1339. The BETA scope rules may seem slightly complex to the new BETA programmer,
  1340. but are actually rather intuitive and simple. There are three visibility
  1341. rules:
  1342.  
  1343.   1. Names declared in the descriptor itself are visible within the
  1344.      descriptor.
  1345.   2. Names declared in the superpattern of a descriptor are visible within
  1346.      the descriptor.
  1347.   3. Names declared in outer blocks (i.e. enclosing descriptors) are visible
  1348.      within the descriptor.
  1349.  
  1350. These rules are applied in order to find the definition for a given name
  1351. application:
  1352.  
  1353.    * Start by using rule 1, looking for a local declaration.
  1354.    * If not found, then use rule 2 to find the declaration in the
  1355.      superpattern (if the descriptor has one). While using this rule, you
  1356.      may apply rule 1.
  1357.    * If still not found, then use rule 3 to find the declaration in the
  1358.      enclosing descriptors. While using this rule, you may apply rule 1 and
  1359.      2.
  1360.  
  1361. Note: This method implies that it is possible to reuse the same name for
  1362. different declarations, as long as the declarations are in different
  1363. descriptors.
  1364.  
  1365. To see how the rules interact, take a look at the example program below. It
  1366. illustrates most of the combinations, and has the resulting output is shown
  1367. in comments after each imperative.
  1368.  
  1369.    (# a: (# do 1->screen.putint #);
  1370.       P1: (# do a; INNER P1 #);
  1371.       P2: (# a: (# do 2->screen.putint #);
  1372.           do a
  1373.           #);
  1374.       P3: P1(# do a #);
  1375.       P4: P1(# a: (# do 3->screen.putint #);
  1376.           do a
  1377.           #);
  1378.       P5: P1(# foo1: (# do a; inner foo1 #);
  1379.                foo2: (# a: (# do 4->screen.putint #)
  1380.                      do a; inner foo2
  1381.                      #);
  1382.             #);
  1383.       P6: P5(# a: (# do 5->screen.putint #);
  1384.                foo3: (# do a; inner foo3 #);
  1385.                foo4: foo1(# do a; inner foo4 #);
  1386.                foo5: foo2(# do a; inner foo5 #);
  1387.             #);
  1388.       P: @P6;
  1389.    do
  1390.       a;                (*   1 *)
  1391.       P1;               (*   1 *)
  1392.       P2;               (*   2 *)
  1393.       P3;               (*  11 *)
  1394.       P4;               (*  13 *)
  1395.       P5;               (*   1 *)
  1396.       P6;               (*   1 *)
  1397.  
  1398.       P.foo1;           (*   1 *)
  1399.       P.foo2;           (*   4 *)
  1400.       P.foo3;           (*   5 *)
  1401.       P.foo4;           (*  15 *)
  1402.       P.foo5;           (*  44 *)
  1403.  
  1404.       P.foo1(# do a #); (*  11 *)
  1405.       P.foo2(# do a #); (*  44 *)
  1406.       P.foo3(# do a #); (*  51 *)
  1407.       P.foo4(# do a #); (* 151 *)
  1408.       P.foo5(# do a #); (* 444 *)
  1409.    #)
  1410.  
  1411. ----------------------------------------------------------------------------
  1412.  
  1413. L19) What is a pattern?
  1414.  
  1415. The following is an attempt to explain the pattern concept. The description
  1416. is divided into two parts: a description in the form of examples, and a more
  1417. abstract explanation.
  1418.  
  1419. To begin with, think of a pattern as a generic word for the concepts class,
  1420. procedure and function. This is not all there is to it, but it will get you
  1421. started. In BETA, a pattern is anything starting with (# and ending with #).
  1422. As a simple example, here is a function that multiplies two numbers:
  1423.  
  1424.    multiply: (# a,b: @integer;
  1425.              enter (a,b)
  1426.              exit a*b
  1427.              #);
  1428.  
  1429. The multiply pattern takes two integers, a and b, and returns their product.
  1430. These kinds of patterns are often called functional patterns, since their
  1431. use correspond to functions (or procedures) in other languages. In BETA, a
  1432. call to multiply might look like:
  1433.  
  1434.    (7,17)->&multiply->&putInt;
  1435.  
  1436. putInt is a procedure that writes the result on the screen.
  1437.  
  1438. As another example, let's build a stack class in the typical object-oriented
  1439. paradigm:
  1440.  
  1441.    stack: (# content: [100] @integer;
  1442.              currentSize: @integer;
  1443.              push: (# e: @integer;
  1444.                    enter e
  1445.                    do currentSize+1->currentSize;
  1446.                       e->content[currentSize];
  1447.                    #);
  1448.              empty: (# exit (currentSize=0) #);
  1449.              pop: (# e: @integer;
  1450.                   do content[currentSize]->e;
  1451.                      currentSize-1->currentSize;
  1452.                   exit e
  1453.                   #);
  1454.           #);
  1455.  
  1456. Now, stack is also just a pattern. You may call it a class pattern since its
  1457. meant to be used as a class: to make instances, the actual stacks. And just
  1458. in case you were wondering: Yes, the push, empty, and pop methods defined
  1459. for stack are also patterns (functional/procedural patterns), defined inside
  1460. the stack pattern.
  1461.  
  1462. BETA offers a lot of extra functionality which could make the example much
  1463. more realistic (information hiding, generic stacks, exceptions due to
  1464. overflow, dynamic expansion of the stack capacity, etc.), but let's keep the
  1465. example simple.
  1466.  
  1467. Having shown a few practical examples, here's the more elaborate
  1468. explanation:
  1469.  
  1470. A pattern is used for instantiating objects (static objects, dynamic
  1471. objects, inserted objects, etc.). A pattern declaration in its full form
  1472. looks like this (other forms below):
  1473.  
  1474.    P: S(# decl1; decl2; ... decln;
  1475.        enter enterlist
  1476.        do imperatives
  1477.        exit exitlist
  1478.        #);
  1479.  
  1480. This declares P as a (direct) subpattern of S. (S thus is the (direct)
  1481. superpattern of P.) S may be omitted, in which case object (the direct or
  1482. indirect superpattern of all patterns) is assumed. Each part (declarations,
  1483. enter part, do part and exit part) can be omitted. (Thus "P: (# #);" is
  1484. legal.)
  1485.  
  1486. Each declaration can be a declaration of a pattern, a virtual pattern, a
  1487. further or final binding of a previously declared virtual pattern, a static
  1488. item, a dynamic item, a static component, a dynamic component, a repetition
  1489. (array) or a pattern variable (used for holding a pattern, popularly
  1490. speaking). Or a number of same.
  1491.  
  1492. Thus the above declaration of P fits into an outer pattern. If both P and S
  1493. have declared enter parts, the enter list of a P object consists of the
  1494. enter lists concatenated. The same goes for the exit list. Thus the
  1495. subpattern declaration can only add to the enter and exit lists, not make
  1496. other changes. A bit more complicated rules exist for do-parts, but the
  1497. basic principle is the same: only additions are possible.
  1498.  
  1499. A pattern can be virtual. There are three forms of virtual pattern
  1500. declarations:
  1501.  
  1502.    P: (# V:< Q; #);
  1503.    P: (# V:< Q(# ... #); #);
  1504.    P: (# V:< (# ... #); #);
  1505.  
  1506. where Q is a pattern name.
  1507.  
  1508. (For the sake of completeness, this should perhaps be written as
  1509.  
  1510.    P: S(# ...; V:< Q; ...; enter ... do ... exit ... #);
  1511.    P: S(# ...; V:< R(# ...; enter ... do ... exit ... #); ...;
  1512.        enter ... do ... exit ...
  1513.        #);
  1514.  
  1515. etc., but we'll leave the that out.)
  1516.  
  1517. Virtual declarations can be extended, or further bound, in subpatterns:
  1518.  
  1519.    P1: P(# V::< Q1; #);
  1520.    P1: P(# V::< Q1(# ... #); #);
  1521.    P1: P(# V::< (# ... #); #);
  1522.  
  1523. In the first two forms, it is required that one of the following two
  1524. conditions holds:
  1525.  
  1526.   1. V was declared in P (or some superpattern of P) as V:< Q, and Q1 is a
  1527.      direct or indirect subpattern of Q.
  1528.   2. V was already further bound in P (or some superpattern of P) using the
  1529.      form V::< Q0, and Q1 is a direct or indirect subpattern of Q0.
  1530.  
  1531. The third form V::< (# ... #) can be used regardless of which form was used
  1532. for the previous declaration or further binding of V. In this case, the
  1533. descriptor (# ... #) is used to automatically form a subpattern. (This form
  1534. of further binding is the only available one if V is declared using V:< (#
  1535. ... #), or V has been further bound using V::< Q1(# ... #) or V::< (# ...
  1536. #).)
  1537.  
  1538. Thus, the further binding makes V a subpattern of what it was before.
  1539.  
  1540. Finally, a virtual pattern may be final bound. A final binding is a further
  1541. binding, except (syntactically) :: is used instead of ::<, and
  1542. (semantically) after a final binding, V is no longer virtual, and can
  1543. therefore not be further bound. The final binding must otherwise follow the
  1544. same rules as described above for further bindings.
  1545.  
  1546. Also, see Question L10.
  1547. ----------------------------------------------------------------------------
  1548.  
  1549. L20) Are identifiers and keyworks case-sensitive in BETA?
  1550.  
  1551. Neither identifiers nor keywords of the BETA language are case-sensitive.
  1552. That is, the identifier hello is the same as the identifier HELlo, and the
  1553. keyword INNER is the same as the keywork inner. However, there is one
  1554. exception from this rule. Identifiers used for declaring Externals are
  1555. case-sensitive (due to identifiers in the C programming language being
  1556. case-sensitible). Please refer to the Compiler Manual for details.
  1557. ----------------------------------------------------------------------------
  1558.  
  1559. L21) What characters are allowed in BETA identifiers?
  1560.  
  1561. The identifiers in the BETA language must obey the following literal syntax:
  1562.  
  1563.      A BETA indentifier has to start with a letter or '_', and may be
  1564.      followed by a sequence of letters, digits, and '_'.
  1565.  
  1566. ----------------------------------------------------------------------------
  1567.  
  1568. L22) What is the exact semantics of leave P and restart P, when P is the
  1569. name of a pattern?
  1570.  
  1571. Leave and restart are the very basic local control mechanisms in BETA. Leave
  1572. and restart are specified by:
  1573.  
  1574.      restart id
  1575.      and
  1576.      leave id
  1577.  
  1578. where id is the name of either a label or an enclosing pattern. When id is
  1579. an enclosing pattern, id is defined to refer to the do-part of id (hence not
  1580. to the do-part of any superpattern of id).
  1581.  
  1582. Consider the pattern:
  1583.  
  1584.    P: A(# ...
  1585.        do (* L1 *)
  1586.           ...;
  1587.           leave/restart P;
  1588.           ...;
  1589.           (* L2 *)
  1590.        #)
  1591.  
  1592. restart P implies that execution continues at (* L1 *):
  1593.  
  1594.      This means that restart P has the effect of entering the do-part
  1595.      of P as after an inner in A.
  1596.  
  1597. leave P implies that execution continues at (* L2 *):
  1598.  
  1599.      This means that leave P has the effect that execution continues in
  1600.      the do-part of A after the inner that called the main-do-part of
  1601.      P.
  1602.  
  1603. Example:
  1604.  
  1605.    (# A: (#
  1606.          do (for 4 repeat '['->put; INNER; ']'->put for)
  1607.          #);
  1608.       P: A (# k: @integer
  1609.            do k+1->k->putInt;
  1610.               (if k=2 then '-'->put; leave P if);
  1611.               (if k=3 then '*'->put; restart P if);
  1612.               '+'->put
  1613.            #);
  1614.    do P
  1615.    #)
  1616.  
  1617. will give the following output:
  1618.  
  1619.    [1+][2-][3*4+][5+]
  1620.  
  1621. ----------------------------------------------------------------------------
  1622.  
  1623. L23) What is the BETA lexem syntax?
  1624.  
  1625. The different lexems in the BETA language grammar (names, strings, and
  1626. numbers) are not precisely defined in any of the available documents. We
  1627. will therefore here give the definition:
  1628.  
  1629. <NameAppl> =    <NameDecl>
  1630. <NameDecl> =    (<letter>|"_")+(<digit>|<letter>|"_")*
  1631.  
  1632. <String>   =    "'"<char>*"'"
  1633.            where <char> can be any char except "'" and newline.
  1634.                         "'" are allowed in <String>, iff preceeded with "\".
  1635.                         "\n", "\t", etc. are allowed in <String> to
  1636.                         represent non-printable chars - see Compiler
  1637.                         manual (mia91-02) for details.
  1638.  
  1639. <Const>   =     (<int>|<based>|<real>) where
  1640.         <int>      = <digit>+
  1641.         <based>    = <int>("X"|"x")<basedNum>
  1642.         <basedNum> = (<digit>|<letter>)+
  1643.         <real>     = <int>["."<int>][("E"|"e")[("+"|"-")]<int>]
  1644.  
  1645. <letter>  =     "a"|"b"|...|"z"|"A"|"B"|...|"Z"
  1646. <digit>   =     "1"|"2"|...|"9"|"0"
  1647.  
  1648. The usage of |, +, *, (...), and [...] conform to standard regular
  1649. expressions syntax.
  1650. ----------------------------------------------------------------------------
  1651.  
  1652. L24) What is the maximum length of a BETA identifier?
  1653.  
  1654. For most practical cases there is no maximum lenghth of a name. The length
  1655. of an name is currently limited by the representation of an abstract syntax
  1656. tree (AST). There is currently a limitation to the size of an AST. In the
  1657. AST representation, a 16-bit integer is used to represent the length of a
  1658. name. A name can thus in theory consist of more than 65000 characters.
  1659. However, it is much more likely that a BETA fragment breaks the limit of an
  1660. AST than an identifier becomes too large.
  1661. ----------------------------------------------------------------------------
  1662.  
  1663. L25) What is the exact qualification rules for nested patterns?
  1664.  
  1665. In Chapter 8 on Block Structure in the BETA book it is (in section 8.2) said
  1666. that patterns like Pascal.Symbol and Simula.Symbol are different. The
  1667. corresponding declarations are as follows
  1668.  
  1669.         Grammar: (# ...; Symbol: (# ... #); ... #);
  1670.         Pascal: @Grammar;
  1671.         Simula: @Grammar;
  1672.  
  1673. The current implementation does, however, not consider nested patterns like
  1674. Pascal.Symbol and Simula.Symbol to be different. The reason for this is
  1675. historical.
  1676.  
  1677. Qualification check was implemented in two stages. First the compile-time
  1678. checks were implemented, and next the run-time checks. The qualification
  1679. rules for run-time checking were implemented such that nested pattern like
  1680. Pascal.Symbol and Simula.Symbol are identical.
  1681.  
  1682. This is a relaxation of the proper run-time qualification rule (as defined
  1683. by the BETA language), and a future release of the MBS will properly
  1684. implement run-time qualification check.
  1685. ----------------------------------------------------------------------------
  1686.  
  1687. PART III: Environment Issues
  1688.  
  1689. ----------------------------------------------------------------------------
  1690.  
  1691. E01) What is the Mjolner System?
  1692.  
  1693. The Mjolner System is an integrated and interactive general-purpose software
  1694. development environment that supports industrial strength programming using
  1695. object-oriented programming in the BETA programming language.
  1696. (Note: "Mjolner System" was formerly designated "Mjolner BETA system".)
  1697. ----------------------------------------------------------------------------
  1698.  
  1699. E02) What does the Mjolner System contain?
  1700.  
  1701. The Mjolner System includes an implementation of the BETA language, a series
  1702. of libraries and application frameworks, a set of development tools, and a
  1703. metaprogramming system. All components of the Mjolner System are constructed
  1704. using the BETA language.
  1705.  
  1706. Major parts of the Mjolner System (e.g. the editor, parser, pretty-printer,
  1707. metaprogramming system, fragment system) are grammar-based in the sense that
  1708. tool generators exist that, given a specific grammar for a language, will
  1709. define a specific tool that is able to manipulate programs written in that
  1710. particular language.
  1711. ----------------------------------------------------------------------------
  1712.  
  1713. E03) What libraries come with the Mjolner System?
  1714.  
  1715. Basic libraries
  1716.      The basic patterns are the object-oriented variants of the standard
  1717.      simple data types, such as char, boolean, integer, and real. These
  1718.      patterns make it possible to treat e.g. integers as ordinary objects.
  1719.      The basic patterns also includes the Object pattern which is the
  1720.      implicit superpattern for all patterns that have no explicit
  1721.      superpattern.
  1722.      See the Basic Libraries Manual for more details.
  1723.  
  1724. The Stream Patterns
  1725.      A Stream is a generalization of internal and external text objects. An
  1726.      internal text object (Text) is a sequence (repetition) of chars. An
  1727.      external text object (File) corresponds to a traditional text file.
  1728.      Stream, Text, and File are organized in the following hierarchy:
  1729.  
  1730.         Stream: (# ... #);
  1731.           Text: Stream(# ... #);
  1732.           File: Stream(# ... #);
  1733.             UnixFile: File(# ... #);
  1734.             MacFile: File(# ... #);
  1735.  
  1736.      As part of the interface to the operating system, the basic libraries
  1737.      include patterns for accessing the directory structures of hierarchical
  1738.      file systems:
  1739.  
  1740.         Directory: (# ... #);
  1741.           UnixDirectory: Directory(# ... #);
  1742.           MacDirectory: Directory(# ... #);
  1743.  
  1744.      See the Basic Libraries Manual p12 for more details.
  1745.  
  1746. The Process Patterns
  1747.      The Process interface facilitates execution of subprocesses,
  1748.      communication between several independent processes, client/server
  1749.      architectures, and it is even possible to establish communication
  1750.      between Unix, PC and Macintosh processes.
  1751.      See the Process Libraries Manual for more details.
  1752.  
  1753. The External Language Interface Patterns
  1754.      To enable interfacing with external languages (such as C), the basic
  1755.      libraries define the external, cStruct, and externalRecord patterns.
  1756.      See the Basic Libraries Manual p18 for more details.
  1757.  
  1758. Container libraries
  1759.      The standard container data structures are organized in the following
  1760.      inheritance hierarchy of patterns:
  1761.  
  1762.                               container
  1763.                   _________________|__________________________
  1764.                   |             |             |              |
  1765.               collection arrayContainer sequentialContainer list
  1766.             ______|_______         ___________|_______________
  1767.             |            |         |       |       |         |
  1768.          multiset    hashTable   stack   queue   deque  prioQueue
  1769.             |            |
  1770.            set   extensibleHashTable
  1771.           __|_____________________
  1772.           |                      |
  1773.      classificationSet   classificationSubSet
  1774.  
  1775.      Container patterns are generic patterns in the sense that the element
  1776.      type of the elements kept in the container can vary between different
  1777.      container instances.
  1778.      See the Container Libraries Manual for more details.
  1779.  
  1780. Persistent store:
  1781.      Support for saving any kind of object generated by a BETA program
  1782.      execution on secondary storage and restoring them in another BETA
  1783.      program execution. The persistent store is fully type safe. An
  1784.      object-oriented database for BETA objects is currently under
  1785.      development.
  1786.      See the Persistence in BETA Manual for more details.
  1787.  
  1788. Metaprogramming system libraries:
  1789.      A metaprogram is a program that manipulates other programs. Yggdrasil
  1790.      is a metaprogramming system that supports creation of metaprograms.
  1791.      Yggdrasil is grammar-based: a metaprogramming environment may be
  1792.      generated from the grammar of any language. The metaprograms manipulate
  1793.      programs through a common representation called abstract syntax trees
  1794.      (ASTs). An AST is modelled as an instance of a pattern. There is a
  1795.      pattern corresponding to each syntactic category (non-terminal) of the
  1796.      grammar. The grammar hierarchy is modelled by a corresponding pattern
  1797.      hierarchy, derived automatically from the grammar.
  1798.      See the Metaprogramming Manual for more details.
  1799.  
  1800. ----------------------------------------------------------------------------
  1801.  
  1802. E04) What frameworks come with the Mjolner System?
  1803.  
  1804. Concurrency framework
  1805.      The basic libraries define various patterns for dealing with
  1806.      concurrency, synchronization, and communication. These patterns are:
  1807.      system, semaphore, fork, monitor, port, restrictedPort, objectPort,
  1808.      qualifiedPort, conc, and alt.
  1809. Graphical User Interface framework
  1810.      The Mjolner System contains from release 4.0 a platform independent
  1811.      framework for the construction of graphical user interfaces, called
  1812.      guienv..
  1813. X Window System framework
  1814.      The Mjolner BETA object-oriented interface to the X Toolkit Intrinsics
  1815.      (Xt) is called XtEnv. This pattern contains the basic patterns common
  1816.      for many user-interface toolkits built upon the X Window System, but it
  1817.      does not contain any higher-level user interface elements. It is
  1818.      typically used together with a widget set containing such user
  1819.      interface elements built on top of it. Examples of such widget sets are
  1820.      the Athena Widgets, OPEN LOOK, and Motif. The Mjolner System currently
  1821.      includes object-oriented interfaces to the Athena Widgets (AwEnv) and
  1822.      to Motif (MotifEnv).
  1823. Bifrost graphics framework
  1824.      The interactive object-oriented graphics system Bifrost is based on the
  1825.      Stencil & Paint imaging model. Bifrost models computer graphics images
  1826.      by abstracting the geometric and color properties of graphical objects.
  1827.      The important new concept introduced in Bifrost is that there is one
  1828.      basic drawing primitive, the graphical object. The graphical object
  1829.      unites interaction, graphics modelling, and graphics context. Bifrost
  1830.      includes extensive support for various kinds of interaction:
  1831.      interactive creation, reshaping, translation, scaling, and rotation of
  1832.      graphical objects. The object-oriented approach makes extensibility and
  1833.      tailorability a simple task, and facilitates object-oriented drawing
  1834.      applications. One of the main goals of the development of Bifrost was
  1835.      to make the graphics system independent of underlying graphics and
  1836.      hardware systems.
  1837. Distribution framework
  1838.      A distributed object system is available for enabling transparent
  1839.      access to BETA objects located on different hosts on the network.
  1840. OODB framework
  1841.      A distributed object-oriented database system for BETA objects is
  1842.      currently being developed.
  1843.  
  1844. ----------------------------------------------------------------------------
  1845.  
  1846. E05) What tools come with the Mjolner System?
  1847.  
  1848. BETA Compiler
  1849.      The BETA compiler is a native code generation compiler.
  1850. Fragment System
  1851.      The fragment system is used for splitting BETA programs into smaller
  1852.      pieces (fragments). The fragment system is responsible for the
  1853.      dependencies between different fragment files, defining a given library
  1854.      or program. Due to the generality of the fragment system, a BETA
  1855.      program can be divided into smaller pieces in many different ways.
  1856. Source Browser
  1857.      The different tools in the Mjolner System uses the same source browser.
  1858.      This source browser gives easy access to the file system, and gives
  1859.      facilities for browsing in the entire set of source files, belonging to
  1860.      a given program (the dependency graph of the program).
  1861. Source-level Debugger
  1862.      A source-level debugger for the BETA language is available on all
  1863.      platform (except Macintosh and HP-PA). It contains facilities for
  1864.      specifying break-points, single stepping, inspection of object states,
  1865.      inspecting the run-time organization, etc. The debugger has a graphical
  1866.      interface.
  1867. Hyper Structure Editor
  1868.      The Mjolner BETA Hyper Structure Editor has the following properties:
  1869.      Syntax-directed Editing
  1870.           Syntax-directed editing makes it possible to construct and edit
  1871.           programs or other documents without introducing syntax errors.
  1872.           Syntax-directed editing is especially useful for
  1873.           application-oriented languages intended for end-users, casual
  1874.           users and beginners that may have difficulties in remembering the
  1875.           concrete syntax.
  1876.      Abstract Presentation and Browsing
  1877.           The editor is able to present a program at any level of detail. At
  1878.           the top-level of a program the user may get an overview of classes
  1879.           and procedures. It is then possible to browse through modules and
  1880.           procedures to see more and more details.
  1881.      Adaptive Pretty-Printing
  1882.           The editor includes an adaptive pretty-printing algorithm which
  1883.           prints the program or document such that it always fits within the
  1884.           size of the window or paper.
  1885.      Text Editing and Incremental Parsing
  1886.           The programmer may freely alternate between syntax-directed
  1887.           editing and textual editing. Any program part may be textually
  1888.           edited using keyboard, mouse, and menus in the usual style known
  1889.           from the Macintosh or the X Window System, respectively. Any
  1890.           program part that has been textually edited is immediately parsed.
  1891.      Fragment Manipulation and Browsing
  1892.           The editor provides an interface to the fragment system. It is
  1893.           possible to browse through the fragment structure and to create
  1894.           and combine fragments.
  1895.      Integration of Program and Documentation
  1896.           The user may add a comment at any place in a program. The user
  1897.           decides whether or not to display a comment. Also the user decides
  1898.           whether to display a comment as part of the program or in another
  1899.           window; in the latter case a comment is indicated by means of (*).
  1900.           Using abstract presentation it is possible to obtain a
  1901.           pretty-print of a program which includes just the classes and
  1902.           procedure headings and corresponding comments. This makes it
  1903.           possible to extract a functional specification from the program.
  1904.      Hypertext Facilities
  1905.           The editor includes hypertext facilities. The facility for
  1906.           handling comments is an example of a hyperlink between a program
  1907.           and a text document. Another type of hyperlink is a link from the
  1908.           use of a name to the declaration of the name (this is only
  1909.           implemented for BETA).
  1910. Object-oriented CASE Tool
  1911.      The Mjolner BETA CASE Tool provides
  1912.         o graphical structure editing of design diagrams
  1913.         o textual structure editing of programs
  1914.         o automatic program generation from design diagrams
  1915.         o reverse engineering from programs to design diagrams
  1916.         o simultaneous editing of design diagrams and programs
  1917.      No CASE gap:
  1918.         o A single abstract language is used throughout analysis, design,
  1919.           and implementation.
  1920.         o Different concrete syntaxes are used to present the different
  1921.           models:
  1922.              + graphical syntax for design
  1923.              + textual syntax for programs
  1924. User Interface Editor
  1925.      The graphical user interface editor gives a direct manipulation editor
  1926.      for the user interface of an application. The user interface editor is
  1927.      integrated with the structure editor, enabling both graphical,
  1928.      structured and textual editing of the user interface of the program.
  1929. Metaprogramming tools
  1930.      Supplementing the metaprogramming libraries, there is a number of
  1931.      grammar-based tools as part of the metaprogramming system, such as
  1932.      compiler-compiler, parser, pretty-printer, and the hyper structure
  1933.      editor. Being grammar-based, it is possible to customize them all
  1934.      towards specific grammars.
  1935.  
  1936. ----------------------------------------------------------------------------
  1937.  
  1938. E06) Does a beta-mode for Emacs exist?
  1939.  
  1940. Yes, an Emacs mode for editing BETA programs is part of the Mjolner System.
  1941. This beta-mode is in the public domain and can be obtained by FTP at
  1942. ftp://ftp.daimi.aau.dk/pub/beta/emacs.
  1943. ----------------------------------------------------------------------------
  1944.  
  1945. PART IV: Specific Issues
  1946.  
  1947. ----------------------------------------------------------------------------
  1948.  
  1949. SECTION I: The Fragment System
  1950.  
  1951. ----------------------------------------------------------------------------
  1952.  
  1953. F01) What is the purpose of the fragment system?
  1954.  
  1955. The purpose of the fragment system is to enable modularization of BETA
  1956. programs. The fragment system also supports separate compilation, dependency
  1957. analysis of modules, information hiding and separation of specification and
  1958. implementation modules. The fragment system also enables the co-existence of
  1959. different implementations of the same specification, depending on the target
  1960. machine type (on the same file system), and automatic selection of the
  1961. proper variant for the specific machine type.
  1962.  
  1963. The fragment system is based on the slot and fragment metaphors. A slot is a
  1964. specification in the source code which signifies that separately compiled
  1965. source code may be associated with that place. A fragment is a piece of
  1966. source code which can be separately compiled, and associated with a slot.
  1967.  
  1968. The fragment system takes care of the slots and fragments, and the
  1969. connections between them. Several different combination rules exist in the
  1970. fragment system, enabling the specification of different modularization
  1971. relations.
  1972. ----------------------------------------------------------------------------
  1973.  
  1974. F02) How do I separate implementation and specification code?
  1975.  
  1976. Let us assume that we has the following source code:
  1977.  
  1978.    ORIGIN '...'
  1979.    --- lib: attributes ---
  1980.    f: (# t: @text; i,j: @integer; r: @real
  1981.       enter t[]
  1982.       do (* ... some code implementing f ... *)
  1983.       #)
  1984.  
  1985. This source code is assumed to reside in a source code file called
  1986. fSource.bet.
  1987.  
  1988. If we want to separate the implementation and the specification, we can make
  1989. the following change to fSource.bet:
  1990.  
  1991.    ORIGIN '...';
  1992.    BODY 'fBody'
  1993.    --- lib: attributes ---
  1994.    f: (# t: @text; i,j: @integer; r: @real
  1995.       enter t[]
  1996.       <<SLOT fBody: dopart>>
  1997.       #)
  1998.  
  1999. That is, we have replaced the implementation with a slot specification.
  2000.  
  2001. We now create another source file; let's call it fBody.bet:
  2002.  
  2003.    ORIGIN 'fSource'
  2004.    --- fBody: dopart ---
  2005.    do  (* ... some code implementing f ... *)
  2006.  
  2007. As can be seen, we have now modularized the implementation away from the
  2008. specification (except for the i, j, and r attributes (see question F05).
  2009. ----------------------------------------------------------------------------
  2010.  
  2011. F03) How do I work around "*****Only pattern-declarations may appear in a
  2012. fragment of category 'attributes'"?
  2013.  
  2014. In F02, we didn't get rid of the i, j, and r implementation attributes of f.
  2015. The reason is that it is not possible to do the most obvious, which would
  2016. have been the following:
  2017.  
  2018. fSource.bet:
  2019.    ORIGIN '...';
  2020.    BODY 'fBody'
  2021.    --- lib: attributes ---
  2022.    f: (# t: @text;
  2023.          <<SLOT fLib: attributes>>
  2024.       enter t[]
  2025.       <<SLOT fBody: dopart>>
  2026.       #)
  2027.  
  2028. fBody.bet:
  2029.    ORIGIN 'fSource'
  2030.    --- fLib: attributes ---
  2031.    i,j: @integer; r: @real
  2032.    --- fBody: dopart ---
  2033.    do  (* ... some code implementing f ... *)
  2034.  
  2035. since it is not allowed to specify reference attributes (static or dynamic)
  2036. in attribute slots.
  2037.  
  2038. Instead we have to use the following trick:
  2039.  
  2040. fSource.bet:
  2041.    ORIGIN '...';
  2042.    BODY 'fBody'
  2043.    --- lib: attributes ---
  2044.    f: (# t: @text;
  2045.         fPrivate: @<<SLOT fLib: descriptor>>
  2046.       enter t[]
  2047.       <<SLOT fBody: dopart>>
  2048.       #)
  2049.  
  2050. fBody.bet:
  2051.    ORIGIN 'fSource'
  2052.    --- fLib: descriptor ---
  2053.    (# i,j: @integer; r: @real #)
  2054.    --- fBody: dopart ---
  2055.    do  (* ... some code implementing f ... *)
  2056.  
  2057. and in (* ... some code implementing f ... *) we have to change all
  2058. references to i, j, and r to fPrivate.i, fPrivate.j, and fPrivate.r.
  2059. ----------------------------------------------------------------------------
  2060.  
  2061. F04) Why can't I have instances in attributes-fragments?
  2062.  
  2063. Allowing instances in attribute forms makes separate compilation of
  2064. fragments very difficult due to problems in calculating the size of objects
  2065. being allocated from the descriptor in which the fragment form is bound (to
  2066. a slot). E.g.
  2067.  
  2068. fSource.bet:
  2069.    ORIGIN '...'
  2070.    --- lib: attributes ---
  2071.    f: (# t: @text;
  2072.          <<SLOT fLib: attributes>>
  2073.       enter t[]
  2074.       <<SLOT fBody: dopart>>
  2075.       #)
  2076.  
  2077. fUsage.bet:
  2078.    ORIGIN '...';
  2079.    INCLUDE 'fSource'
  2080.    --- program: descriptor ---
  2081.    (# foo: @f
  2082.    do (* ... usage of foo ... *)
  2083.    #)
  2084.  
  2085. fImpl1.bet:
  2086.    ORIGIN 'fSource'
  2087.    --- fLib: attributes ---
  2088.    i,j: @integer; r: @real
  2089.    --- fBody: dopart ---
  2090.    do  (* ... some code implementing f ... *)
  2091.  
  2092. fImpl2.bet:
  2093.    ORIGIN 'fSource'
  2094.    --- fLib: attributes ---
  2095.    i,j,k: @integer; r, s: @real
  2096.    --- fBody: dopart ---
  2097.    do  (* ... some code implementing f ... *)
  2098.  
  2099. fProg1.bet:
  2100.    ORIGIN 'fUsage';
  2101.    BODY 'fImpl1'
  2102.  
  2103. fProg2.bet:
  2104.    ORIGIN 'fUsage';
  2105.    BODY 'fImpl2'
  2106.  
  2107. When compiling the fUsage.bet fragment separately, it is impossible to
  2108. pre-calculate the size of the foo object, since foo will contain i,j,r in
  2109. fProg1.bet, whereas foo will contain i,j,k,r,s in fProg2.bet.
  2110.  
  2111. A solution to this problem is being investigated by Mjolner Informatics, but
  2112. there are no plan for when this will be supported.
  2113. ----------------------------------------------------------------------------
  2114.  
  2115. F05) Why can't I have virtual declarations/bindings in attributes-fragments?
  2116.  
  2117. There are two problems in allowing virtual declarations in attribute
  2118. fragments.
  2119.  
  2120. The first problem is a logical problem. Consider:
  2121.  
  2122. fSource.bet:
  2123.    ORIGIN '...'
  2124.    --- lib: attributes ---
  2125.    A: (# V:< T;
  2126.          ...
  2127.       #);
  2128.    B: A(# <<Blib: attributes>>
  2129.           ...
  2130.        #);
  2131.    C: B(# V::< T1;
  2132.           ...
  2133.        #)
  2134.  
  2135. fUsage.bet:
  2136.    ORIGIN 'fSource'
  2137.    --- Blib: attributes ---
  2138.    V::< T2
  2139.  
  2140. The problem is, that when doing the semantic checking of V::< T1 in C, it is
  2141. impossible to know the further binding in the fUsage.bet fragment, since it
  2142. may be compiled after the compilation of the fSource.bet fragment. Thus it
  2143. is impossible to ensure, that the further binding in C is in fact legal (to
  2144. be legal, T1 must be a subpattern of T and all further bindings that might
  2145. appear in all fragments later bound to the Blib slot.
  2146.  
  2147. The second problem is in calculating the size of the virtual dispatch table,
  2148. if declaration of new virtuals were allowed in fragments bound to the Blib
  2149. slot.
  2150. ----------------------------------------------------------------------------
  2151.  
  2152. F06) What are the differences between the INCLUDE facilities of BETA and C?
  2153.  
  2154. It is important to note that the fragment system INCLUDE mechanism is
  2155. radically different from e.g. the C compilers' #include facility. The C
  2156. #include mechanism is merely a means for textual composition, without any
  2157. semantical implication. The fragment system's INCLUDE mechanism is a
  2158. semantical, separate compilation facility, and at the same time it describes
  2159. parts of the dependency relations between the program parts.
  2160. ----------------------------------------------------------------------------
  2161.  
  2162. F07) Why doesn't the compiler complain about a missing inner in a body
  2163. fragment?
  2164.  
  2165. The BETA compiler permits the following fragments:
  2166.  
  2167. top.bet:
  2168.    ORIGIN '~beta/basiclib/v1.6/betaenv';
  2169.    BODY 'testBody'
  2170.    --- lib: attributes ---
  2171.    test: (# do <<SLOT testBody: descriptor>> #)
  2172.    --- program: descriptor ---
  2173.    (# do test(# do ... #) #)
  2174.  
  2175. testBody.bet:
  2176.    ORIGIN 'top'
  2177.    --- testBody: descriptor ---
  2178.    (# do (* no inner! *) #)
  2179.  
  2180. Why does the compiler allow the specialization of test in the program slot
  2181. even though there is no inner in the definition of test (as can be seen in
  2182. the testBody fragment)?
  2183.  
  2184. The reason is that the testBody fragment may be compiled separately, and
  2185. later changed without recompiling or rechecking the top.bet fragment. That
  2186. is, even though the testBody might originally have included an inner, there
  2187. is no way to ensure that later changes do not remove it (without sacrificing
  2188. the separate compilation ability).
  2189.  
  2190. Note: This behavior is consistent with the compiler not performing flow
  2191. analysis to ensure that all execution paths of a pattern contain an inner.
  2192. For example,
  2193.  
  2194.    foo: (# do (if true then (* nothing! *) else inner if) #)
  2195.    bar: foo(# do ... #);
  2196.  
  2197. is legal even though bar's do-part is never executed.
  2198. ----------------------------------------------------------------------------
  2199.  
  2200. F08) Can <<Attributes>> be used instead of <<AttributeDecl>>?
  2201.  
  2202. The fragment system has a pragmatic treatment of the syntactic categories
  2203. <<AttributeDecl>> and <<Attributes>>. In general one may want to leave slots
  2204. in a delaration list for inserting declarations as in:
  2205.  
  2206.    (# a: @integer;
  2207.       <<SLOT lib1: attributes>>;
  2208.       b: ^ text;
  2209.       <<SLOT lib2: attributes>>;
  2210.       c: (# ... #)
  2211.    #)
  2212.  
  2213. It is, however, not possible to generate the above form from the BETA
  2214. grammar, since the nonterminal <attributes> cannot generate itself. It is
  2215. possible to make a grammar that can do this, but such a grammar is very
  2216. likely to be ambiguous. The following fragment can, however, be generated
  2217. from the grammar:
  2218.  
  2219.    (# a: @integer;
  2220.       <<SLOT lib1: attributeDecl>>;
  2221.       b: ^ text;
  2222.       <<SLOT lib2: attributeDecl>>;
  2223.       c: (# ... #)
  2224.    #)
  2225.  
  2226. This will, however, only allow one fragment-form to be inserted in a each
  2227. library slot. To handle this, the fragment system allows a fragment form of
  2228. category <attributes> to be inserted for an <attributeDecl>. This aliasing
  2229. between <attributeDecl> and <attributes> is handled by the alias mechanism
  2230. for the BOBS parser used by the meta programming system. See
  2231. $(BETALIB)/bobs/vx.y/bobs.bet, nontAlias. The alias mechanism also makes it
  2232. possible to use <descriptor> as a shorthand for <objectDescriptor>. The use
  2233. of syntac alias's is pragmatic and does not strictly follow the principles
  2234. of the fragment system, but it is considered a minor but practical
  2235. mechanism.
  2236. ----------------------------------------------------------------------------
  2237.  
  2238. SECTION II: The X libraries
  2239.  
  2240. ----------------------------------------------------------------------------
  2241.  
  2242. X01) Why does my label widget sometimes get the attribute name as
  2243. label-string, and sometimes not?
  2244.  
  2245. The following BETA program creates a window containing "Label"
  2246.  
  2247.    ORIGIN '~beta/Xt/current/awenv'
  2248.    --- program: descriptor ---
  2249.    AwEnv
  2250.    (# Hello: @Label;
  2251.    do Hello.init;
  2252.    #)
  2253.  
  2254. whereas the following program creates a window containing "Hello"
  2255.  
  2256.    ORIGIN '~beta/Xt/current/awenv'
  2257.    --- program: descriptor ---
  2258.    AwEnv
  2259.    (# Hello: @Label(##);
  2260.    do Hello.init;
  2261.    #)
  2262.  
  2263. Why?
  2264.  
  2265. The connection between the names used for widgets in BETA and the external
  2266. names used in the external widgets interfaced to from BETA is that the
  2267. pattern name of the BETA widget is used for the external widget name by
  2268. default. In the first example, the Hello widget is an instance of the
  2269. pattern Label, and in the second example the widget is the only possible
  2270. instance of the singular pattern Label(##), which is named Hello.
  2271.  
  2272. The appearance of the windows in this case comes from the fact that the
  2273. Athena Label widget uses the external name of the widget as default
  2274. label-string, if it is not specified otherwise. A variant of this problem is
  2275. the case where you specify a list of widgets using the same pattern:
  2276.  
  2277.    hello1, hello2: @Label(##);
  2278.  
  2279. In this case the default name will always be the first name in the list,
  2280. hello1. To avoid this behavior, use the scheme
  2281.  
  2282.    hello1: @Label(##);
  2283.    hello2: @Label(##);
  2284.  
  2285. or specify the name explicitly instead.
  2286. See the X Windows Libraries Manual p5-7 for more details.
  2287.  
  2288. ----------------------------------------------------------------------------
  2289.  
  2290. X02) Why do I get the error "There must be only one non-shell widget which
  2291. is son of Toplevel"?
  2292.  
  2293. Consider the following program:
  2294.  
  2295.    ORIGIN '~beta/Xt/current/awenv';
  2296.    --- program: descriptor ---
  2297.    AwEnv
  2298.    (# faculty: label
  2299.         (# init:: (# do 2-> borderwidth #) #);
  2300.       University: @box
  2301.         (# Physics, Mathematics: @faculty;
  2302.            init:: (# do Physics.init; Mathematics.init #);
  2303.         #)
  2304.    do University.init;
  2305.    #)
  2306.  
  2307. The idea was that a window with two labels named Physics and Mathematics
  2308. should appear. But executing it gives the error message
  2309.  
  2310.      Xt Error: There must be only one non-shell widget which is son of
  2311.      Toplevel. The widget causing the conflict is named faculty.
  2312.  
  2313. This is because the program uses the init pattern of the widgets without
  2314. specifying the father and name of the widgets. In the Xt manual [MIA 91-16],
  2315. it is briefly explained that the father widget will default to "the
  2316. enclosing widget according to BETA's scope rules" (see the description of
  2317. Core in "Basic XtEnv patterns").
  2318.  
  2319. To be precise, this is what happens: When the init pattern of a widget is
  2320. invoked, it first checked to see if the father is NONE. This will be the
  2321. case if no father is specified in the enter part of init. If so, a search is
  2322. started in the statical environment of the widget pattern. If a
  2323. specialization of a Core widget is found, this widget is used as the father.
  2324. This search is continued until a pattern with no enclosing pattern is found.
  2325. In this case the widget named TopLevel (in xtenv) is used as the father. The
  2326. widget TopLevel is an instance of the pattern TopLevelShell, which among its
  2327. characteristics has the constraint that it wants to have exactly one
  2328. non-shell child.
  2329.  
  2330. Now consider the example program: The first thing that happens is that the
  2331. init attribute of University is invoked. Since no father is specified, a
  2332. search for one is started from the University pattern. This search finds the
  2333. pattern AwEnv(# ... #), which is not a Core, and which has no enclosing
  2334. pattern. Thus University will get the father widget TopLevel.
  2335.  
  2336. The final binding of University.init then invokes Physics.init. Physics is
  2337. an instance of the pattern faculty, which is declared in the same scope as
  2338. University. Thus the search for a father for Physics is identical to the
  2339. search for the father of University, and Physics also gets TopLevel as its
  2340. father. This is when the error occurs. The reason why the name reported in
  2341. the error message is faculty is explained in Question X01.
  2342.  
  2343. Notice that it did not matter that the instantiation of the Physics object
  2344. is done within University: the default father is searched for starting from
  2345. the pattern declaration of the object.
  2346.  
  2347. In general there are three possible solutions:
  2348.  
  2349.   1. Supply the father and name when initializing the faculty widgets:
  2350.  
  2351.         do ("Physics", University)->Physics.init;
  2352.            ("Mathematics", University)->Mathematics.init;
  2353.  
  2354.      In this case, no search for a default father is needed for the faculty
  2355.      widgets.
  2356.   2. Make (possibly empty) specializations of faculty inside University:
  2357.  
  2358.         Physics: @faculty(##);
  2359.         Mathematics: @faculty(##);
  2360.  
  2361.      Now the search for a default father of Physics will start at the
  2362.      pattern faculty(##) inside University, so the University pattern will
  2363.      be the first found in this search, and hence the University widget will
  2364.      become the father of the Physics widget. Likewise for Mathematics.
  2365.   3. Move the declaration of the faculty pattern inside the University
  2366.      pattern. This will give the same search path as in solution 2.
  2367.      (Conceptually, this might also be the best place to declare faculty in
  2368.      the first place.)
  2369.  
  2370. The above example was a simple one. In more complicated cases, the reason
  2371. for an error of this kind can be trickier to spot. If your program uses the
  2372. fragment system to move declarations of useful widgets into a library, this
  2373. kind of error is likely to occur. Remember that if an instance of an
  2374. unspecialized widget is used, the widget pattern being declared in, say, the
  2375. XtEnvLib attributes slot of xtenv, then the search for a default father is
  2376. started at the XtEnv pattern, and therefore no father widget is found. In
  2377. this case the widget will get TopLevel as father. Solutions 1 or 2 above
  2378. will be appropriate in these cases.
  2379. See the X Windows Libraries Manual p5-7 for more details.
  2380.  
  2381. ----------------------------------------------------------------------------
  2382.  
  2383. X03) How do I get a separate window for my widget?
  2384.  
  2385. Widgets that create separate windows which can be individually moved,
  2386. resized, and so on, by the window manager are specializations of the Shell
  2387. pattern. Normally you would use a TopLevelShell (the pattern used for the
  2388. TopLevel widget created by default by XtEnv).
  2389.  
  2390. To make the following Athena Label appear in a separate window
  2391.  
  2392.    goodbye: @Label(# init:: (# do 'Goodbye World'->label #)
  2393.  
  2394. you would wrap a TopLevelShell around it:
  2395.  
  2396.    byewindow: @TopLevelShell
  2397.      (# goodbye: @Label
  2398.           (# init:: (# do 'Goodbye World'->label #) #);
  2399.         init:: (# do goodbye.init #);
  2400.      #);
  2401.  
  2402. To make the window appear, it should be initialized like any other widget,
  2403. and then the Shell method popup should be invoked:
  2404.  
  2405.    byewindow.init;
  2406.    byewindow.popup;
  2407.  
  2408. Notice that the first widget initialized by a program will by default become
  2409. a child of the TopLevel widget (see question X02), and will thus be in a
  2410. separate window.
  2411.  
  2412. There are other possible shells to use, such as OverrideShell. The
  2413. OverrideShell has gotten its name because although it creates a separate top
  2414. level window, it overrides all requests from the window manager, and will
  2415. therefore not be resizable, etc.
  2416. ----------------------------------------------------------------------------
  2417.  
  2418. X04) Why do I get the error "clockWidgetClass: undefined" when linking my
  2419. AwEnv program using the xt/v1.8 libraries? [corrected in r4.0]
  2420.  
  2421. The X libraries in the Mjolner System are based on X11 release 5 (X11R4/R5).
  2422. Support for X11R6 is not included in release 3.0 of the Mjolner System. But
  2423. with a few exceptions, X11R6 is backward compatible with X11R5. One of the
  2424. few exceptions is the reason for the above error: Some very infrequently
  2425. used widgets have been removed from the Athena widget set in X11R6.
  2426.  
  2427. To fix the error you should have your system administrator apply the
  2428. following patch to the file ~beta/Xt/v1.8/private/external/awInt.c:
  2429.  
  2430.    13d12
  2431.    < #include <X11/Xaw/Clock.h>
  2432.    15,16d13
  2433.    < #include <X11/Xaw/Logo.h>
  2434.    < #include <X11/Xaw/Mailbox.h>
  2435.    37d33
  2436.    <
  2437.    53,55d48
  2438.    < int getClockWidgetClass(){return ( (long) clockWidgetClass);}
  2439.    < int getLogoWidgetClass(){return ( (long) logoWidgetClass);}
  2440.    < int getMailboxWidgetClass(){return ( (long) mailboxWidgetClass);}
  2441.  
  2442. That is, remove all lines referring to the clock, logo, and mailbox widgets.
  2443. Then the system administrator should compile one of the awenv demos to get
  2444. the changes incorporated into the system.
  2445.  
  2446. To simplify correction of the above errors, a patch for the Mjolner System,
  2447. release 3.0 and 3.1 has been supplied. It can be fetched from
  2448. ftp://ftp.mjolner.com/pub/X11R6_patch,`.
  2449.  
  2450. Please see the README file for details.
  2451. ----------------------------------------------------------------------------
  2452.  
  2453. X05) Why do I get the error "Error: NULL ArgVal in XtGetValues" when
  2454. executing my Xt program using the xt/v1.8 libraries? [corrected in r4.0]
  2455.  
  2456. This is due to a programming error in the Mjolner System interface to the X
  2457. toolkit. The error does not seem to influence programs linked under X11
  2458. release 5, but (at least) X11R6 on Linux encounters it.
  2459.  
  2460. To fix the error have your system administrator change some files:
  2461.  
  2462.   1. In the file ~beta/Xt/v1.8/xtlib.bet, the definition of the pattern
  2463.      argList should be changed to:
  2464.  
  2465.      argList: cStruct
  2466.        (# byteSize::< (# do 100->value #);
  2467.           max: (# exit R.range div 2 #);
  2468.           extend:
  2469.             (# size: @integer;
  2470.             enter size
  2471.             do (if size=0 then R.range->size
  2472.                 else size-R.range->size;
  2473.                if);
  2474.                size->R.extend;
  2475.             #);
  2476.           set: @
  2477.             (# number: @integer;
  2478.                cStr: @integer;
  2479.                value: @integer;
  2480.             enter (number,cstr,value)
  2481.             do (* Cannot check ranges since no GC's may occur.
  2482.                 * The user needs to do the bookkeeping himself
  2483.                 * using 'max' and 'extend'.
  2484.                 * The reason for this is that 'value' may be
  2485.                 * the computed address of an integer.
  2486.                 *)
  2487.                cstr->R[number*2-1];
  2488.                value->R[number*2]
  2489.             #);
  2490.           get: @
  2491.             (# number: @integer;
  2492.             enter number
  2493.             exit R[number*2]
  2494.             #);
  2495.           getName: @
  2496.             (# number: @integer;
  2497.                t: ^text;
  2498.             enter number
  2499.             do r[2*number-1]->CStringToText->t[];
  2500.             exit t[]
  2501.             #);
  2502.        #);
  2503.  
  2504.   2. In the file ~beta/Xt/v1.8/private/xtenvbody.bet, the two fragments
  2505.      IntegerResourceGet and AncestorSensitiveGet should be changed to:
  2506.  
  2507.         --- IntegerResourceGet: dopart ---
  2508.         do (1,resourceName, @@value)->private.wargs.set;
  2509.            (Thewidget,private.wargs[],1)->XtGetValues;
  2510.  
  2511.      and
  2512.  
  2513.         --- AncestorSensitiveGet: dopart ---
  2514.         do (1,xtnancestorsensitive,@@value)->private.wargs.set;
  2515.            (Thewidget,private.wargs[],1)->XtGetValues;
  2516.  
  2517.      respectively.
  2518.   3. In the file ~beta/Xt/v1.8/private/awenvbody.bet, the fragment
  2519.      FloatResourceGet should be changed to:
  2520.  
  2521.         --- FloatResourceGet: descriptor ---
  2522.         (# status,res: @integer
  2523.         do (1,resourceName,@@value)->private.wargs.set;
  2524.            (theWidget,private.wargs[],1)->XtGetValues;
  2525.            resolution->res;
  2526.            (@@value,res)->getQuotFromFloat->value
  2527.         #)
  2528.  
  2529.   4. In the file ~beta/Xt/v1.8/motif/private/basicsbody.bet, the three
  2530.      fragments MotifStringResourceGetText, MotifStringResourceGet, and
  2531.      ProcResourceGet should be changed to:
  2532.  
  2533.         --- MotifStringResourceGetText: descriptor ---
  2534.         (# S: @MotifString;
  2535.         do (1,resourceName,@@S.value)->Private.Wargs.Set;
  2536.            (TheWidget,Private.Wargs[],1)->XtGetValues;
  2537.            S.getText->t[];
  2538.            S.destroy;
  2539.         #)
  2540.  
  2541.      and
  2542.  
  2543.         --- MotifStringResourceGet: descriptor ---
  2544.         (#
  2545.         do (1,resourceName,@@value)->private.wargs.set;
  2546.            (thewidget,private.wargs[],1)->XtGetValues;
  2547.         #)
  2548.  
  2549.      and
  2550.  
  2551.         --- ProcResourceGet: descriptor ---
  2552.         (#
  2553.         do (1,resourceName,@@p)->private.wargs.set;
  2554.            (Thewidget,private.wargs[],1)->XtGetValues;
  2555.         #)
  2556.  
  2557.      respectively.
  2558.   5. In the file ~beta/Xt/v1.8/motif/private/rowcolumnbody.bet the two
  2559.      fragments RowColumnLabelStringGetText and RowColumnLabelStringGet
  2560.      should be changed to:
  2561.  
  2562.         --- RowColumnLabelStringGetText: descriptor ---
  2563.         (# S: @MotifString;
  2564.         do (1,resourceName,@@S.value)->Private.Wargs.Set;
  2565.            (TheWidget,Private.Wargs[],1)->XtGetValues;
  2566.            S.getText->t[];
  2567.            S.destroy;
  2568.         #)
  2569.  
  2570.      and
  2571.  
  2572.         --- RowColumnLabelStringGet: descriptor ---
  2573.         (#
  2574.         do (1,resourceName,@@value)->private.wargs.set;
  2575.            (thewidget,private.wargs[],1)->XtGetValues;
  2576.         #)
  2577.  
  2578.      respectively.
  2579.   6. Then have your system administrator issue the commands
  2580.  
  2581.         cd $BETALIB/Xt/v1.8
  2582.         beta -q -c private/awenvbody.bet motif/private/rowcolumnbody.bet
  2583.  
  2584.      to get the changed files recompiled.
  2585.  
  2586. These changes will be incorporated in version 1.9 of the Xt libraries.
  2587.  
  2588. To simplify correction of the above errors, a patch for the Mjolner System,
  2589. release 3.0 and 3.1 has been supplied. It can be fetched from
  2590. ftp://ftp.mjolner.com/pub/X11R6_patch,`.
  2591.  
  2592. Please see the README file for details.
  2593. ----------------------------------------------------------------------------
  2594.  
  2595. X06) How do I set font information in MotifStrings?
  2596.  
  2597. In order to set font information in MotifStrings, you can use the following
  2598. as a template:
  2599.  
  2600.    sensorLabel: @Label
  2601.      (# init::
  2602.           (# s: @labelString;
  2603.              t: @MotifString
  2604.                   (# init::
  2605.                        (#
  2606.                        do ('Sensor:','ItalFont',XmSTRING_DIRECTION_L_TO_R)
  2607.                             -> t.setTextSegment;
  2608.                        #);
  2609.                   #);
  2610.           do (...)
  2611.              t.init;
  2612.              t->s.set;
  2613.           #);
  2614.      #);
  2615.  
  2616. ----------------------------------------------------------------------------
  2617.  
  2618. X07) Resource specification errors in Xt/v1.9 [corrected in r4.0]
  2619.  
  2620. Version 1.9 of the BETA interface to X (part of r4.0) solves most of the
  2621. errors appearing when using X11R6 (e.g. the errors in X04 and X05).
  2622.  
  2623. This is done, among other things, by introducing BooleanResource,
  2624. CharResource and ShortResource to correctly model the interface to X
  2625. resources with different physical representations.
  2626.  
  2627. Unfortunately a few of the resources was not converted correctly. This means
  2628. that you may get wrong behaviour when reading these resources.
  2629.  
  2630. To fix this you can change the following in the Xt/v1.9 sources, and
  2631. recompile the libraries (after appropriate setting of permissions):
  2632.  
  2633.    Change from IntegerResource to ShortResource:
  2634.    ---------------------------------------------
  2635.    motif/rowcolumn.bet:         RowColumn.numColumns
  2636.    motif/texts.bet:             TextField.columns
  2637.  
  2638.    Change from IntegerResource to BooleanResource:
  2639.    -----------------------------------------------
  2640.    awenv.bet:                   SimpleMenu.menuOnScreen
  2641.    awenv.bet:                   Paned.refigureMode
  2642.    awenv.bet:                   AsciiText.autoFill
  2643.    awenv.bet:                   AsciiText.resize
  2644.    awenv.bet:                   AsciiText.displayNonprinting
  2645.    awenv.bet:                   CoreLIB.resizable
  2646.    xtenv.bet:                   Core.mappedWhenManaged
  2647.    xtenv.bet:                   Shell.allowShellResize
  2648.    xtenv.bet:                   Shell.overrideRedirect
  2649.    xtenv.bet:                   Shell.saveUnder
  2650.    xtenv.bet:                   WMShell.input
  2651.    xtenv.bet:                   WMShell.transient
  2652.    xtenv.bet:                   WMShell.waitForWM
  2653.    xtenv.bet:                   TopLevelShell.iconic
  2654.    motif/bulletinboard.bet:     BulletinBoard.defaultPosition
  2655.    motif/lists.bet:             MotifList.automaticSelection
  2656.    motif/scale.bet:             Scale.highlightOnEnter
  2657.    motif/texts.bet:             ScrolledText.scrollVertical
  2658.    motif/texts.bet:             ScrolledText.scrollHorizontal
  2659.    motif/texts.bet:             ScrolledText.scrollLeftSide
  2660.    motif/texts.bet:             ScrolledText.scrollTopSide
  2661.    motif/texts.bet:             TextField.verifyBell
  2662.  
  2663. These errors will naturally be corrected in the next release.
  2664. ----------------------------------------------------------------------------
  2665.  
  2666. SECTION III: The BETA compiler
  2667.  
  2668. ----------------------------------------------------------------------------
  2669.  
  2670. C01) What is the execution speed of BETA programs?
  2671.  
  2672. For average programs, the execution speed of typical BETA programs is
  2673. comfortable. However, there are many possibilities for optimization in the
  2674. current BETA compiler, the generated code, and the run-time system. Mjolner
  2675. Informatics is constantly working on improving the execution speed of BETA.
  2676. ----------------------------------------------------------------------------
  2677.  
  2678. C02) How do I get rid of the warning: "A run-time qualification check will
  2679. be inserted here"?
  2680.  
  2681. By using the -q or -w options to the compiler: "beta -q ..." or "beta -w
  2682. ..."
  2683. ----------------------------------------------------------------------------
  2684.  
  2685. C03) What *does* that Qua-check warning mean, anyway?
  2686.  
  2687. If you have:
  2688.  
  2689.    (# Vehicle: (# ... #);
  2690.       Bus: Vehicle(# ... #);
  2691.       aVehicle: ^Vehicle;
  2692.       aBus: ^Bus
  2693.    do ...
  2694.       aVehicle[]->aBus[]
  2695.       ...
  2696.    #)
  2697.  
  2698. the compiler will give a Qua-check warning at the "aVehicle[]->aBus[]". The
  2699. reason is that aBus can only refer to objects which are instances of a
  2700. pattern that is a subpattern of Bus (or is a Bus). But aVehicle may refer to
  2701. all objects which are instances of a pattern that is a subpattern of Vehicle
  2702. (or is a Vehicle) - that is, not necessarily Bus. The BETA runtime system
  2703. therefore inserts a test to verify that the object referenced by aVehicle[]
  2704. is actually an instance of a pattern that is a subpattern of Bus (or is a
  2705. Bus) - otherwise a runtime error occurs.
  2706.  
  2707. The Qua-warning is issued to direct your attention towards these places for
  2708. potential runtime errors.
  2709. ----------------------------------------------------------------------------
  2710.  
  2711. C04) How do I work around "*****Repetition of non simple patterns is not
  2712. implemented" (using v5.0 of the compiler)? [corrected in r4.0]
  2713.  
  2714. If you want to write:
  2715.  
  2716.    persons: [100]@person
  2717.  
  2718. (which is not implemented in version 5.0 of the BETA compiler), you should
  2719. instead write:
  2720.  
  2721.    persons: [100]^persons
  2722.  
  2723. and then, before you start using the persons repetition, initialize it by:
  2724.  
  2725.    (for i: persons.range repeat
  2726.         &person[]->persons[i][]
  2727.    for)
  2728.  
  2729. Then you can use the persons repetition in the rest of the program, just as
  2730. if it was declared as a repetition of static persons.
  2731.  
  2732. In version 5.1 of the BETA compiler, persons: [100]@person is implemented.
  2733. ----------------------------------------------------------------------------
  2734.  
  2735. C05) How do I work around "Labeled imperative not implemented"?
  2736.  
  2737. If you want to write:
  2738.  
  2739.    (L: Imp1; Imp2; ... Impi :L)
  2740.  
  2741. (which is not implemented), you should instead write:
  2742.  
  2743.    L: (# do Imp1; Imp2; ... Impi #)
  2744.  
  2745. In fact, the (L: ... :L) construct is being considered for exclusion from
  2746. the BETA language due to the very simple replacement shown above.
  2747.  
  2748. See also L22.
  2749. ----------------------------------------------------------------------------
  2750.  
  2751. C06) Why does a BETA program called test.bet cause problems on some UNIX
  2752. installations?
  2753.  
  2754. By default, the executable generated from a BETA program called test.bet is
  2755. called test. Depending on your UNIX installation's defaults and your own
  2756. environment variables, attempts to execute the BETA program by typing test
  2757. may, however, result in the standard system program test being executed
  2758. instead. To avoid the problem, just type ./test instead of test.
  2759.  
  2760. Similar problems can arise with other, existing UNIX commands.
  2761.  
  2762. [Note: This is a typical beginner's problem, not related to the BETA
  2763. language or the BETA environment as such.]
  2764. ----------------------------------------------------------------------------
  2765.  
  2766. C07) How do I disable qualification check warnings?
  2767.  
  2768. The "A run-time qualification check will be generated here" warning may be
  2769. disabled by using compiler switches. In version v5.0 of the compiler, you
  2770. can use the -noquawarn (or -q) switch. All warnings may disabled by using
  2771. the -nowarnings (or -w) switch. If you would like the -q option to become
  2772. the default, you can include it in your BETAOPTS environment variable, e.g.
  2773.  
  2774.    setenv BETAOPTS -q
  2775.  
  2776. If you would like to temporarily turn qualification check warnings back on,
  2777. you may then do so by specifying the -quawarn switch.
  2778.  
  2779. As of version v5.1 of the compiler, the switch -noquawarn have been renamed
  2780. to --noWarnQua, and the switch -quawarn have been renamed to --warnQua.
  2781. ----------------------------------------------------------------------------
  2782.  
  2783. C08) What is the difference between P and &P?
  2784.  
  2785. Consider the following BETA program:
  2786.  
  2787.    (# P: (# do ... #)
  2788.    do P; &P
  2789.    #)
  2790.  
  2791. Compiling this program with the current BETA compiler shows no difference in
  2792. the code generated for P and &P.
  2793.  
  2794. However, the semantics of BETA defines a difference, namely that P is the
  2795. execution of an inserted item and that &P is the creation and execution of a
  2796. dynamic item, one of the differences being that inserted items are only
  2797. allocated once, irrespectively of how many times they are executed.
  2798.  
  2799. The current BETA compiler implements inserted items as dynamic ones, thereby
  2800. not taking advantage of the potential possibility for optimization. This
  2801. limitation will be removed in a future release of the compiler.
  2802. ----------------------------------------------------------------------------
  2803.  
  2804. C09) What does "virtual prefix not implemented" mean? [corrected in r4.0]
  2805.  
  2806. A couple of typos in the compiler manual [MIA 90-02(1.3) August 1994] for
  2807. version v5.0 of the compiler have caused some confusion over this message.
  2808. Section 5, item 8 ("Implementation Restrictions") should read as follows:
  2809.  
  2810.      8. Virtual superpatterns, i.e.,
  2811.  
  2812.         A::< (# ... #); (* where A is some virtual *)
  2813.         B: A(# ... #);
  2814.  
  2815.      have not been implemented.
  2816.  
  2817.      By using a final binding, this limitation can often be overcome
  2818.      like this:
  2819.  
  2820.         A:: (# ... #); (* A is no longer virtual *)
  2821.         B: A(# ... #);
  2822.  
  2823.      The situation may also occur in a more indirect way:
  2824.  
  2825.         graph:
  2826.           (# node:< (# ... #);
  2827.              nodeList: @list(# element::< node #);
  2828.              ...
  2829.           #);
  2830.  
  2831.      Here the virtual further binding of element in list is not
  2832.      allowed, since node is itself virtual.
  2833.  
  2834.      The next version of the compiler will allow final binding using a
  2835.      pattern that is itself virtual. That is, you will be allowed to do
  2836.      this:
  2837.  
  2838.         graph:
  2839.           (# node:< (# ... #);
  2840.              nodeList: @list(# element:: node #);
  2841.              ...
  2842.           #);
  2843.  
  2844.      In version 5.0 of the compiler, this situation is not handled
  2845.      correctly. Instead you can do as follows:
  2846.  
  2847.         graph:
  2848.           (# node:< (# ... #);
  2849.              nodeListElement: (# n: ^node enter n[] exit n[] #);
  2850.              nodeList: @list(# element::< nodeListElement #);
  2851.              ...
  2852.           #);
  2853.  
  2854.      General virtual prefixes behave much like multiple inheritance and
  2855.      will not be implemented in the near future.
  2856.  
  2857. These errors have been fixed in the manual for the version v5.1 of the
  2858. compiler.
  2859. ----------------------------------------------------------------------------
  2860.  
  2861. C10) What should I do if the compiler prints "Please report the error to
  2862. Mjolner Informatics" and stops?
  2863.  
  2864. The compiler may under very rare conditions run into an error from which it
  2865. is unable to recover. It will often print out the message "Please report the
  2866. error to Mjolner Informatics" just before stopping. If you run into an error
  2867. like this, you should do the following:
  2868.  
  2869.   1. Check in question C11, that the error has not yet been reported.
  2870.   2. If it has not been reported, please make an archive with the following
  2871.      files (using e.g. tar on UNIX, and e.g. StuffIt or CompactPro on
  2872.      macintosh):
  2873.         o all relevant .bet source files
  2874.         o the .dump file of the compiler, if it exists
  2875.         o a file with the compiler output leading to the error
  2876.      Then please mail this file to support@mjolner.com with a short
  2877.      description of the error.
  2878.  
  2879. For users of r4.0, you will find a new tool, betatar, which is usefull for
  2880. packing the entire set of source files into a tar-file (only available on
  2881. UNIX platforms)
  2882. ----------------------------------------------------------------------------
  2883.  
  2884. C11) What are the known errors in v5.0 of the compiler?
  2885.  
  2886. The following paragraphs deals with various bugs and workarounds in the
  2887. different compiler versions.
  2888. ----------------------------------------------------------------------------
  2889.  
  2890. C11.1) Bugs in version 5.0 of the compiler
  2891.  
  2892. Since the release of v5.0 of the compiler in august 1994, the following
  2893. errors have been reported.
  2894.  
  2895. Some of these errors occur in very specific situations, that are hard to
  2896. describe in general, but others may be generally presented, please see
  2897. below.
  2898.  
  2899. C11.1.1. Static Constants [fixed in v5.1]
  2900.  
  2901. The following program will make the compiler crash:
  2902.  
  2903.    ORIGIN '~beta/basiclib/current/betaenv';
  2904.    --- program: descriptor ---
  2905.    (# E: @(# exit 1 #) #)
  2906.  
  2907. The compiler reports:
  2908.  
  2909.    ******* System error!!!
  2910.    Constant used as static item
  2911.    Please report this error to Mjolner Informatics
  2912.  
  2913. and then stops.
  2914.  
  2915. This is because constants should be declared without the '@' sign, i.e.:
  2916.  
  2917.    ORIGIN '~beta/basiclib/current/betaenv';
  2918.    --- program: descriptor ---
  2919.    (# E: (# exit 1 #) #)
  2920.  
  2921. C11.1.2. Computed remotes and virtuals [fixed in v5.1]
  2922.  
  2923. The computed remotes, that the compiler supports in general from release
  2924. v5.0, will sometimes make the compiler crash, especially if virtuals are
  2925. involved. Example:
  2926.  
  2927.    ORIGIN '~beta/basiclib/current/betaenv';
  2928.    INCLUDE '~beta/containers/current/list';
  2929.    --- program: descriptor ---
  2930.    (# point: (# x: @integer; #);
  2931.       pointList: @List
  2932.         (# element::point;
  2933.            headx: (# exit (head).elm.x #);
  2934.         #);
  2935.    #)
  2936.  
  2937. This program makes the compiler crash with the error:
  2938.  
  2939.    ******* System error!!!
  2940.    Pre is empty/null(virtual binding)
  2941.    Please report this error to Mjolner Informatics
  2942.  
  2943. The workaround in this case is to avoid the computed remote in headx:
  2944.  
  2945.    ORIGIN '~beta/basiclib/current/betaenv';
  2946.    INCLUDE '~beta/containers/current/list';
  2947.    --- program: descriptor ---
  2948.    (# point: (# x: @integer; #);
  2949.       pointList: @List
  2950.         (# element::point;
  2951.            thehead: ^theCellType;
  2952.            headx: (# do head->thehead[]; exit thehead.elm.x #);
  2953.         #);
  2954.    #)
  2955.  
  2956. C11.1.3. "T1PROGRAM undefined" reported by the linker [fixed in v5.1]
  2957.  
  2958. As explained in section 7.3 "Assembler and Linker Errors" in the compiler
  2959. reference manual [MIA 90-02], if an unbound SLOT of category Descriptor or
  2960. Dopart exist in your program, then this is currently not reported by the
  2961. compiler itself, but will be detected as an "Undefined Entry" by the linker.
  2962. Especially if you are new to BETA programming, you may wonder why compiling
  2963. this fragment (foolib.bet):
  2964.  
  2965.    ORIGIN '~beta/basiclib/current/betaenv';
  2966.    --- lib: attributes ---
  2967.    foo: (# (* ... *) #);
  2968.  
  2969. with "beta foolib" causes the linker error "T1PROGRAM undefined". In this
  2970. case the reason is that the fragment is actually a library fragment - it
  2971. only declares attributes to be used by some program. Specifically the
  2972. PROGRAM descriptor SLOT defined in "betaenv" has not been bound, and thus
  2973. the error.
  2974.  
  2975. The solution is quite simple: Just compile the program as "beta -c foolib"
  2976. instead. The next version of the BETA compiler will not attempt to do the
  2977. linking if the PROGRAM SLOT is not bound.
  2978.  
  2979. If you think this is strange, compare to the equivalent situation in C
  2980. (foolib.c)
  2981.  
  2982.    foo() { /* ... */ }
  2983.  
  2984. If you compile this file with e.g. "cc foolib.c", you will often get the
  2985. linker error that "_main" is not defined. The solution here is like in BETA:
  2986. "cc -c foolib.c"
  2987.  
  2988. Version v5.1 of the compiler may under rare conditions exhibit the above
  2989. behaviour, in which case you should use the above workaround, except the the
  2990. compiler switch -c in v5.1 have been renamed to -x.
  2991.  
  2992. C11.1.4. Reference assignment of repetitions [fixed in v5.1]
  2993.  
  2994. Consider the following example:
  2995.  
  2996.    ORIGIN '~beta/basiclib/v1.6/betaenv';
  2997.    ---  program: descriptor ---
  2998.    (# P0: (# #); P1: P0 (# #);
  2999.       R1: [5] ^P0;
  3000.       R2: [5] ^P1;
  3001.    do R1[]->R2[]; (*not legal*)
  3002.    #)
  3003.  
  3004. It is not legal to assign a repetition reference to another repetition
  3005. reference. Unfortunately the compiler does NOT catch this error. The program
  3006. compiles and gives unpredictable results when executed.
  3007.  
  3008. It is possible to have the following assignment
  3009.  
  3010.    R1->R2
  3011.  
  3012. which makes R2 be a copy of R1. But R1 and R2 do not refer to the same
  3013. repetition.
  3014.  
  3015. Note, it is of course possible to have the elemenst of R1 point to the same
  3016. elemenst as P1:
  3017.  
  3018.    (for i: R1.range repeat R1[i][]->R2[i][] for)
  3019.  
  3020. It would be possible to extend BETA to allow assigning a reference to a
  3021. repetion object to another reptition, but there are currently no plans for
  3022. this.
  3023.  
  3024. C11.1.5. Assignment to index variables not checked
  3025.  
  3026. The BETA book states that it is not legal to assign to the index variable of
  3027. a for-imperative as in:
  3028.  
  3029.    (for i: 12 repeat ...; 5->i; ... for)
  3030.  
  3031. This restriction is currently not checked by the compiler.
  3032.  
  3033. Version v5.1 of the compiler still does not check for these assignments.
  3034. ----------------------------------------------------------------------------
  3035.  
  3036. C11.2) Bugs in version 5.1 of the compiler
  3037.  
  3038. Since the release of v5.1 of the compiler ultimo 1995, the following errors
  3039. have been reported.
  3040.  
  3041. Some of these errors occur in very specific situations, that are hard to
  3042. describe in general, but others may be generally presented, please see
  3043. below.
  3044.  
  3045. C11.2.1) "T1PROGRAM undefined" still reported by the linker
  3046.  
  3047. As mentioned in C11.1.3, version 5.1 of the compiler partly fixes the
  3048. problem of "T1PROGRAM undefined". To be specific, v5.1 of the compiler
  3049. checks, that the PROGRAM slot is met before initiating a call to the linker.
  3050.  
  3051. However, it may fail as follows:
  3052.  
  3053.    beta frag1 frag2
  3054.  
  3055. if frag1 contains a PROGRAM slot, and frag2 does not, you will get the
  3056. linker error for frag2: Once a PROGRAM slot has been seen, all fragments
  3057. subsequently translated will be attempted linked. This error also happens if
  3058. you invoke the compiler as
  3059.  
  3060.    beta -r frag1
  3061.  
  3062. and then enters frag2 as second fragment to compile when the repeating
  3063. compiler asks for it.
  3064.  
  3065. Also, if you have declared a Dopart- or Descriptor-slot in one of your
  3066. files, and do not have a fragment, that binds these slots in any of the
  3067. files in the dependency graph, then the linker may still fail with an
  3068. undefined entry for this slot.
  3069.  
  3070. See also C11.2.2.
  3071.  
  3072. C11.2.2) Other undefined entries (compiler import error) [hpux9pa, nti only]
  3073. [corrected in r4.0]
  3074.  
  3075. Question:
  3076. I experience errors from the linker concerning undefined entries, and I am
  3077. sure that all of my slots are bound. What is wrong?
  3078.  
  3079. Answer:
  3080. You may have encountered a situation where the internal import tables of the
  3081. compiler gets confused because two of your slots have identical names.
  3082.  
  3083. Consider:
  3084.  
  3085.    main.bet:
  3086.         ORIGIN '~beta/basiclib/v1.6/betaenv';
  3087.         INCLUDE 'foo';
  3088.         --PROGRAM: descriptor--
  3089.         (#
  3090.         do foo
  3091.         #)
  3092.  
  3093.    foo.bet:
  3094.         ORIGIN '~beta/basiclib/v1.6/betaenv';
  3095.         BODY 'foobody';
  3096.         -- LIB: attributes --
  3097.         foo:
  3098.           (# size: (# s: @integer <<SLOT size:dopart>> exit s #);
  3099.           do size -> putint; newline;
  3100.           #)
  3101.  
  3102.    foobody.bet:
  3103.         ORIGIN 'foo';
  3104.         INCLUDE 'bar';
  3105.         -- size: dopart --
  3106.         do (&bar[]).size -> s
  3107.  
  3108.    bar.bet:
  3109.         ORIGIN '~beta/basiclib/v1.6/betaenv';
  3110.         BODY 'barbody';
  3111.         --LIB: attributes--
  3112.         bar:
  3113.           (# size: (# s: @integer <<SLOT size:dopart>> exit s #)#);
  3114.  
  3115.    barbody.bet:
  3116.         ORIGIN 'bar'
  3117.         -- size: dopart --
  3118.         do 1 -> s
  3119.  
  3120. Although somewhat stupid, you would expect this program to print "1" onto
  3121. the screen. And it does so on most platforms. But on the platforms hpux9pa
  3122. (HPPA 9000/700 running HP-UX 9) and nti (Windows 95 / Windows NT), when
  3123. assembling the code produced for foobody, you get an error like
  3124.  
  3125.    undefined label - M2BAR
  3126.  
  3127. The reason for this, is that the compiler gets confused by the two dopart
  3128. slots both tagged with "size".
  3129.  
  3130. The solution is to use two distinct names, e.g. foosize and barsize. Such a
  3131. naming scheme is advisable to use in general - notice that if the two SLOTs
  3132. had been of kind Descriptor, then on all platforms, you would get
  3133.  
  3134.    multiply defined: M1SIZE
  3135.  
  3136. C11.2.3) Qualification error in code generation of division expression
  3137. [linux, nti only]
  3138.  
  3139. Sometimes v5.1 of the compiler on Linux and Windows 95/NT will will crash
  3140. with a Qualification Error during code generation of expressions involving
  3141. division.
  3142.  
  3143. If the resulting dump file starts with something like
  3144.  
  3145.    item <op1ToEBX#> in ~beta/.../system/v5.1/LINUXmachine
  3146.    -- GDIV-~ in ~beta/.../system/v5.1/LINUXmachine
  3147.  
  3148. then it is this error that has occurred.
  3149.  
  3150. On linux, the error will occur if you compile e.g. the demo
  3151. ~beta/demo/r3.1/Xt/awenv/scroll.bet. None of the demos on Windows NT/95
  3152. contain expressions that will cause this error, but you may encounter the
  3153. problem in files of your own.
  3154.  
  3155. The solution is to split up the expression involving the division into
  3156. simpler expressions. Use option --traceCode to find out what expression is
  3157. causing the error.
  3158. ----------------------------------------------------------------------------
  3159.  
  3160. C11.3) Bugs in version 5.2 of the compiler
  3161.  
  3162. Since the release of v5.2 of the compiler august 1996, the following errors
  3163. have been reported.
  3164.  
  3165. Some of these errors occur in very specific situations, that are hard to
  3166. describe in general, but others may be generally presented, please see
  3167. below.
  3168.  
  3169. C11.3.1) Strange error messages like "attempting to translate foo..db.bet"
  3170. [corrected in r4.0.1]
  3171.  
  3172. Some of the internal restructuring of the compiler that has been done for
  3173. version 5.2 has caused a new bug to appear. The symptom of the bug is that
  3174. .bet sometimes gets appended to the file name reported, when e.g. an attempt
  3175. to write a file fails because of permission problems.
  3176.  
  3177. An example is
  3178.  
  3179. You are attempting to translate the file
  3180.         /users/smith/beta/private/sun4s/foobody..db.bet
  3181. You do not have permission for doing this!
  3182.  
  3183. in case the file /users/smith/beta/private/sun4s/foobody..db, or the
  3184. directory it resides in, is write protected.
  3185.  
  3186. There is currently no workaround for this bug, but it is usually obvious
  3187. what file name should have been reported.
  3188.  
  3189. C11.3.2) Errors when evaluating expressions involving reals and external
  3190. calls [corrected in r4.0.1]
  3191.  
  3192. On all supported platforms, using both reals and external (C) calls in an
  3193. expression may yield unpredictable results.
  3194.  
  3195. For instance the following program
  3196.  
  3197. ORIGIN '~beta/basiclib/v1.5/math';
  3198. --PROGRAM: descriptor--
  3199. (#
  3200. do (1->sqrt) -> putint; newline;
  3201.    (10->log10) -> putint; newline;
  3202.    (1->sqrt)+(10->log10) -> putint; newline;
  3203. #)
  3204.  
  3205. will give the (wrong) output
  3206.  
  3207. 1
  3208. 1
  3209. 4
  3210.  
  3211. on Solaris. The only known workaround is to split up the expressions, so
  3212. that the parts that call the external functions are isolated (like the first
  3213. part of the above program).
  3214. ----------------------------------------------------------------------------
  3215.  
  3216. C12) Tracing the work of compiler?
  3217.  
  3218. In the extremely rare event that the compiler crashes during compilation of
  3219. your program, you may yourself do some tracing of the compilation to find
  3220. out what particular part of your program, that makes the compiler crash. You
  3221. do this by specifying some compiler switches:
  3222.  
  3223.   1. If the compiler crashes during *code generation* of a fragment, please
  3224.      do this:
  3225.  
  3226.         beta -s 308 311 0 <file>
  3227.  
  3228.      This will make the compiler print out each declaration and imperative
  3229.      just before code is generated for it. Thus when the compiler crashes,
  3230.      you can see what part of your program caused it.
  3231.   2. If the compiler crashes during *checking* of a fragment, please do
  3232.      this:
  3233.  
  3234.         beta -s 191 192 193 0 <file>
  3235.  
  3236.      This will make the compiler print out each descriptor, declaration and
  3237.      imperative just before checking it. Thus when the compiler crashes, you
  3238.      can see what part of your program caused it.
  3239.  
  3240. In version v5.1 of the compiler, you can use the two new compiler switches
  3241. --traceCode and --traceCheck instead.
  3242. ----------------------------------------------------------------------------
  3243.  
  3244. C13) Problem with floating point expressions in connection with repetitions
  3245. [fixed in v5.1]
  3246.  
  3247. The compiler does not generate correct code when floating point expressions
  3248. are used in the calculation of repetition ranges as in:
  3249.  
  3250.       R: [FR1] ...
  3251.    do ...
  3252.       FR2->R.extend
  3253.       FR3->R.new
  3254.  
  3255. where FR1, FR2 and FR3 are expressions yielding a floating point value. The
  3256. compiler should convert these floating point values into integer values, but
  3257. fails in doing so.
  3258.  
  3259. You can get around the error by explicitly converting the expression to an
  3260. integer value. If "I" is an integer variable, then the following will work:
  3261.  
  3262.       R: [FR1->I] ...
  3263.    do ...
  3264.       FR2->I->R.extend
  3265.       FR3->I->R.new
  3266.  
  3267. This problem have been fixed in version v5.1 of the compiler.
  3268. ----------------------------------------------------------------------------
  3269.  
  3270. C14) New features introduced in the Compiler
  3271.  
  3272. C14.1> New features in version 5.3 of the Compiler
  3273.  
  3274. BUILD property
  3275.      BUILD property now included in the BETA compiler. This replaces the use
  3276.      of MAKE.
  3277.      See the Compiler Manual p33 for more details.
  3278.  
  3279. Binary Object Files
  3280.      The compiler now generates binary object files on Win95/nt (except for
  3281.      Borland SDK). This eliminates the need for an external assembler.
  3282. Debug info
  3283.      The compiler now generates debug info on Win32 platforms. This enables
  3284.      the debugger, Valhalla, to work.
  3285. Gnu
  3286.      The compiler now supports gnu as SDK. This makes personal use
  3287.      completely free on Win32.
  3288. SGI: IRIX 6.x
  3289.      SGI: IRIX 6.x is now supported (see however SG04).
  3290.  
  3291. C14.2) New features in version 5.2 of the Compiler
  3292.  
  3293. The following new features have been implemented in version 5.2 of the
  3294. compiler, compared to version 5.1.
  3295.  
  3296. New Platforms
  3297.      Much effort has been put into porting the compiler onto new platforms:
  3298.         o A final version for Silicon Graphics MIPS is now available.
  3299.         o The Linux compiler now generates binary code directly.
  3300.         o Work is ongoing to make a binary compiler for Windows NT and
  3301.           Windows 95.
  3302.         o Work is ongoing to make native binary code generation for PowerPC
  3303.           based Macintoshes.
  3304.      This work has caused a lot of changes to the interior of the compiler
  3305.      and runtime system. These changes should, however, be transparent to
  3306.      the user.
  3307.  
  3308. ## now allowed for objects as well as for patterns
  3309.      You may now use P## as an alternative to P.struc when P is an object.
  3310.      Previously ## was only allowed for patterns.
  3311.  
  3312. $CC set in UNIX job files
  3313.      The job files on UNIX platforms now set the CC environment variable to
  3314.      a reasonable default value before executing the MAKE commands. Thus
  3315.      $(CC) may now be used in the make files on UNIX platforms.
  3316.  
  3317. Check for bound SLOTs
  3318.      The compiler will now only attempt to link if a PROGRAM slot has been
  3319.      found in the dependency graph (this feature was introduced in v5.1 of
  3320.      the compiler, but the implementation was buggy). If SLOTs of category
  3321.      dopart or descriptor in the dependency graph are not bound, and linking
  3322.      would otherwise have happened, the compiler now issues a warning and
  3323.      does not attempt to link. This is the kind of situation that could give
  3324.      an "Undefined Reference" error at link time in v5.1 (and earlier
  3325.      versions) of the compiler.
  3326.  
  3327.      Likewise, if two or more fragments try to bind the same SLOT, the
  3328.      compiler will give a warning. This is the kind of situation which could
  3329.      give an "Multiply Defined Symbol" error at link time in v5.1 (and
  3330.      earlier versions) of the compiler.
  3331.  
  3332. Interfragment leave/restart
  3333.      Added support for interfragment leave/restart as in
  3334.  
  3335.      foo.bet:
  3336.         ORIGIN '~beta/basiclib/v1.5/betaenv';
  3337.         BODY 'foobody';
  3338.         --PROGRAM:descriptor---
  3339.         (# do L: <<SLOT LL:descriptor>> #)
  3340.  
  3341.      foobody.bet:
  3342.         ORIGIN 'foo';
  3343.         --LL:descriptor--
  3344.         (# do leave L #)
  3345.  
  3346.      This feature did not work in previous versions of the compiler.
  3347.  
  3348. Generalized special characters in string literals
  3349.      The following special characters are now allowed in BETA string
  3350.      literals (some of them, e.g. \t, has worked in previous versions, too):
  3351.       \a  alert (bell) character
  3352.       \b  backspace
  3353.       \f  form feed
  3354.       \n  newline
  3355.       \r  carriage return
  3356.       \t  horizontal tab
  3357.       \v  vertical tab
  3358.       \\  backslash
  3359.       \?  question mark
  3360.       \'  single quote
  3361.       \"  double quote
  3362.       \ooooctal number
  3363.      The \ooo form can be shortened to \o or \oo, provided that the
  3364.      character immediately following it is not a digit.
  3365.  
  3366.      Note that the backslash character is now an escape sequence which must
  3367.      itself be escaped if used literally. Thus, one must now write '\\'
  3368.      instead of the old-style '\'.
  3369.  
  3370.      Note that you may now use \' as an alternative to the old-style '' for
  3371.      including literal quotes in a string. Thus, 'Tom\'s Cottage' produces
  3372.      the same result as 'Tom''s Cottage'.
  3373.  
  3374. C14.3) New features in version 5.1 of the Compiler
  3375.  
  3376. The following new features have been implemented in version 5.1 of the
  3377. compiler, compared to version 5.0.
  3378.  
  3379. General Repetitions
  3380.      Repetitions of static objects are now allowed. That is, given
  3381.  
  3382.         A: (# ... #); V:< A;
  3383.         P: (# ... #);
  3384.         S: <<SLOT SS:Descriptor>>;
  3385.  
  3386.      then
  3387.  
  3388.         X:  [10] @P;
  3389.         XC: [11] @|P;
  3390.         Y:  [12] @V;
  3391.         YC: [13] @|V;
  3392.         Z:  [14] @S;
  3393.         ZC: [15] @|S;
  3394.  
  3395.      are all allowed. The operators new and extend also applies to
  3396.      repetitions of this kind, like for other repetitions.
  3397.  
  3398. Qualification from pattern attributes
  3399.      It is now possible to qualify a reference as in the following example:
  3400.  
  3401.         grammar: (# symbol: (# ... #); .... #);
  3402.         A: ^grammar.symbol
  3403.  
  3404.      This was previously forbidden because grammar is not an object.
  3405.  
  3406. THIS(P) applies to prefix
  3407.      Previously THIS(P) was only known to work inside the P pattern. Now it
  3408.      also works for prefixes of P, e.g.:
  3409.  
  3410.         Q: (# x:  @integer; ... #);
  3411.         P: Q(# x: @integer;
  3412.            do ... THIS(Q).x -> ... (* will get the x of Q *)
  3413.            #)
  3414.  
  3415. Short-circuit Boolean Expressions
  3416.      Boolean expressions are now implemented as short-circuit. That is, B2
  3417.      is not evaluated if B1 is true in
  3418.  
  3419.         B1 or B2
  3420.  
  3421.      and B2 is not evaluated if B1 is false in
  3422.  
  3423.         B1 and B2
  3424.  
  3425. Final Binding to a Virtual Pattern
  3426.      Final binding of a virtual pattern to another pattern, which is virtual
  3427.      itself, is now allowed. That is, given the following:
  3428.  
  3429.         P1: (# V:< ... (* V virtual *)
  3430.                W:< ... (* W virtual *)
  3431.             #);
  3432.  
  3433.      it is now allowed to do the following in a specialization of P1:
  3434.  
  3435.         P2: P1(# W:: V (* V still virtual, but W now final bound *) #);
  3436.  
  3437.      The implementation of this is somewhat preliminary.
  3438.  
  3439. Special Characters in String Literals
  3440.      The compiler will no longer accept newline, carriage return or file
  3441.      separator characters in string literals, not even if escaped by \. This
  3442.      is to prevent errors that could occur when a string literal was not
  3443.      closed, i.e. a closing quote was forgotten. This kind of error is no
  3444.      longer possible. Of course, \n is still accepted in string literals.
  3445.  
  3446.      Furthermore literal null-characters \000 in strings will now result in
  3447.      a warning, since this may yield unpredictable results.
  3448.  
  3449. MAKE Property Behavior
  3450.      When specifying a MAKE property for automatic recompilation of external
  3451.      sources, the makefiles which are run are now executed relative to the
  3452.      directory in which the file containing the MAKE property is placed.
  3453.      This simplifies writing of makefiles a lot.
  3454.  
  3455. Consistent Command Line Options
  3456.      The command line options that can be used when activating the compiler
  3457.      have been revised and are now more consistent than previously: most
  3458.      options now have an activating and a deactivating form. Furthermore
  3459.      most options now have a short one-character equivalent for the
  3460.      non-default form. The short options have been chosen so that the
  3461.      character matches the first character in the long form as often as
  3462.      possible. Short options can now be concatenated.
  3463.  
  3464.      Please inspect chapter 8 of the Compiler manual for details, and please
  3465.      note that a few options have different meanings than previously, e.g.
  3466.      -c now corresponds to --noCode, where it previously corresponded to
  3467.      --noLink.
  3468.  
  3469. C14.4) New features in version 5.0 of the Compiler
  3470.  
  3471. The following new features have been implemented in version 5.0 of the
  3472. compiler, compared to version 4.4.2.
  3473.  
  3474. Xor Primitive
  3475.      An xor primitive is now supported as a basic operation on booleans.
  3476.      That is
  3477.  
  3478.            b1, b2, b3: @boolean
  3479.         do (b1 xor b2)->b3
  3480.  
  3481.      is now possible.
  3482.  
  3483. Simple If
  3484.      Often, the following if-construct is used
  3485.  
  3486.            b: @boolean;
  3487.         do (if b//TRUE then
  3488.              ...
  3489.            else
  3490.              ...
  3491.            if);
  3492.  
  3493.      The BETA compiler now supports an extension to the BETA language called
  3494.      simple-if. This extension means that the case selector may be omitted
  3495.      if the evaluation on the left hand side exits a boolean; it will
  3496.      default to //TRUE. That is, the above may be written:
  3497.  
  3498.            b: @boolean;
  3499.         do (if b then
  3500.              ...
  3501.            else
  3502.              ...
  3503.            if);
  3504.  
  3505. Labelled imperatives
  3506.      Labelled imperatives were previously defined in two forms:
  3507.  
  3508.         L: Imp;
  3509.  
  3510.      and
  3511.  
  3512.         (L: Imp1; ...; :L)
  3513.  
  3514.      The second form has now been removed from the language. Instead, the
  3515.      compiler offers the form
  3516.  
  3517.         L: (# do Imp1; ... #)
  3518.  
  3519.      Note that this form is implemented very efficiently in the case where
  3520.      there are no declarations in the object descriptor.
  3521.  
  3522. ----------------------------------------------------------------------------
  3523.  
  3524. SECTION IV: The basic libraries
  3525.  
  3526. ----------------------------------------------------------------------------
  3527.  
  3528. B01) How do you compare text strings in BETA?
  3529.  
  3530. Let's assume that we have:
  3531.  
  3532.    t1, t2: @text;
  3533.  
  3534. Then:
  3535.  
  3536.    t1[]->t2.equal
  3537.  
  3538. returns true if and only if t1 and t2 are equal, and
  3539.  
  3540.    t1[]->t2.equalNCS
  3541.  
  3542. returns true if and only if t1 and t2 are equal up to differences in case.
  3543. ----------------------------------------------------------------------------
  3544.  
  3545. B02) How do you read and write text in BETA?
  3546.  
  3547. Texts are written onto standard output by:
  3548.  
  3549.    'hello'->screen.puttext;
  3550.  
  3551. which writes the string 'hello' on the screen at current cursor position.
  3552.  
  3553.    'hello'->screen.putline;
  3554.  
  3555. also writes a carriage-return.
  3556.  
  3557. Integers are written by:
  3558.  
  3559.    7->screen.putInt;
  3560.  
  3561. If you want to write onto other text variables (such as t: @text), you can
  3562. do it by:
  3563.  
  3564.    'hello'->t.puttext;
  3565.    'hello'->t.putline;
  3566.    7->t.putInt;
  3567.  
  3568. Reading texts is equally easy:
  3569.  
  3570.    keyboard.getline->s[];
  3571.  
  3572. reads a line of text from the keyboard, and assigns a reference to the read
  3573. text to the text reference s (assumed to be declared as s: ^text).
  3574.  
  3575. Reading from other texts (e.g. t) is done by:
  3576.  
  3577.    t.getline->s[];
  3578.  
  3579. ----------------------------------------------------------------------------
  3580.  
  3581. B03) Why does getInt followed by getLine not necessarily work as expected?
  3582.  
  3583. You have to be careful when scanning input entered from the keyboard. For
  3584. example, if your program has a section of the form
  3585.  
  3586.    keyboard.getInt->...;
  3587.    ...
  3588.    keyboard.getLine->...;
  3589.  
  3590. and you enter, say,
  3591.  
  3592.    42<return>
  3593.    foo<return>
  3594.  
  3595. then the string returned by keyboard.getLine will be empty because getInt
  3596. stops scanning immediately after 42 and does not consume the (non-numeric)
  3597. new-line character. [Thus, entering
  3598.  
  3599.    42foo<return>
  3600.  
  3601. works correctly.] You may insert the line
  3602.  
  3603.    (if keyboard.peek=ascii.newline then keyboard.get if);
  3604.  
  3605. between the calls to getInt and getLine to get the desired effect, or even
  3606. call
  3607.  
  3608.    keyboard.scanWhiteSpace
  3609.  
  3610. in which case, however, you won't be able to enter a string starting with
  3611. white-space characters, similar to the functionality of C's library function
  3612. scanf().
  3613. ----------------------------------------------------------------------------
  3614.  
  3615. B04) What is the rationale behind the Mjolner System file directory
  3616. structures?
  3617.  
  3618. This entry describes the file structure of the Mjolner System. The entry is
  3619. intended as an illustration of one efficient way to structure the files of a
  3620. BETA development project. At the same time, this file structure is used all
  3621. over the existing Mjolner System to structure the various subsystems of the
  3622. Mjolner System.
  3623.  
  3624. Let us assume that the development project is called odin, and that it
  3625. consists of (at least) three subprojects, called brage, vidar, and vale.
  3626.  
  3627. We would then define the following file structure (brage/ indicates that
  3628. brage is the name of a subdirectory):
  3629.  
  3630.    odin --+-- brage/
  3631.           |
  3632.           +-- vidar/
  3633.           |
  3634.           +-- vale/
  3635.  
  3636. Each of the three subprojects may exists in different versions, reflecting
  3637. the development history. These versions are kept in separate subdirectories
  3638. for each subproject. Let us illustrate with vidar (having versions 1.0, 1.1,
  3639. and 1.2):
  3640.  
  3641.    vidar -+-- v1.0/
  3642.           |
  3643.           +-- v1.1/
  3644.           |
  3645.           +-- v1.2/
  3646.  
  3647. A configuration of odin now consists of the combination of the corresponding
  3648. versions of the subprojects.
  3649.  
  3650. Each version of each subproject has the following directory structure (here
  3651. illustrated with the 1.1 version):
  3652.  
  3653.    v1.1 --+-- F1.bet
  3654.           |
  3655.           +-- F2.bet
  3656.           |
  3657.           +-- ...
  3658.           |
  3659.           +-- Fn.bet
  3660.           |
  3661.           +-- private/
  3662.           |
  3663.           +-- demo/
  3664.           |
  3665.           +-- test/
  3666.           |
  3667.           +-- (* ast files *)
  3668.           |
  3669.           +-- (* code directories *)
  3670.  
  3671. The Fi.bet files contain the public interface files for the v1.1 version of
  3672. the subproject.
  3673.  
  3674. The private subdirectory contains the implementation fragments for the
  3675. Fi.bet interface files (see later).
  3676.  
  3677. The demo subdirectory contains demo programs illustrating the usage of this
  3678. subproject.
  3679.  
  3680. The test subdirectory contains programs for testing the functionality of
  3681. this subproject.
  3682.  
  3683. The (* ast files *) indicates that there will be an Fi.ast file (or an
  3684. Fi.astL for Intel-based systems) for each Fi.bet, containing the abstract
  3685. syntax tree (AST) representation of the Fi.bet.
  3686.  
  3687. The (* code directories *) indicates that there will be one subdirectory for
  3688. each machine type. Currently, the possible subdirectories are: sun4s, sgi,
  3689. hpux9pa, ppcmac, nti, and linux. There may be one subdirectory of each
  3690. machine type.
  3691.  
  3692. The substructure consisting of (* ast files *) and (* code directories *) is
  3693. shared by ALL directories, containing compiled BETA source files, and will
  3694. therefore not be mentioned further below.
  3695.  
  3696. The demo and test subdirectories may be further structured, possibly with a
  3697. subdirectory for each interface file Fi, but may also follow different
  3698. layouts.
  3699.  
  3700. The private subdirectory is divided into the following substructure:
  3701.  
  3702.    private -+-- F1Body.bet
  3703.             |
  3704.             +-- F2Body.bet
  3705.             |
  3706.             +-- ...
  3707.             |
  3708.             +-- FnBody.bet
  3709.             |
  3710.             +-- external/
  3711.             |
  3712.             +-- (* ast files *)
  3713.             |
  3714.             +-- (* code directories *)
  3715.  
  3716. where FiBody.bet contains the implementation fragments for the interface
  3717. files.
  3718.  
  3719. The FiBody.bet files may be machine-independent implementations or
  3720. machine-dependent implementations. The FiBody.bet files therefore follow the
  3721. following naming convention:
  3722.  
  3723. FiBody.bet
  3724.      is the name of a machine-independent implementation
  3725. Fi_macBody.bet
  3726.      is the name of a machine-dependent implementation(here for macintosh)
  3727.  
  3728. In most cases, there exists one implementation file for each interface file,
  3729. but for large (or complex) interface files, multiple implementation files
  3730. may exist (apart from the different machine dependent implementation files).
  3731.  
  3732. The external subdirectory contains non-BETA source files (such as C source
  3733. code), and other files which are not used directly by the Mjolner System.
  3734. The directory structure of external follows the conventions of the non-BETA
  3735. system used (e.g. the C compiler).
  3736. ----------------------------------------------------------------------------
  3737.  
  3738. B05) What do the (* idx+ *), etc. comments mean?
  3739.  
  3740. At different places in the Mjolner System interface files, you may encounter
  3741. comments of the form (* idx=2 *), (* idx+ *), or (* idx- *). These are not
  3742. compiler options - the compiler totally ignores all comments. Instead, the
  3743. comments are used for formatting the interface files for the documentation.
  3744. They can be safely ignored.
  3745. ----------------------------------------------------------------------------
  3746.  
  3747. B06) Error in v1.4/seqContainer.bet? [corrected in r4.0]
  3748.  
  3749. The queue pattern in v1.4/seqContainer.bet contains an error that makes the
  3750. pattern behave like a stack and not a queue. This error is removed in
  3751. v1.5/seqContainer.bet.
  3752. ----------------------------------------------------------------------------
  3753.  
  3754. B07) Error in v1.4/regexp.bet? [corrected in r4.0]
  3755.  
  3756. The v1.4/regexp.bet library contains an error that manifests itself by
  3757. repetition index runtime errors when regexp is used on empty texts. This
  3758. error will be removed in v1.5/regexp.bet.
  3759. ----------------------------------------------------------------------------
  3760.  
  3761. B08) Error in v1.4/basicsystemenv.bet? [corrected in r4.0]
  3762.  
  3763. The objectPort pattern in v1.4/basicsystemenv.bet contains an error that
  3764. makes it almost unusable. This error is removed in v1.5/basicsystemenv.bet.
  3765. ----------------------------------------------------------------------------
  3766.  
  3767. B09)Why does my guienvsystemenv program stop at startup?
  3768.  
  3769. Possible problems in your program:
  3770.  
  3771.    * Your program was not a specialisation of systemenv
  3772.    * You did not set theWindowEnv to the guienv instance in setWindowEnv
  3773.    * Your program forks in the dopart of guienv. You should fork systems in
  3774.      the dopart of systemenv. This might change in a future release
  3775.  
  3776. Your program should look like this:
  3777.  
  3778. -- program: descriptor --
  3779. systemenv
  3780. (# setWindowEnv:: (# GUI[] -> theWindowEnv[] #);
  3781.  
  3782.    GUI: @guienv
  3783.      (#
  3784.      do ... (* open windows here *)
  3785.      #);
  3786. do ... (* fork systems here *)
  3787. #)
  3788.  
  3789. ----------------------------------------------------------------------------
  3790.  
  3791. PART V: Platform Specific Issues
  3792.  
  3793. ----------------------------------------------------------------------------
  3794.  
  3795. SECTION V: BETA on Macintosh
  3796.  
  3797. ----------------------------------------------------------------------------
  3798.  
  3799. M01) What are the system requirements to run BETA on Macintosh?
  3800.  
  3801. Release 3.1: BETA for Motorola Mac
  3802.  
  3803.    * CPU: MC68020 processor or later (Release r3.1 works on PowerPC, please
  3804.      look at question M04)
  3805.    * RAM: 5 Mb memory (8 or 16 Mb is recommended)
  3806.    * Disk: 16 Mb of free space on harddisk
  3807.    * OS: System 7.x or later (or Multifinder under System 6.x)
  3808.    * The MPW environment version 3.2 or later (please see question M02 for
  3809.      details).
  3810.    * An FPU to be able to use reals, please see question M03 for more
  3811.      details.
  3812.  
  3813. That is, Release 3.1 runs on machines like Classic II, SE/30, LC, LC II, LC
  3814. III, Centris, and all Macintosh II, Quadra and PowerBook models (except
  3815. PowerBook 100). Release 3.1 cannot be used at Mac Plus, SE, and Classic.
  3816. Release 3.1 works on PowerPC, please look at question M04.
  3817.  
  3818. Release 4.0.2 or later: BETA for PowerMac
  3819.  
  3820.    * CPU: PowerPC 601 processor or later
  3821.    * RAM: 40 Mb memory
  3822.    * Disk: 60 Mb of free space on harddisk
  3823.    * OS: System 7.x or later
  3824.    * The MPW environment, version 3.4.1 or later (please see question M02
  3825.      for details), including
  3826.         o MPW Shell
  3827.         o Interfaces&Libraries
  3828.         o PPCLink version 1.4 or later; or MWLinkPPC from Metrowerks, see
  3829.           M02
  3830.         o Rez
  3831.      These can be obtained from Apple from the Essentials-Tools-Objects
  3832.      (ETO) volume 20 or later.
  3833.    * FPU to be able to use reals (please see question M03 for more details).
  3834.      However, a hardware FPU is build into most PowerPC Macintosh.
  3835.  
  3836. That is, Release 4.0.2 should work for alle PowerMac models. Please note
  3837. that, Release 4.0.2 or later does not work on motorola macintoshes.
  3838. ----------------------------------------------------------------------------
  3839.  
  3840. M02) What is MPW. Where do I get it?
  3841.  
  3842. MPW stands for "Macintosh Programmers Workshop", which is the official
  3843. programming environment for the Macintosh, developed by Apple, Inc. The BETA
  3844. compiler runs as an MPW tool, that is, it is a command, that can be invoked
  3845. from the MPW Shell (command interpreter).
  3846.  
  3847. You will need MPW 3.4 or later to use BETA. In addition to the MPW Shell,
  3848. the compiler uses the MPW Link and Rez tools to build the programs.
  3849.  
  3850. As of october 1997, Apple has decided to make MPW freely available for
  3851. downloading. You can download it from
  3852.  
  3853.    * ftp://dev.apple.com/devworld/Tool_Chest/Core_Mac_OS_Tools/.
  3854.  
  3855. The current versions of the packages needed are
  3856.  
  3857.    * MPW-3.4.2.sit.hqx.
  3858.    * Interfaces_Libraries-3.0.1.sit.hqx.
  3859.  
  3860. Please notice, that new versions may have been available when you read this.
  3861.  
  3862. As an alternative to Apple's MPW, you can use the MPW supported by
  3863. Metrowerks CodeWarrior. The MWLinkPPC linker included in this commercial
  3864. package is is up to 10 times faster than PPCLink from Apple.
  3865. ----------------------------------------------------------------------------
  3866.  
  3867. M03) Do I need a floating point unit to use BETA?
  3868.  
  3869. Yes, to be able to run BETA programs, that use "reals", your machine should
  3870. have a built-in FPU, *or* you can install an FPU simulator. Several
  3871. free/shareware FPU simulators are available, e.g. SoftwareFPU, which can be
  3872. fetched from most macintosh archives, or from the writer, John Neil, at
  3873. http://www.jna.com/software.html.
  3874. ----------------------------------------------------------------------------
  3875.  
  3876. M04) Does BETA work on PowerPC machines?
  3877.  
  3878. As of release 4.0.2, PowerPC based macintoshes are the only macintoshes
  3879. supported.
  3880.  
  3881. Release 3.1 of BETA can be run on PowerMac's using the MC680x0 simulator.
  3882. That is, the applications will run with the usual slowdown for simulated
  3883. programs on PowerMac.
  3884. ----------------------------------------------------------------------------
  3885.  
  3886. M05) Does BETA work on Motorola machines?
  3887.  
  3888. Release 3.1 of the Mjolner System is the last supporting Motorola
  3889. Macintoshes.
  3890.  
  3891. As of release 4.0.2, PowerMacintosh is the only Macintosh platform
  3892. supported.
  3893. ----------------------------------------------------------------------------
  3894.  
  3895. M06) Known bugs, limitations and inconveniences in release 4.0.2
  3896.  
  3897. The current release 4.0.2 is the first for power mac, and is still
  3898. considered an "alpha release". There are a number of known bugs, limitations
  3899. and inconveniences:
  3900.  
  3901.   1. Link time is very long for BETA programs. We have not been successful
  3902.      in getting appropriate documentation from Apple to make optimal
  3903.      generation of the XCOFF files.
  3904.   2. Freja is not yet available for PowerMac
  3905.   3. Valhalla is not yet available for PowerMac
  3906.   4. bobsit will not work, because the exbobs program did not get ready for
  3907.      r4.0.2
  3908.   5. Problems with Sif
  3909.         o Closing a workspace may make the machine crash
  3910.   6. Persistence does not work
  3911.   7. Check for suspend involving callbacks is not done. If you do a suspend
  3912.      in a callback situation the program is likely to crash.
  3913.   8. Integer division by zero will yield unpredictable results (should be
  3914.      caught as an exception as on other platforms).
  3915.   9. The pattern doGC in betaenv does not work on ppcmac. This is used in
  3916.      implementation of
  3917.  
  3918.                 sysutils/v1.5/scanobjects
  3919.  
  3920.      used in the demo
  3921.  
  3922.                 demo/sysutils/objinterface/scanobj
  3923.  
  3924.      which consequently does not work
  3925.  10. The PutReal pattern in ~beta/basiclib/v1.5/numberio does not work. This
  3926.      is used in the demo programs in
  3927.  
  3928.                      ~beta/demo/basiclib/reals/
  3929.  
  3930.      and
  3931.  
  3932.                      ~beta/demo/basiclib/random/tstgenchi.bet
  3933.  
  3934.      which does not produce a correct output.
  3935.  11. The touch and modtime.set operations on diskentry does not work
  3936.  12. The iget operation on keyboard is not implemented. This is used in the
  3937.      demo programs in:
  3938.  
  3939.                      ~beta/demo/basiclib/iget/
  3940.  
  3941.      which consequently does not work
  3942.  13. Systemenv is not implemented
  3943.  14. Process is not implemented
  3944.  15. Bifrost is not implemented
  3945.  16. Frigg is not available, due to some problems (Will be fixed in the next
  3946.      release).
  3947.  17. There is a number of problems with GuiEnv:
  3948.         o There is no support for resources like icons, cursors etc.
  3949.         o There are some update problems.
  3950.         o The only way to make a window appear like a modal dialog is by
  3951.           further binding "menubarVisible" to exit false.
  3952.         o figureItems does not work yet.
  3953.  18. The "Commando BETA" command in the Beta menu, does not work
  3954.  19. the new timedate library does not work (linker error).
  3955.  
  3956. ----------------------------------------------------------------------------
  3957.  
  3958. M07) Known bugs, limitations and inconveniences in release 4.1
  3959.  
  3960. M07.1) Why do I get a linker warning about errno?
  3961.  
  3962. There is two macintosh libraries that contains errno: StdCLib and OTXTILib -
  3963. hence the warning. OTXTILib only is used if you include the process or
  3964. distribution library. This warning can safely be ignored.
  3965.  
  3966. M07.2) How do I open a PersistentStore in psbrowser on the macintosh?
  3967.  
  3968. You have to move the psbrowser application into the directory that contains
  3969. the persistentstore you want to open before launching psbrowser. Now you can
  3970. open the persistentstore via the open command in the file menu. Be aware
  3971. that the program that generated the persistentstore must call
  3972. persistentstore_fullnamepatch included from
  3973.  
  3974.    ~beta/objectbrowser/v1.6/psbrowser/psfullnamepatch
  3975.  
  3976. M07.3) Why does my systemenv program not work as expected in MPW?
  3977.  
  3978. If you link a systemenv program as a MPW tool, the keyboard will block all
  3979. systems when you call any of the get operations: getLine, getInt etc. The
  3980. solution is to link your program as an application.
  3981. ----------------------------------------------------------------------------
  3982.  
  3983. SECTION VI: BETA on Windows 95 and Windows NT
  3984.  
  3985. ----------------------------------------------------------------------------
  3986.  
  3987. W01) What are the system requirements to run BETA on Windows 95 and Windows
  3988. NT?
  3989.  
  3990.    * CPU: Intel 386/486/Pentium
  3991.    * RAM: 16Mb (32 recommended)
  3992.    * Disk: 45 Mb of free space.
  3993.    * OS: Windows 95 or Windows NT 3.5.1 or later.
  3994.    * Microsoft SDK, Gnu SDK or Borland SDK (only assembler, linker, make
  3995.      utilities and C libraries required). Microsoft SDK recommended.
  3996.  
  3997. For more information, see W02.
  3998. ----------------------------------------------------------------------------
  3999.  
  4000. W02) SDK Requirements for Windows 95 or Windows NT
  4001.  
  4002. In order to use the Mjolner System you need to have an assembler, a linker,
  4003. a make utility and C libraries from either Microsoft or Borland. The
  4004. Microsoft utilities are recommended.
  4005.  
  4006. These utilities must satisfy the following:
  4007.  
  4008.   1. Microsoft
  4009.      Assembler:
  4010.           Starting from release r4.0.1, no assembler is needed any longer.
  4011.  
  4012.           For older releases (e.g. r4.0) an assembler is needed. You can
  4013.           install one of the following
  4014.              + MASM386.EXE and EDITBIN.EXE from the Microsoft WIN32SDK.
  4015.              + ML.EXE, which can be bought as a separate tool from
  4016.                Microsoft. ML.EXE is also part of Microsoft Development
  4017.                Network MSDN (level 2) and the Windows NT 3.5.1 DDK.
  4018.      Linker:
  4019.              + LINK.EXE from e.g. Microsoft Visual C++.
  4020.      Make:
  4021.              + NMAKE.EXE from e.g. Microsoft Visual C++.
  4022.                If you do not plan to use the BETA MAKE facility, you can do
  4023.                with a dummy NMAKE program, that simply exits 0.
  4024.      C libraries:
  4025.              + from e.g. Microsoft Visual C++.
  4026.      If you have installed Microsoft Visual C++ 2.0 or later for Windows 95
  4027.      or Windows NT, you do not need any more software to run the Mjolner
  4028.      System. If you do not have Visual C++, you will have to get a linker
  4029.      and C libraries from Microsoft (http://www.microsoft.com/).
  4030.   2. Gnu.
  4031.      Assembler:
  4032.           No assembler is needed.
  4033.      Linker:
  4034.           gcc and ld.
  4035.      Make:
  4036.           The Gnu make utility.
  4037.      C libraries:
  4038.           The C libraries that come with gcc for Win32.
  4039.   3. Borland.
  4040.      Assembler:
  4041.              + TASM32.EXE, which is sold as a separate tool from Borland.
  4042.                Notice, that version 4.0 of TASM32.EXE does not work on
  4043.                Windows 95. A patch is available from the Borland "Patchs
  4044.                Available" WWW Page at
  4045.                http://loki.borland.com/cpp/Patchs.htm. The patch is directly
  4046.                available by FTP from
  4047.                ftp://ftp.borland.com/pub/techinfo/techdocs/language/tools/turboasm/ta4p01.zip.
  4048.      Linker:
  4049.              + TLINK32.EXE (version 1.0), which is included in the above
  4050.                Assembler package from Borland, does not work under Windows
  4051.                95. It aborts with an "Illegal Instruction" error.
  4052.              + You need to obtain the TLINK32.EXE linker (version 1.50),
  4053.                which is part of the Borland C++ (version >= 4.5).
  4054.      Make:
  4055.              + MAKE.EXE, which is included in the above Assembler package
  4056.                from Borland, and is also part of Borland C++ (version >=
  4057.                4.5).
  4058.      C libraries:
  4059.              + must be obtained from e.g. Borland C++ (version >= 4.5).
  4060.      If you have installed Borland C++ for Windows 95/NT, version 4.5 or
  4061.      later, all you need to install additionally is Borland Assembler
  4062.      (available from Borland).
  4063.  
  4064. You can purchase these utilities from either Microsoft
  4065. (http://www.microsoft.com/) or Borland(http://www.borland.com/). Please
  4066. contact their national representatives for ordering information.
  4067. ----------------------------------------------------------------------------
  4068.  
  4069. W03) Why do I need a MAKE facility?
  4070.  
  4071. Question:
  4072. I do not have a MAKE facility on my Windows 95/NT machine. Why do I need
  4073. that - I thought that the BETA compiler analyzed the dependencies itself?
  4074.  
  4075. Answer:
  4076. The BETA compiler keeps track of dependencies between all involved beta
  4077. files. However, if you want to link in object files generated by an external
  4078. C compiler og assembler, you may add a MAKE property to make the BETA
  4079. compiler invoke the make-facility to keep the external objectfiles
  4080. up-to-date (see section 2.4 in "The Mjolner System - Using on Windows 95 /
  4081. Windows NT [mia94-32]).
  4082.  
  4083. If you do not use the MAKE property in your programs, in principle you do
  4084. not need a make facility. But since a few of the standard libraries included
  4085. in the Mjolner System contains such MAKE properties, you will need a
  4086. make-facility anyway. However, since all external object files in the
  4087. standard libraries are up-to-date when distributed by Mjolner Informatics,
  4088. you can do with a dummy make-utility.
  4089.  
  4090. For instance you may create a C file like this:
  4091.  
  4092.    main()
  4093.    {
  4094.      exit(0);
  4095.    }
  4096.  
  4097. compile it with your C compiler, and install it in your path with the name
  4098. MAKE.EXE (if you use the Borland SDK) or NMAKE.EXE (if you use the Microsoft
  4099. SDK).
  4100. ----------------------------------------------------------------------------
  4101.  
  4102. W04) Error in directory scan using Borland SDK? [corrected in r4.0]
  4103.  
  4104. Question:
  4105. Why does the following program fail with a memory exception on my windows
  4106. 95/NT machine? I am using v5.1(6) of the compiler and SDK=bor.
  4107.  
  4108.    ORIGIN '~beta/basiclib/v1.4/directory';
  4109.    --PROGRAM:descriptor--
  4110.    (# d: @directory;
  4111.    do '.' -> d.name;
  4112.       d.scanEntries
  4113.       (#
  4114.       do select
  4115.          (# whenDir::<
  4116.               (# do (theDir).entry.path.name -> screen.putline #);
  4117.          #);
  4118.       #);
  4119.    #)
  4120.  
  4121. Answer:
  4122. This is due to an error in the directory library. The problem is, that the
  4123. file %betalib%\sysutils\v1.4\private\nti\bor\directory_ntbody.obj in the
  4124. release 3.1 distribution of the Mjolner System has been compiled with an
  4125. older version of the compiler. The solution is to delete the obj-file and
  4126. recompile %betalib%\sysutils\v1.4\private\directory_ntbody.bet.
  4127. ----------------------------------------------------------------------------
  4128.  
  4129. W05) Make-error for lazyref_gc.c using Borland SDK? [corrected in r4.0.2]
  4130.  
  4131. Question:
  4132. When I use persistentstore or objectserver in my Windows 95/NT application I
  4133. get this error from the compiler:
  4134.  
  4135.    MAKE Version 3.7  Copyright (c) 1987, 1994 Borland International
  4136.    Fatal: 'c:\beta\betarun\v2.7\nti\c\lazyref_gc.c' does not exist -
  4137.    don't know how to make it
  4138.  
  4139. I have installed BETA in C:\BETA.
  4140.  
  4141. Answer:
  4142. The reason is that there were some problems to get the two make facilities
  4143. from Microsoft and Borland to work with BETA. The solution was to handle the
  4144. lazyref_gc.c file specially in the make files. However, the lazyref_gc.c
  4145. file is part of the source code for the BETA runtime system, which is not
  4146. distributed with the release.
  4147.  
  4148. Solution:
  4149. Create a dummy lazyref_gc.c and update timestamp of corresponding .obj file.
  4150. This can be done by compiling and executing the following program:
  4151.  
  4152.    ORIGIN '~beta/basiclib/v1.4/directory';
  4153.    INCLUDE '~beta/sysutils/v1.4/envstring';
  4154.    --PROGRAM: descriptor--
  4155.    (# d: @directory;
  4156.       f: @file;
  4157.    do ' Create directory for C file ' -> putline;
  4158.       '$(BETALIB)/betarun/v2.7/nti/C' -> expandEnvVar -> d.name;
  4159.       (if not d.entry.exists then d.touch if);
  4160.  
  4161.       ' Create dummy C file ' -> putline;
  4162.       '/lazyref_gc.c' -> ((d.name).copy).append -> f.name;
  4163.       (if not f.entry.exists then f.touch if);
  4164.  
  4165.       ' Update timestamp of dependant object file ' -> putline;
  4166.       '$(BETALIB)/objectserver/v2.1/private/nti/$(SDK)/lazyref_gc.obj'
  4167.         -> expandEnvVar -> f.name;
  4168.       f.touch;
  4169.    #)
  4170.  
  4171. ----------------------------------------------------------------------------
  4172.  
  4173. W06) Known bugs, limitations and inconveniences in release 4.0.2
  4174.  
  4175.   1. Most parts of systemenv are still not implemented. Most of the demos in
  4176.      demo\basiclib\systemenv fails. Specificly using the operation
  4177.      "keyboard.get" will block.
  4178.   2. Process and socket communication is currently NOT supported. It may
  4179.      work, but known errors exist in these modules. These modules have been
  4180.      scheduled for re-structuring. It is possible, though not likely, that
  4181.      the interface specification changes.
  4182.   3. Binary/ASCII files has a work-around (kluge) to compensate for a bug(?)
  4183.      in Windows NT/95. If a text file with UNIX style EOL characters (\n) is
  4184.      opened as a text file the offset (ftell) of the first character in the
  4185.      file is the negative of the number of '\n's found in the first 512
  4186.      bytes. The kluge is that if a file is opened as a text file and a '\n'
  4187.      (UNIX EOL) is found before '\r\n' (Windows NT EOL) it will be opened as
  4188.      a binary file.
  4189.   4. File time stamps have proven difficulties in BETA on Windows NT. We (at
  4190.      GMT+1) experience the problem that files are reported to have a
  4191.      timestamp one hour less than the real time stamp of the file. This also
  4192.      means that when touching a file entry the file will be touched with a
  4193.      wrong time stamp (in out case one hour later than the real time).
  4194.   5. Freja is not available for nti
  4195.   6. Valhalla is not available for nti
  4196.   7. The new timedate library does not work (linker error).
  4197.  
  4198. ----------------------------------------------------------------------------
  4199.  
  4200. W07) Known bugs, limitations and inconveniences in release 4.1
  4201.  
  4202.   1. Some parts of systemenv are still not implemented. Some of the demos in
  4203.      demo\basiclib\systemenv fails. Specificly using the operation
  4204.      "keyboard.get" will block the entire process, not only the component
  4205.      issuing the call.
  4206.   2. Binary/ASCII files has a work-around (kluge) to compensate for a bug(?)
  4207.      in Windows NT/95. If a text file with UNIX style EOL characters (\n) is
  4208.      opened as a text file the offset (ftell) of the first character in the
  4209.      file is the negative of the number of '\n's found in the first 512
  4210.      bytes. The kluge is that if a file is opened as a text file and a '\n'
  4211.      (UNIX EOL) is found before '\r\n' (Windows NT EOL) it will be opened as
  4212.      a binary file.
  4213.   3. File time stamps have proven difficulties in BETA on Windows NT. We (at
  4214.      GMT+1) experience the problem that files are reported to have a
  4215.      timestamp one hour less than the real time stamp of the file. This also
  4216.      means that when touching a file entry the file will be touched with a
  4217.      wrong time stamp (in out case one hour later than the real time).
  4218.   4. Freja is not available for nti
  4219.  
  4220. ----------------------------------------------------------------------------
  4221.  
  4222. SECTION VII: BETA on HPUX
  4223.  
  4224. ----------------------------------------------------------------------------
  4225.  
  4226. HP01) What are the system requirements to run BETA on HPUX workstations?
  4227.  
  4228. HP9000/700:
  4229.  
  4230.    * RAM: 16 MB, 32Mb recommended.
  4231.    * Disk: 150 MB disk space
  4232.      The installation is approx. 100 MB + documentation approx. 13 MB.
  4233.    * OS: HP-UX 9
  4234.    * X window system (Rel. 11.3 or newer)
  4235.    * Motif 1.2 or later (not required for textual BETA programs)
  4236.  
  4237. ----------------------------------------------------------------------------
  4238.  
  4239. HP02) Why do some callbacks cause "Illegal Instruction" on hpux9pa (using
  4240. v5.0 of the compiler)?
  4241.  
  4242. If the following program is compiled and run on an hpux9pa (HP series 700
  4243. HPPA, HP-UX 9.x) using the BETA compiler version v5.0), it displays a window
  4244. with the text "Timer" in it, prints a random number of 7'digits on the
  4245. screen, and then dies with "Illegal Instruction":
  4246.  
  4247.    ORIGIN '~beta/Xt/v1.8/awenv';
  4248.    --- program: descriptor ---
  4249.    AwEnv
  4250.    (# l: @Command
  4251.         (# init:: (# do 'Timer'->label #)#);
  4252.       t: @Timer
  4253.         (# timeOut:: (# do 10->start; '7'->Put; #) #);
  4254.    do l.init;
  4255.       10->t.start;
  4256.    #)
  4257.  
  4258. The reason for this, is that in v2.6 of the hpux9pa runtime system for BETA
  4259. there is an error, which occurs if a callback is called very soon after it
  4260. is installed. In this case it is called ~10 ms after being installed, and
  4261. almost no other code has been executed in this period of time. In this
  4262. situation an HPPA cache should have been flushed to ensure the correct
  4263. behaviour, but there was an error in the runtime system delivered with
  4264. release 3.0 of the Mjolner System. The solution is to acquire a patched
  4265. runtime system from Mjolner Informatics.
  4266. ----------------------------------------------------------------------------
  4267.  
  4268. SECTION VIII: BETA on Linux
  4269.  
  4270. ----------------------------------------------------------------------------
  4271.  
  4272. Lx01) What are the system requirements to run BETA on Linux machines?
  4273.  
  4274.    * Linux (release 2.0 or later)
  4275.    * CPU: Intel 386/486/Pentium
  4276.    * RAM: 8Mb (16 to 32 recommended)
  4277.    * X11 Release 5 or later
  4278.    * OSF/Motif 1.2 or later (not required just to run compiler)
  4279.    * Programs needed: (g)as, ld, make.
  4280.  
  4281. In lack of Motif libraries, you can use the Lesstif Motif clone. These
  4282. libraries works acceptable, but they are not 100% stabil. See
  4283. BETA-LESSTIF-FAQ
  4284. ----------------------------------------------------------------------------
  4285.  
  4286. Lx02) How to make the BETA compiler version 5.0/5.1 work with Linux ELF
  4287. libraries [corrected in r4.0]
  4288.  
  4289. If you are using a Linux version with support for the ELF libraries, the
  4290. Mjolner System (release 3.1) cannot be used immediately. You will have to
  4291. introduce the following patch:
  4292.  
  4293.   1. Make sure that /usr/lib/crt0.o can be found. E.g. do this:
  4294.  
  4295.         pushd /usr/lib; ln -s /usr/i486-linuxaout/lib/crt0.o; popd
  4296.  
  4297.   2. Make sure the linker is called with "-m i386linux", either by adding
  4298.  
  4299.         LINKOPT linux '-m i386linux';
  4300.  
  4301.      in the top of basiclib/v1.4/private/betaenv_unixbody.bet, or
  4302.      (preferable) by adding this in your .bashrc (or the corresponding stuff
  4303.      in your .tcshrc):
  4304.  
  4305.         export BETALINKOPTIONS='-dc -dp -X -m i386linux';
  4306.  
  4307.      The BETALINKOPTIONS environment variable sets *all* options to the
  4308.      linker, that is why you have to set the other stuff in the variable
  4309.      too.
  4310.  
  4311. Disclaimer: This has not been tried with the Motif libraries, but it ought
  4312. to work.
  4313.  
  4314. Thanks to Erik Ernst <eernst@daimi.aau.dk> and Stephen J Bevan
  4315. <bevan@cs.man.ac.uk> for their investigations on this subject.
  4316. ----------------------------------------------------------------------------
  4317.  
  4318. Lx03) Why does GuiEnv demos segmentation fail? [error in r4.0 & r4.0.1]
  4319.  
  4320. With some Linux distributions, the demos in $BETALIB/guienv/v1.4/demos (aka
  4321. BETALIB/demo/guienv) all fail with a segmentation fault upon startup,
  4322. whereas, e.g. the MotifEnv demos all work correct.
  4323.  
  4324. The reason for this seems to be a buggy gcc used for producing some of the
  4325. files in the BETA releases r4.0 and r4.0.1. This was done at the time that
  4326. the Linux community was switching towards ELF binaries, and possibly this is
  4327. the reason, that gcc produced wrong files. The problem has not been observed
  4328. for release 4.0.2.
  4329.  
  4330. A workaround is to do the following (as the owner of BETALIB):
  4331.  
  4332.         cd $BETALIB/guienv/v1.4/private/X11
  4333.         chmod -R u+w .
  4334.         rm linux/guienv_unix.o
  4335.         rm linux/Canvas.o
  4336.         rm linux/Button.o
  4337.         rm linux/IconButton.o
  4338.         rm linux/ToggleButton.o
  4339.         beta guienv_unixbody
  4340.         chmod -R a-w .
  4341.  
  4342. ----------------------------------------------------------------------------
  4343.  
  4344. SECTION IX: BETA on Silicon Graphics
  4345.  
  4346. ----------------------------------------------------------------------------
  4347.  
  4348. SG01) What are the system requirements to run BETA on Silicon Graphics
  4349. workstations?
  4350.  
  4351.    * RAM: 16 MB, 32Mb recommended.
  4352.    * Disk: 150 MB disk space
  4353.      The installation is approx. 100 MB + documentation approx. 13 MB.
  4354.    * OS: IRIX 5.3 or 6.2 (32 bit)
  4355.    * X window system (Rel. 11.3 or newer)
  4356.    * Motif 1.2 or later (not required for textual BETA programs)
  4357.  
  4358. If you run IRIX 5.3, you must have installed patch 410 from SGI in order to
  4359. fix the linker to generate pure ELF binaries. If you have not applied this
  4360. patch, the linker will fail like this:
  4361.  
  4362.         Unknown flag: -woff
  4363.  
  4364. ----------------------------------------------------------------------------
  4365.  
  4366. SG02) Gnu C Compiler gcc not supported
  4367.  
  4368. You cannot link applications, that specify external OBJFILEs compiled with
  4369. gcc. You must use cc for external object files. If you get an error like:
  4370.  
  4371.         ld: FATAL 2: Internal: at ../commonlib/ld3264/relocate.c \
  4372.         merge_ext returns nil during relocation
  4373.  
  4374. this may be caused by an attempt to link a gcc-produced file into your
  4375. application.
  4376.  
  4377. If you use make files invoked via the MAKE property in a BETA fragment, you
  4378. should use $(CC) instead of a hardcoded C compiler name. The BETA compiler
  4379. sets CC to a proper default value on alle UNIX platforms.
  4380.  
  4381. If you do not know which external object file caused the error to happen,
  4382. you may find out like this:
  4383.  
  4384.   1. Compile the program with beta -p. This will preserve the job-file,
  4385.      containing the link-directive(s) for the program.
  4386.   2. Open the preserved jobfile in a text-editor. The job-file is located in
  4387.      the sgi subdirectory, and has the same name as the application, but
  4388.      with ..job appended.
  4389.   3. Add -v as argument to the last invocation of /bin/ld in the job file.
  4390.   4. Save and execute the job-file.
  4391.  
  4392. When the job-file starts to link the final application, it will now print
  4393. out the name of each file in the last link-directive as they are processed.
  4394. This includes all external object files (specified by OBJFILE in the BETA
  4395. code), and you should thus be able to see what file causes the linker to
  4396. fail: It is likely to be the last one printed out before the linker crashes.
  4397. ----------------------------------------------------------------------------
  4398.  
  4399. SG03) Remember to set LD_LIBRARY_PATH
  4400.  
  4401. After linking shared objects, the LD_LIBRARY_PATH should be set so that it
  4402. includes the directory, where the shared object files reside. The compiler
  4403. will tell which directory this is. If you get an error like:
  4404.  
  4405.         793:./foo: rld: Fatal Error: cannot map soname 'foo1..gso' \
  4406.         using any of the filenames /usr/lib/foo1..gso:/lib/foo1..gso:\
  4407.         /lib/cmplrs/cc/foo1..gso:/usr/lib/cmplrs/cc/foo1..gso: \
  4408.         -- either the file does not exist or the file is not mappable \
  4409.         (with reason indicated in previous msg)
  4410.  
  4411. when running you application (here foo), this may be caused by
  4412. LD_LIBRARY_PATH not being set correctly.
  4413. ----------------------------------------------------------------------------
  4414.  
  4415. SG04) Using BETA on IRIX 6 machines
  4416.  
  4417. On the newest Silicon Graphics OS, IRIX 6, three binary object file formats
  4418. are supported by the OS - old 32 bit format, new 32 bit format and new 64
  4419. bit format. The BETA compiler in release 4.1, however, only supports the old
  4420. 32 bit format - the format also used for IRIX 5.
  4421.  
  4422. There are 3 implications of this:
  4423.  
  4424.   1. Link directive:
  4425.      The compiler automatically fixes the link directive on IRIX 6 machines
  4426.   2. Using BUILD:
  4427.      If you are using BUILD properties, and may thus need to invoke the C
  4428.      compiler, please note that you have to specify the CC environment
  4429.      variable before compiling your BETA program:
  4430.  
  4431.        setenv CC 'cc -32'
  4432.  
  4433.      If you are compiling with beta -d ..., you may also set CC like this:
  4434.  
  4435.        setenv CC 'cc -O2 -32'
  4436.  
  4437.      In a future version of the compiler, this will be done automatically.
  4438.   3. LD_LIBRARY_PATH specification:
  4439.      If your program is linked using shared object files (the compiler will
  4440.      tell you so), as always, you should set LD_LIBRARY_PATH to point to the
  4441.      directory, where the shared object files are places (usually directory
  4442.      sgi). Since the compiler uses old 32 bit object files, it is enough to
  4443.      set LD_LIBRARY_PATH. That is, do not set any of the new
  4444.      LD_LIBRARYN32_PATH or LD_LIBRARY64_PATH variables. If you need to set
  4445.      any of these, then all 3 variables should be set, and the sgi directory
  4446.      should be included in all three.
  4447.  
  4448. ----------------------------------------------------------------------------
  4449.  
  4450. SG05) Limitations, bugs and inconveniences
  4451.  
  4452. SG05.1) Limitations
  4453.  
  4454. The following limitations are currently specific to the SGI implementation:
  4455.  
  4456.   1. Lazy Fetch in persistence is not implemented. This means that the
  4457.      following demos fail:
  4458.  
  4459.               demo/persistentstore/largeRead
  4460.               demo/persistentstore/crossloc
  4461.  
  4462.   2. Check for suspend involving callbacks is not done. If you do a suspend
  4463.      in a callback situation the program is likely to crash.
  4464.   3. It is uncertain if valhalla (v2.2) will work for executables that
  4465.      contain shared object files.
  4466.   4. Integer division by zero will yield unpredictable results (should be
  4467.      caught as an exception as on other platforms). [corrected in r4.1]
  4468.   5. The compiler may sometimes crash during code generation. Normally you
  4469.      can just restart the compilation in this case. [corrected in r4.1]
  4470.   6. There is sometimes a problem with real expressions involving external
  4471.      calls. This is e.g. the case in the demo
  4472.  
  4473.               demo/r4.0/tutorial/SquareRoot
  4474.  
  4475.      which currently does not work on sgi. [corrected in r4.1]
  4476.   7. The following runtime errors may not always result in correct dumps:
  4477.  
  4478.               Repetition subrange out of range
  4479.               Text parameter to C routine too big (max. 1000 bytes)
  4480.  
  4481.   8. Do not specify an output file in the sgi-directory to the compiler.
  4482.      I.e. do not do this:
  4483.  
  4484.                beta -o sgi/foo foo.bet
  4485.  
  4486.      Instead you should do this:
  4487.  
  4488.                beta -o foo foo.bet
  4489.                mv foo sgi/
  4490.  
  4491.      The first method may fail when linking shared. The problem is, that the
  4492.      shared object files are renamed to the file sgi in the sgi directory,
  4493.      and thus the program will fail to execute. [corrected in r4.1]
  4494.   9. Do not use the current notation in fragment paths. E.g. use
  4495.      ~beta/basiclib/v1.5/betaenv instead of ~beta/basiclib/current/betaenv.
  4496.      You may get linker errors, if you use the current notation.
  4497.  
  4498. SG05.2) doGCand scanobjdoes not work
  4499.  
  4500. The pattern doGC in betaenv does not work on SGI. This is used in
  4501. implementation of
  4502.  
  4503.         sysutils/v1.6/scanobjects
  4504.  
  4505. used in the demo
  4506.  
  4507.         demo/sysutils/objinterface/scanobj
  4508.  
  4509. which consequently does not work.
  4510.  
  4511. SG05.3) About ld: WARNING 56: Invalid warning number (133)
  4512.  
  4513. When the beta compiler is used on IRIX 5.3 it may give the warning ld:
  4514. WARNING 56: Invalid warning number (133) at link time. This warning is
  4515. caused by the compiler trying to turn of an IRIX 6.2 warning (number 133),
  4516. which does not exist on IRIX 5.3. The warning can be safely ignored.
  4517.  
  4518. SG05.4) About ld: WARNING 85: definition of vendorShellWidgetClass...
  4519.  
  4520. When compiling awenv programs on SGI, the linker will give the following
  4521. warnings:
  4522.  
  4523. ld: WARNING 85: definition of vendorShellWidgetClass in /usr/lib/libXaw.so
  4524. preempts that definition in /usr/lib/libXt.so.
  4525. ld: WARNING 85: definition of vendorShellClassRec in /usr/lib/libXaw.so
  4526. preempts that definition in /usr/lib/libXt.so.
  4527.  
  4528. These warnings are caused by (intentional) overriding of the X Toolkit
  4529. VendorShell in the SGI athena libraries. The warnings can be safely ignored.
  4530. ----------------------------------------------------------------------------
  4531.  
  4532. SG06) Disclaimer (Slow startup of tools)
  4533.  
  4534. Startup time for SGItools(compiler, frigg, sif, psbrowser, ...) are quite
  4535. significant. This is due to the dynamic linker, and may be fixed in a future
  4536. version.
  4537. ----------------------------------------------------------------------------
  4538.  
  4539. SECTION X: BETA on Sun workstations
  4540.  
  4541. ----------------------------------------------------------------------------
  4542.  
  4543. Sun01) What are the system requirements to run BETA on Sun workstations?
  4544.  
  4545.    * RAM: 16 MB, 32Mb recommended.
  4546.    * Disk: 150 MB disk space
  4547.      The installation is approx. 100 MB + documentation approx. 13 MB.
  4548.    * Sun SPARC/Solaris:
  4549.         o OS: Solaris 2.x
  4550.    * X window system (Rel. 11.3 or newer)
  4551.    * Motif 1.2 or later (not required for textual BETA programs)
  4552.  
  4553. ----------------------------------------------------------------------------
  4554. Jorgen Lindskov Knudsen / Aarhus University / jlk@daimi.aau.dk
  4555. --
  4556. * Jorgen Lindskov Knudsen        | Phone:  +45 8942 3233 Fax: +45 8942 3255 *
  4557. * Dept. of Computer Science      | GSM:    +45 2099 7357                    *
  4558. * Univ. of Aarhus, Building 540  | E-mail: jlknudsen@daimi.aau.dk           *
  4559. * Ny Munkegade, DK-8000 Aarhus C | WWW:    http://www.daimi.aau.dk/~jlk     *
  4560.