home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / beta-language-faq < prev    next >
Text File  |  1997-12-16  |  181KB  |  4,585 lines

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