Home

Viivi User`s Manual

image

Contents

1. gt define distance from origin Bind to the symbol distance from origin lambda x y sqrt x x y y the closure created by the lambda invocation 0 r define distance from origin lambda x y sqrt x x y y 0 pr define 1 lt procedure define gt an R5RS predefined procedure to generate a new binding 1 m lambda x y sqrt x x y y 1 m lambda 2 __ ti lt procedure lambda gt an R5RS predefined procedure to create a closure 3 lt closure x y sqrt x x y y gt a new closure 3 O distance from origin gt lt closure x y sqrt x x y y gt a new binding 4 lt unspecified gt lt unspecified gt gt distance from origin 7 8 To obtain the distance from the origin to the point 7 8 4 r distance from origin 7 8 4 m distance from origin 5 lt closure x y sqrt x x y y gt 541 or T 6s l 6 m 8 7 8 7 Ox gt 7 New bindings x gt 7 and y gt 8 were 7 Oy gt 8 generated as the arguments for the closure 7 m sart x x y y Tt m sqrt 8 lt procedure sqrt gt an R5RS predefined procedure to calculate the square root 8 m x x y y 8 na 9 __ lt procedure gt 9 m x x 9 10 lt procedure gt 10 p K 11 Se 11 E 12 13 49 the evaluation result for 7 7 1
2. Display styles for some objects are as follows e closure lt closure argument part body gt The string expression for the closure defined by lambda n if lt n 1 1 n 6 n 1 is lt closure n if lt n 1 1 n 6 cn 1 gt syntax 18 lt syntax literal pattern gt template gt The string expression for the syntax and defined in R5RS 7 3 Derived expression types is after being formatted lt syntax _ gt t test gt test _ testi test2 gt if test1 and test2 f gt e continuation lt continuation lt ID gt gt An ID number lt ID gt starting from 0 is shown after a colon character which was sequentially assigned to each continuation at its generation time It enables a specific continuation to be identified among multiple continuations t lt continuation 0 gt the continuation firstly generated lt continuation 5 gt the continuation generated as the sixth one 18Using curly braces not as pattern gt template but as pattern gt template is to indicate explicitly that gt is neither a literal nor a symbol included in the user s code 74 11 5 Direct input for objects Viivi can be specified to accept direct expressions for the Scheme objects independent of the symbol binding relationship There are two ways to enable the direct input method e as the command line a
3. gt ara BR BPAAR BR AAR RA A OOO OV W m define test When the first argument for define is a list lambda is implicitly invoked to define a closure let i 0 call cc lambda k set the continuation k set i i 1 i m define lt procedure define gt m lt procedure implicit lambda gt lambda is implicitly invoked let i 0 call cc lambda k set the continuation k set i i 1 i lt closure J A closure was created Get A 0 call cc lambda k set the continuation k gt set i i 1 i gt O test gt lt closure The symbol test was initialized to the closure Get Ci 0 call cc lambda k set the continuation k set i i 1 i gt E lt unspecified gt lt unspecified gt gt ND O O 0 0 0 0 0 0 0 VI VI p test To invoke test rm test lL lt closure Get A 0 call cc lambda k set the continuation k set i i 1 i gt r let Ci 0 call cc lambda k set the continuation k set i i 1 i m let i lt procedure let gt 64 T m o0 8 0 8 O i0 The symbol i was initialized to 0 8 m call cc lambda k set the continuation k 8 m call cc 9 t lt procedure call with current continuation gt 9 m lambda k set the continuation k 9 m lambda 10 lt procedure lambda gt 11 lt closure k set t
4. rm OOreadme txt Viivi jar viivi cd e Unix like platforms with csh family cd Viivi rm OOreadme txt Viivi jar viivi cd e Windows platform gt C gt cd Users ilma Viivi gt del OOreadme txt Viivi jar viivi gt cd 15 2 Deleting Viivi system directory And then delete Viivi system directory VIIVI_HOME where the Viivi system files resided eUnix like platforms with sh family rmdir Viivi eUnix like platforms with csh family rmdir Viivi e Windows platform gt rd C Users ilma Viivi If you cannot delete Viivi system directory with the above operation there may exist files in it After confirming that the files in the Viivi system directory are not important for you delete them and then try to delete Viivi system directory again 85 15 3 Delete user s work directory Do operations similar to those performed on Viivi system directory also on user s work directory The user s work directory may contain important files that the user have created If you have important files in it make backups for the important files before deletion e Unix like platforms with sh family cd ViiviWork rm UNNECESSARY_FILES cd rmdir ViiviWork e Unix like platforms with csh family cd ViiviWork rm UNNECESSARY FILES 4 cd rmdir ViiviWork e Windows platforms gt Ci gt cd Users ilma ViiviWork gt del UNNECESSARY FILES gt cd gt rd Users ilma ViiviWork 15 4 Ret
5. PI gt Viivi predefined constant PI lt procedure cos gt R5RS predefined procedure cos 2 Direct input lt nil gt for the nil object 4 Direct input lt unspecified gt for the lt unspecified gt object d lt N gt Specifies the level for debug trace output The second argument lt N gt is a bit summation of 1 2 and 4 This is equivalent to the procedure invocation viivi set debug level lt N gt No debug trace outputs default 1 Outputs trace line connecting an input S expression before evaluation and the value after evaluation 2 Outputs evaluation count 4 Outputs generations and modifications of binding relations and modifications in structures of data viivi d 7 This turns Viivi into the debugging mode Equivalent to the command line argument option g or to the procedure invocation viivi set debug level 7 dc lt N gt Specifies an integer value lt N gt whose multiples of trace lines are folded and hidden in debug ging mode The number of the folded and hidden trace lines are shown with digital numbers The argument value lt N gt is an arbitrary integer value Eguivalent to the procedure invocation viivi set debug fold multiple columns lt N gt viivi g dc 20 Specifies that the trace lines multiples of 20 are folded and hidden ds lt N gt Specifies an integer value in millisecond lt N gt for which every debug trace output of input S expression or its evaluated value stops
6. PORT Changes standard output destination to the specified file or network port Note that the contents of the specified file will be overwritten when the file already exists To keep the contents of the existing file and to append newly output contents to the end of the file use o option instead viivi 0 output result After changing standard output destination to the file output result input from the standard input port is evaluated When the file output result already existed its contents are over written viivi 0 kotkanpoika 42809 After changing standard output destination to the network port 42809 of the host kotkanpoika input from the standard input port is evaluated Same as viivi o kotkanpoika 42809 viivi foo scm 0 bar data baz scm Firstly input from the file foo scm is evaluated The standard output destination is still the standard output port of the platform Next the standard output destination is changed to the file bar data and finally input from the file baz scm is evaluated When the file bar data already existed its contents are overwritten e o FILE HOST PORT Changes the standard output destination to the specified file or network port Note that the new output contents are appended to the end of the old contents in the file when the specified file already existed To overwrite the contents of the existing file with the standard output contents use 0 option instead viivi o o
7. f otherwise address t if the memory addresses of the argument objects are the same f otherwise value exactness t if both the values and the exactness are the same otherwise only for numbers recursive test compare recursively applying equal Behavior of eq comparing numbers and or characters can be switched in Viivi There are two ways to switch e procedure invocation viivi set eq comparison mode lt N gt e command line argument Q lt N gt The way of comparison tests by eq depends on the value of lt N gt as follows 0 eq compares both the numbers and the characters with their memory addresses default 1 eq compares the numbers with their values eq compares the characters with their values 3 eq compares both the characters and the characters with their values 59 10 2 General timing of argument evaluation in a procedure invoca tion Invoking of a procedure is performed in the following order 1 All the arguments to be evaluated given to the procedure are evaluated from left to right 2 The own function of the procedure is processed 60 11 Unique extensions of Viivi The extensions introduced in this section are uniquely implemented in Viivi and are not defined in R5RS Remark that the Scheme codes using these extensions do NOT basically run on other imple mentations 11 1 Viivi debug trace mechanism Viivi is equipped with a unique feature of debug trace mechanism which vis
8. folder is also used in explanations only for the Windows platforms 12 To create the Viivi system directory using the Unix shells or Windows cmd do the following in your home directory mkdir Viivi for Unix like platforms with sh family is a shell prompt mkdir Viivi for Unix like platforms with sh family is a shell prompt gt md Viivi for Windows platforms gt is a cmd prompt If you are familiar with GUI Graphical User Interface operation you may create the Viivi system directory in your home directory using GUI on your platform 2 3 Downloading Viivi distribution package Download the latest version of the Viivi distribution package from the download site with the top page lt http home j00 itscom net ilma gt The filename of the Viivi distribution package is as viiviPackage XX YY ZZ zip The part XX YY ZZ represents the version number Always use the latest version If your browser supports the function of extracting a zip file at downloading time you can do the installation processes of 2 2 Creating Viivi system directory and 2 4 Extracting Viivi distribution package file simultaneously At the downloading time create a directory named Viivi in the home directory and extract the package zip file into it And then proceed to 2 5 Trying to run Viivi Stage A If you don t extract the Viivi distribution package zip file at the downloading time save the zip file directly into the Viivi sys
9. viiviPackage 00 00 03 zip 2010 10 29 minor revision viiviPackage 00 00 04 zip 2010 10 30 minor revision viiviPackage 00 00 05 zip 2010 10 31 minor revision viiviPackage 00 00 06 zip 2010 11 02 minor revision viiviPackage 00 00 07 zip 2010 11 10 minor revision 9 viiviPackage 00 00 08 zip 2010 11 10 minor revision 10 viiviPackage 00 00 09 zip 2010 11 13 minor revision 11 viiviPackage 00 01 00 zip 2010 11 23 periodic update 12 viiviPackage 00 01 01 zip 2010 11 23 minor revision 13 viiviPackage 00 01 02 zip 2010 11 24 minor revision 14 viiviPackage 00 01 03 zip 2010 11 30 minor revision 15 viiviPackage 00 01 04 zip 2010 12 08 minor revision 16 viiviPackage 00 01 05 zip 2010 12 16 minor revision 17 viiviPackage 00 02 00 zip 2010 12 30 periodic update 18 viiviPackage 00 02 01 zip 2011 01 18 minor revision 19 viiviPackage 00 03 00 zip 2011 01 28 periodic update ANNA RWNEH 20 viiviPackage 00 04 00 zip 2011 02 28 periodic update 21 viiviPackage 00 05 00 zip 2011 03 30 periodic update 22 viiviPackage 00 05 01 zip 2011 04 16 minor revision 23 viiviPackage 00 06 00 zip 2011 04 29 periodic update 24 viiviPackage 00 07 00 zip 2011 06 01 periodic update 25 viiviPackage 00 07 01 zip 2011 06 07 minor revision 26 viiviPackage 00 08 00 zip 2011 07 01 periodic update 27 viiviPackage 00 09 00 zip 2011 08 1
10. 5 tsa ce A KUD t ohoh dla PPh ee Be Aha aa 13 2 Things to be reported examples oe oa a e 14 Updating Viivi 14 1 Update of the system files 2 aaa ed 14 2 Update of the copyright string oaoa a 15 De installing Viivi 15 1 Deleting Viivi system files aoaaa a 15 2 Deleting Viivi system directory ooo a 15 3 Delete user s work directory ooo 15 4 Retracting Viivi environment variable settings o ooo a a 30 30 30 31 32 33 45 46 46 47 49 54 59 59 60 61 61 70 73 74 75 77 80 81 81 81 81 82 82 82 83 83 83 1 Introduction to Viivi 1 1 About this manual This manual summarizes information necessary for using Viivi Please visit Viivi s page from ilma s homepage lt http home j00 itscom net ilma gt for the latest information on Viivi Please read the file OOreadmeEN txt or OOreadmeJP txt included in the Viivi distribution package You need to accept the agreement of Viivi to use the software Viivi This manual does not explain about the Scheme programming language For the Scheme programming language see R5RS the standard language definition or textbooks R5RS is downloadable for ex ample from lt http www schemers org Documents Standards R5RS gt Please send your messages via e mail to lt ilma j00 itscom net gt Even when you don t have your own e mail address you can send e mail to ilma through the Viivi s page Revised Report
11. Create a directory named ViiviWork in the home directory 4 1 Creating Viivi work directory ii Set the environmental variable VIIVI_HOME to the path string for the Viivi system directory Don t forget adding a path separator at the end of the path string 4 2 Setting the environmental variables iii Append the path string for the Viivi system directory to the end of the value of the environmental variable PATH 4 2 Setting the environmental variables Each process will be detailed in the following 4 1 Creating the user s work directory In the home directory which you checked in 2 1 Checking home directory create the user s work directory named ViiviWork for trying Viivi To create the user s work directory on the Unix shells or Windows cmd do the following in your home directory mkdir ViiviWork for Unix like platforms sh family mkdir ViiviWork for Unix like platforms csh family gt md ViiviWork for Windows platforms If you are familiar with GUI Graphical User Interface operation you may create the user s work directory for Viivi using GUI on your platform 20 4 2 Setting the environmental variables In order to boot up Viivi from the user s work directory the environmental variables of the platform VIIVI HOME and PATH will be set to point the Viivi system directory Note that a path separator and for Unix like platforms and Windows platforms respectively is needed
12. Eguivalent to the procedure invocation debug sleep milliseconds lt N gt 50 viivi g ds 3000 Waits 3 seconds after every output in debugging mode F truel false Specifies if the rational number values are output in the floating point number format or oth erwise in the rational number format Eguivalent to the procedure invocation viivi set output in floating point number format t f true Output values of rational numbers in the floating point number format false Output values of rational numbers in the rational number format de fault 8 Sets up a debugging mode in a handy way Eguivalent to the command line argument option d 7 or to the procedure invocation viivi set debug level 7 I true false Specifies if an error in opening a input port given on the command line is ignored and the process is continued The argument value is either true or false There are no equivalent procedure invocations true Ignores the opening port error and proceeds false Reports an error default LANG en jalde Specifies the natural language that the interpreter uses Currently English Japanese and German are supported The argument is one of the character strings representing these lan guages en English ja Japanese de German If the specified language is not available English C locale will be used Note that characters may be possibly garbled in case of specifying a language different from the cur
13. LTS Lucid Lynx OpenJDK Runtime Environment 1 6 0_18 b18 64 bit e Ubuntu 10 04 LTS Lucid Lynx Sun Microsystems JRE 1 6 0_20 b02 32 bit 64 bit e Ubuntu 11 04 Natty Narwhal unknown JRE 64 bit Thanks to g000001 e Ubuntu 11 10 Oneiric Ocelot Oracle JRE 1 6 0 30 b12 32 bit 64 bit e Ubuntu 11 10 Oneiric Ocelot Oracle JRE 1 7 0_03 b04 32 bit 64 bit e OpenSolaris Sun Microsystems JRE 1 6 0_20 b02 32 bit 64 bit e Openlndiana 15la Oracle JRE 1 7 0_03 b04 32 bit e Solaris 10 10 09 Sun Microsystems JRE 1 6 0 20 b02 32 bit 64 bit e Solaris 11 11 11 Oracle JRE 1 6 0_31 b04 64 bit e Solaris 11 11 11 Oracle JRE 1 7 0 03 b04 64 bit 11 2 Downloading and Installing Viivi In this section downloading and installing processes of Viivi will be explained The user is assumed to be familiar with the operations with files and directories on the platform 2 0 Outline of Viivi installation processes Briefly speaking beforehand the processes to install Viivi after downloading the package zip file are as follows i Create a directory named Viivi in the home directory 2 1 Checking home directory and 2 2 Creating Viivi system directory ii Extract the Viivi distribution package zip file into the created directory 2 3 Downloading Viivi distribution package and 2 4 Extracting Viivi distribution package Each process of downloading and installing Viivi is detailed in th
14. correctly by editing the following appli cable points In case of spoiling the boot up script file by editing it in a wrong way you can do it over from the 17 beginning by removing the kaput file and then copying the backup file that with the filename ending with ORG to a new unedited boot up script file 3 3 1 Editing points in the boot up script file for Unix like platforms e Does the boot up script file have an executable attribute If not set it with the command chmod ugo x viivi e Is the path following to on the first line in the boot up script file correctly set to the shell If not edit it correctly as bin bash usr local bin tcsh etc 3 3 2 Editing points in the batch file for Windows platforms The batch file must work as it is for the Windows platforms Check the batch file viivi bat if it is not kaput 3 3 3 Editing points common for all the platforms If you see the error messages such as Error occurred during initialization of VM See below for the second line error message just after you run the boot up script you may need to change the assignments of the memory capacity for Viivi The measures depend on the second line error message e Too small initial heap for new size specified You may need to increase the memory capacity assigned for Viivi e Could not reserve enough space for object heap You may need to decrease the memory capacity assigned for Viivi Each script fil
15. how to edit the Viivi configuration file for customizing Viivi The agreement appearing at every boot time must be annoying the most users Let s customize Viivi to suppress the opening message 5 0 Outline of the processes editing the configuration file Briefly speaking the processes beforehand i Copy the configuration file viivi conf in Viivi system directory into the user s work directory 5 1 Copying the configuration file ii Edit the configuration file viivi conf in the user s work directory 5 2 Editing the configu ration file Each process will be detailed in the following 5 1 Copying the configuration file The original configuration file for Viivi is the file viivi conf Don t edit this original file but leave it as it is The editable configuration file is made by copying the original file into the user s work directory To make a copy of the original configuration file viivi conf into the user s work directory do the following operation in the user s work directory cp Viivi viivi conf for Unix like platforms sh family fh cp Viivi viivi conf for Unix like platforms csh family gt copy Viivi viivi conf for Windows platforms If you are familiar with GUI Graphical User Interface operation you may copy the configuration file viivi conf using GUI on your platform 5 2 Editing the configuration file Edit the configuration file viivi conf in the user s work directory
16. input as follows java jar Viivi jar for Unix like platforms with sh family java jar Viivi jar for Unix like platforms with csh family gt java jar Viivi jar for Windows platforms If Viivi booted up correctly you see agreement on the display Please read it If you see Viivi s prompt gt at the lowest line on the screen Viivi is now running When you see some error message despite that JRE is correctly installed try the operation in 2 6 Troubled Try to assign memory capacity Now let s try to input an expression 30 Type 3 and next 0 from keyboard or other input device and then push Enter or Return key or do equivalent action If the screen displays like gt 30 30 gt then Viivi is working correctly This shows that an S expression 30 was read by the interpreter and that a value 30 was returned After Viivi is confirmed to run try to escape from the interpreter by inputting exit Don t forget to push Enter Return key following to it Seeing the agreement every time must be annoying We will configure it afterwards not to show it at the boot time For a while you can suppress the agreement by giving Viivi a command line argument option v 4 at the boot time java jar Viivi jar v 4 14 gt exit A farewell message is shown here for Unix like platforms with sh family The prompt of the platform appearing below the farewell message shows that you have escaped from Viivi When
17. on the Algorithmic Language Scheme 6 1 2 A tour guide to this manual e To grasp the outline of Viivi gt Please continue reading this Section 1 e To install Viivi The procedures described Sections from 2 to 5 fully install Viivi However it is still possible for you to continue to use Viivi even if you suspend the installation sequence at the end of an arbitrary section when you don t understand what to do with the remaining procedures or when you don t want to proceed any more from some reason e To know about the files in the Viivi package Please read Section 6 e To know the functions and the usage of Viivi gt Please read Sections from 7 to 12 Note that without reading the detailed descriptions you will be able to use Viivi as an R5RS compliant Scheme interpreter in an interactive way e To make bug reports or comments on Viivi gt Please read Section 13 e To update or delete Viivi gt Please read Section 14 or Section 15 The word fully means that the installation procedures allow you to boot up Viivi 1 only with the command viivi 2 in an arbitrary directory 3 without showing the agreement at the boot up time 3In that case some inconvenience will be left about 1 2 or 3 7 1 3 What is Viivi Viivi is a multi natural lingual R5RS compliant Scheme programming language interpreter for JVMs It has been implemented as ilma s private
18. platforms When you assigned small memory capacities of course Scheme programs which requires large memory capacities does not run Tune the values of memory assignment for your platform and your purpose through the practical experience with Viivi Once you succeeded in booting up Viivi with the customized boot up script file it is recommended to make a backup file for it so as not to make it overwritten at the update time To do so enter the following command in the Viivi system directory cp viivi viivi SAVE for Unix like platforms with sh family cp viivi viivi SAVE for Unix like platforms with csh family gt copy viivi bat viivi bat SAVE for Windows platforms If you are familiar with GUI operation you may create the backup file using GUI See 6 3 viivi and viivi bat for details of the boot up script files 19 4 Separating Viivi work directory In this section a work directory where the user tries Viivi will be separated from the Viivi system directory where the system files Viivi resides so as to use Viivi safely and conveniently In this manual these two directories are assumed as e Viivi system directory a directory named Viivi in the home directory You have already created it e the user s work directory for Viivi a directory named ViiviWork in the home directory You are going to create it 4 0 Outline of processes separating Viivi work directory Briefly speaking the processes beforehand i
19. project using Java programming language from scratch based on a unique Object design aiming to be fully compliant with R5RS Viivi has the following features e Specs on the core of the R5RS language processor Uniquely designed and implemented with no references at all to the internals of other implementations Being written with Pure Java language it is expected to run similarly on any kinds of platform equipped with a JVM only if memory storage is large enough Supplementary Scheme programs are not required Fully supports the features defined in R5RS including multiple generations and restarts of continuations All the numerical types defined in R5RS integers of unlimited length rational numbers floating point numbers 64bit precision and complex numbers are supported Numerical calculations are performed as exactly as possible e g when both the real and the imaginary parts of the given complex numbers are all rational then arithmetic calculations are performed keeping both the parts rational when all the complex numbers are given in the polar format then multiplications and divisions are performed in the form of polar format without being expanded into Descartes format scheme report environment and null environment accept only an argument of 5 Namely only RS5RS is currently supported Older and newer versions such as R4RS or R6RS are not supported Arguments to be evaluated for a pr
20. set the continuation k gt 46 set i i 1 46 i gt 46 r let Ad 0 46 call cc lambda k set the continuation k 46 set i i 1 46 i 46 r let 47 lt procedure let gt 47 m o 48 0 48 Qi 0 The symbol i was initialized to 0 since test was invoked from the beginning 48 r call cc lambda k set the continuation k 48 r call cc 49 lt procedure call with current continuation gt 49 m lambda k set the continuation k 49 m lambda 50 lt procedure lambda gt 51 lt closure k set the continuation k gt 51 O k gt lt continuation 1 gt The symbol k was init ed to another cont with i gt 0 lt 51 m set the continuation k lt 51 m set lt 52 lt procedure set gt lt 52 rk lt 53 lt continuation 1 gt lt 53 the continuation gt lt continuation 1 gt The bound value of the symbol lt 53 lt unspecified gt the continuation was changed lt 54 lt unspecified gt to the continuation at the current point lt 54 r set i ti 1 54 m set 55 lt procedure set gt 55 r ti 1 66 B B B B B B B B B 4 gt 55 56 56 57 57 58 59 59 60 60 61 61 62 62 62 63 64 64 64 64 65 65 65 66 66 67 67 68 69 69 70 70 71 71 72 123 12
21. to the previous base level can be performed by a procedure invocation viivi set pop base level or by a command line argument option Bx 1 A group of the objects defined in R5RS as syntax and so forth 2 library syntax 4 procedure 8 library procedure 16 optional procedure 32 A group of Viivi specific objects viivi set push base level 5 Generates a new base level only with the objects defined in R5RS as syntax and procedure and sets it as the current base level o remove predefined symbol lt PREDEFSYM gt The second argument lt PREDEFSYM gt is a symbol which is to be removed from the current base level The symbol must be an appropriate one that is to have been bound to an object prepared in the interpreter When the symbol lt PREDEFSYM gt had a binding on the current base level the binding is removed from the base level When the symbol lt PREDEFSYM gt did not have a binding on the current base level it does nothing There are no corresponding command line argument options at the present moment viivi set append predefined symbol cos When the symbol cos had a binding on the current base level to the procedure object lt procedure cos gt defined in R5RS to obtain the value of a mathematical function co sine then the binding is removed from the current base level o return value lt N gt Specifies the values returned by the procedures define and set The second argument lt N gt is an integer value
22. with your favorite editor at the following part viivi set verbose level 5 replace 5 with 3 to suppress opening message in the original form into viivi set verbose level 3 replace 5 with 3 to suppress opening message and then save overwrite it with the same name 5 3 Trying to run Viivi Stage D Try to boot up Viivi and if you see only Viivi s prompt without preceding messages then you have succeeded in customizing Viivi From now on you can 23 boot up Viivi without displaying the opening messages Congratulations Now you have completed all the processes of Viivi installation You will be able to boot up Viivi any time you like using the command viivi Remember that you are strongly recommended to try Viivi in the user s work directory to reduce risks See 6 4 viivi conf and viivirc for details of the configuration files 5 4 Troubled Do it over from copying the configuration file If you failed in editing the configuration file viivi conf in the user s work directory and Viivi does not boot then you can start it over from 5 1 Copying the configuration file 24 6 Viivi System Files Viivi system files are the files included in the Viivi distribution package Each of them is explained in this section 6 1 OOreadme txt Text files including a brief explanations and the latest information about Viivi and the distribution package OOreadmeEN txt read me file written in English OOreadmeJP
23. 0 periodic update 28 viiviPackage 00 09 01 zip 2011 08 11 minor revision 29 viiviPackage 00 10 00 zip 2011 08 31 periodic update 30 viiviPackage 00 10 01 zip 2011 09 02 minor revision 31 viiviPackage 00 10 02 zip 2011 09 08 minor revision 32 viiviPackage 00 11 00 zip 2011 10 02 periodic update 33 viiviPackage 00 12 00 zip 2011 11 05 periodic update 34 viiviPackage 00 13 00 zip 2011 12 21 periodic update 35 viiviPackage 00 13 01 zip 2011 12 29 minor revision 36 viiviPackage 00 13 02 zip 2011 12 30 minor revision 37 viiviPackage 00 14 00 zip 2012 01 31 periodic update 38 viiviPackage 00 14 01 zip 2012 02 21 minor revision 39 viiviPackage 00 14 02 zip 2012 03 05 minor revision 40 viiviPackage 00 15 00 zip 2012 03 18 periodic update Notation in the manual e Different character fonts are used for different descriptions Hello everyone Normal character font is used for explanation echo Hello true Hackers URLs File names command strings file contents examples of screen display etc are shown with Courier font Viivi ilma Proper nouns concerning with the software that is explained in this manual are shown with Helvetica font e Simplifying notations are used in the explanations about Scheme procedure invocations and command line argument options of Viivi ABC ABC can be omitted N N can be omitted FILE S Represents either FILE or FILES PQR XYZ Represents either PQR or XYZ To
24. 0 1 2 or 3 representing the values define and set return This is equivalent to the command line argument option R lt N gt 43 0 Both define and set return lt unspecified gt R5RS compatible default 1 Only define returns the newly bound value Only set returns the newly bound value 3 Both define and set return the newly bound values viivi set return value 2 Specifies that the procedure set returns the newly bound value The procedure define returns lt unspecified gt usage Shows usage of viivi set It does not take the second argument Returns lt unspecified gt Same as help verbose level lt N gt Specifies verbosity for the output The second argument lt N gt is an integer value 0 1 2 3 4 or 5 representing the output verbosity This is equivalent to the command line argument option v lt N gt Does not output lt unspecified gt Does not output prompt Outputs only error messages Outputs also warning messages Outputs title at the boot time Outputs agreement at the boot time oP WNR O viivi set verbose level 2 Specifies a silent verbosity for the output suppressing warning messages 44 8 3 Procedures for random numbers These procedures are implemented especially to write game programs Since they are not defined in R5RS they are currently implemented in the style of Java API The style can be changed in the future versions according to new Scheme standards e ran
25. 1 Outputs trace lines connecting an input S expression before evaluation and the value after evaluation 2 Outputs evaluation counts 4 Outputs generations and modifications of binding relations and modifications of the internal structures of data o debug sleep milliseconds Returns an integer value for which output stops in millisecond after every debug trace output both for input S expression and for its evaluated value o direct input objects Returns the bit summation of integer values which represent the kinds of object that can be input directly No direct input is accepted default 1 Direct input for the predefined objects constants and procedures lt constant PI gt Viivi predefined constant PI lt procedure cos gt R5RS predefined procedure cos 2 Direct input lt nil gt for 0 4 Direct input for lt unspecified gt for lt unspecified gt o eg comparison mode Returns an integer value 0 1 20r 3 representing eg compares numbers and or char acters using whether their memory addresses or with their values 34 0 eg compares both the numbers and the characters using their memory ad dresses default 1 eg compares the numbers using their values eg compares the characters using their values 3 eg compares both the characters and the characters using their values o eval argument number Returns an integer value 1 2 or 3 representing argument number accepted to eval invocation 1 One
26. 29 i 2 The binding was modified to i gt 2 30 lt unspecified gt It reflects to the environment of the continuation bound to the continuation 30 ji 31 2 31 2 32 2 2 gt 32 r the continuation 32 pr the continuation 33 lt continuation 0 gt 34 mr lt continuation 0 gt The continuation was invoked 65 34 lt unspecified gt 34 r set i ti 1 34 rm set 35 lt procedure set gt 35 po Ged al 35 pe 36 lt procedure gt 36 pr 4 37 02 The invoked continuation has an environment with the binding i gt 2 37 otimaal 38 jalad E 39 5 39 i 3 The binding was modified to i gt 3 40 lt unspecified gt It reflects to the environment of the continuation bound to the continuation 40 asud gt 41 41 3 42 3 3 gt 42 define another continuation the continuation 42 pr define 43 lt procedure define gt 43 pr the continuation 44 lt continuation 0 gt 44 O another continuation gt lt continuation 0 gt The symbol another continuation was 45 lt unspecified gt initialized to the continuation being lt unspecified gt bound to the symbol the continuation gt 45 m test To invoke test from the beginning 45 m test 46 lt closure 46 Get Ci 0 46 call cc lambda k
27. 3 T3 74 74 74 74 75 75 75 76 76 TT TE 78 79 79 80 80 81 81 82 lt procedure gt i PI Tit 0 1 1 i t The binding was modified to i 1 lt unspecified gt It reflects to the environment of the continuation bound to the continuation fot al peat r the continuation m the continuation lt continuation 1 gt mr r lt continuation 1 gt The continuation was invoked lt A lt unspecified gt r set i i 1 m set lt procedure set gt r ai 1 lt procedure gt fe 1 rTA 1 a 2 i 2 The binding was modified to i gt 2 lt unspecified gt It reflects to the environment of the continuation bound to the continuation t 21 n id sd 12 r another continuation To invoke a continuation bound in 42 44 to another continuation r another continuation This continuation has an environment with a binding i gt 3 lt continuation 0 gt mr r lt continuation 0 gt The other continuation was invoked lt A lt unspecified gt r set i ti 1 rm set lt procedure set gt m i 1 m lt procedure gt m i The invoked continuation has an environment with the binding i gt 3 3 je 1 i 4 The binding was modified to i gt 4 lt unspecified gt It reflects to the environment of th
28. 3 m yy 13 m 14 lt procedure gt 14 i y 15 8 15 Fy 16 Sr 17 64 the evaluation result for 8 8 18 226143 the evaluation result for 7 7 8 8 18 10 63014581273465 the evaluation result for sqrt 7 7 8 8 19 10 63014581273465 Floating point number calculation in Viivi is 10 63014581273465 gt always performed with a 64 bit precision The following Example 3 and Example 4 are the exceptions showing the trace lines with their ends not connected to S expressions or their evaluated values 63 The sample codes on lt http en wikipedia org wiki Continuation gt were written in the file Continuation scm and then were fed to Viivi with the debugging flag g Remark e As the codes invoke continuations with no arguments you need to make beforehand Viivi accept the continuation invocation style using either of the following 0 O the command line argument option C 0 Here we use this the procedure invocation viivi set continuation argument number 0 e It was partly edited at long lines and at the parts to be explained viivi C 0 g Continuation scm gt w NNihRhROO r define the continuation f e r define s lt procedure define gt om gt f O the continuation gt f The symbol the continuation was newly bound initialized to f lt unspecified gt lt unspecified gt
29. Multilingual RSRS Compliant Scheme Interpreter for JVMs Viivi User s Manual manual version 00 15 c for Viivi version 00 15 02 and newer ilma URL lt http home j00 itscom net ilma gt e mail lt ilma j00 itscom net gt May 3 2012 The manual is currently available in English and Japanese Copyright c 2010 2012 ilma lt ilma j00 itscom net gt All rights reserved Agreement All rights relating to this manual belong to ilma lt ilma j00 itscom net gt the author of the software Viivi It is recommended to read this manual before using the software Viivi This manual is in writing and editing and hence may contain errors Before doing operation following to the descriptions in this manual make enough confirmation that the operation is correct and suited to your environment The author is exempt from the responsibility for any kind of disadvantage caused by this manual and related files or operations whether the description in this manual is correct or not The user is expected to report errors and problems of this manual to the author when the user finds them The copyright of the parts modified based on users reports still belongs to the author This manual must be obtained directly from the download site of the author This manual must be used in the form as it is distributed Any kind of modification on any part of or whole of this manual is prohibited Any kind of citation from any part of or whole of this manual without p
30. Peter scm sequen tially Equivalent to the command line argument options viivi i Heidi scm i Klara scm i Peter scm 57 viivi 17771 Paul scm 17772 Elizabeth scm Reads and evaluates the input from the network port 17771 of the localhost the file Paul scm the network port 17772 of the localhost and the file Elizabeth scm sequentially Equivalent to the command line argument options viivi i 17771 i Paul scm i 17772 i Elizabeth scm 58 10 RS5RS specifications of Viivi 10 1 Equality testing procedures of Viivi RSRS allows a little variance in the implementations for eq eqv equal Here summarize the behaviors of the equality testing procedures in Viivi Table 1 Summary of equality testing procedures nil empty list type type type unspecified type type type EOF End Of File type type type symbol string expression string expression string expression boolean value value value number address value exactness value exactness value exactness eq is switchable character address value value value eq is switchable string address value value vector address address recursive test pair address address recursive test OTHERS address address address switchable for number and character type tt if the types of the argument objects are the same tf otherwise string expression t if the string expressions are the same f otherwise only for symbols value tt if the values are the same
31. Send your bug report via e mail to the e mail address lt ilma0j00 itscom net gt from your own e mail address or through Send an e mail to ilma on ilma s homepage lt http home j00 itscom net ilma index html gt Don t forget to write your e mail address or a contact method Without it I cannot reply to you Writing viivi bug report at the title of the e mail is helpful to distinguish the mails for bug reports from those of other messages The Scheme source code that is attached to your bug report is used only for debugging Viivi implementation But I may not be able to protect the source code from others Therefore I would like to ask you to send me not an important source code but an insignificant one generating an equivalent problem 13 2 Things to be reported examples 37 An exception of the JVM is directly shown as Exception occurs Such an Exception generated during Viivi running must have been caught and processed as an error by Viivi But it was not handled correctly in this case Especially wrong Scheme codes or wrong operations may make Viivi down dumping exceptions Please report the Exception message A system error ID F is shown It means that an error occurred which should not occur and it was not handled correctly in this case Please report the system error ID An error message is shown for input which should be evaluated normally It may be a bug A result different from a
32. argument only the S expression of the evaluation target and no environ ment specifier eval 20 30 2 Two arguments R5RS compatible default eval 20 30 scheme report environment 5 3 Either one argument or two arguments o flush each output Returns a boolean value t or f if an output port is flushed at every writing to the output port tt Flushes the output port every time Flushes the output not every time depending on the platform o help Shows available symbols to be used as lt VIIVI PROPERTY SYMBOL gt Returns lt unspecified gt Same as usage o language Returns the character string representing the current language used in the interpreter en English ja Japanese de German o output in floating point number format 39 Returns a boolean value representing if the rational number value is output in the floating point number format or otherwise in the rational number format tt The rational number values are output in the floating point number for mat f The rational number values are output in the rational number format default o overwrite output files Returns a boolean value representing if output files are opened in overwrite mode or oth erwise in append mode Output files are opened in the append mode by default Output to the network ports is not affected by this setting The command line argument options 0 or o can be also used but the later designatio
33. at the end of the path string set to the environmental variable VIIVI_HOME If you are familiar with GUI operation you may set the environmental variables using GUI on your platform e Unix like platforms sh family Append the following four lines at the end of the environment configuration file profile bashrc or kshrc in the home directory VIIVI_HOME Viivi Don t forget at the end of the line export VIIVI_HOME PATH PATH VIIVI_HOME export PATH And then read in the environment configuration file to activate the edited environmental settings profile OT bashrc OT kshrc e Unix like platforms csh family Append the following two lines at the end of the environment configuration file login or cshrc in the home directory setenv VIIVI HOME Viivi Don t forget at the end of the line setenv PATH PATH VIIVI_HOME And then read in the environment configuration file to activate the edited environmental settings source login or source cshrc e Windows platforms For Windows platforms the standard GUI method is shown here If you know how to set the environmental variables in the Windows platforms by editing system files directly you may do it at your own risk The following assumes the user s home folder as C Users ilma Replace the underlined parts according to your environment Start gt Control Panel gt System and Maintenance gt Sy
34. ax 4 procedure 8 library procedure 16 optional procedure 32 A group of Viivi specific objects viivi B 5 Generates a new base level only with the objects defined in R5RS as syntax represented with 1 and procedure represented with 4 and uses it as the current base level e Bx Discards the current base level and returns to the previous base level Takes no second argument When the current base level was the first one generated at the boot time it does nothing This is equivalent to the procedure invocation viivi set pop base level viivi B 5 i testi scm B 31 i test2 scm Bx i test3 scm Firstly generating a new base level say B5 of ensemble of the predefined object groups defined in R5RS as syntax represented with 1 and procedure represented with 4 and setting it as a current base level input from test1 scm is evaluated And next generating a new base level say B31 of all the object groups predefined in R5RS 31 1 2 4 8 16 and setting it as a current base level input from test2 scm is evaluated Finally after discarding the latest base level B31 and getting back to the previous base level B5 input from test3 scm is evaluated e D lt N gt Specifies the bit summation lt N gt of integer values 1 2 or 4 representing the kinds of object 49 that can be input directly No direct input is accepted default 1 Direct input for the predefined objects constants and procedures lt constant
35. cation viivi set pop base level o using the command line argument option Bx Base levels generated during run time can be abandoned although only the first base level generated at boot time cannot be abandoned On the current base level a predefined object can be individually appended and removed It is performed by invoking the procedure viivi set Currently no corresponding command line argument options are prepared The predefined object is specified with the symbol lt PREDEFSYM gt representing it Don t forget to quote the symbol when it is directly specified as the second argument for the procedure lt procedure viivi set gt is always evaluated e To append an individual predefined procedure on the current base level use the S expression viivi set append predefined symbol lt PREDEFSYM gt e To remove an individual predefined procedure on the current base level use the S expression viivi set remove predefined symbol lt PREDEFSYM gt viivi set append predefined symbol cos When the symbol cos did not have a binding on the current base level to the procedure object lt procedure cos gt defined in R5RS to obtain the value of a mathematical function cosine then the symbol is newly bound to the object lt procedure cos gt on the current base level Symbols with bindings on the currently base level can be shown by the procedure invocation viivi property predefined symbols The ever built in system pr
36. dom lt N gt Being invoked with the argument lt N gt of a positive integer value it returns a pseudo random integer 7 such as 0 lt 5 lt lt N gt Being invoked with no arguments it returns a pseudo random floating point number r such as 0 lt r lt 1 0 random 100 Returns a pseudo random integer value 7 such as 0 lt i lt 99 5 random Returns a pseudo random floating point number value r such as 0 lt r lt 5 0 e random boolean Returns a pseudo random boolean value of t or f e random gaussian Returns a pseudo random value of floating point number in the normal distribution of zero mean value and one standard deviation e random seed lt N gt When it is invoked with a 64 bit integer argument value lt N gt it uses lt N gt as a seed for the pseudo random number generation When it is invoked without arguments a 64 bit integer value converted from the clock time at the invocation is used as a seed for the pseudo random number generation This procedure is invoked once before using other random number procedures if the user explicitly initializes the random number generator When this procedure is not invoked explicitly the initialization at the boot time is used random seed 16741 Integer value 16741 will be used as a random seed random seed An integer converted from the invocation clock time will be used as a random seed 45 9 Viivi command line argument options After pr
37. e continuation bound to another continuation ri 4 4 4 Interpreter terminated normally 67 A simple sample code using map is input in the debugging mode gt map lambda x y x y 4 2 3 4 0 map lambda x y x y quote 1 2 quote 3 4 0 pr map 1 lt procedure map gt 1 lambda x y x y 1 m lambda 2 _ lt procedure lambda gt 3 lt closure x y x y gt 3 quote 1 2 3 quote 4 __ lt procedure quote gt 5 4 2 5 m quote 3 4 5 m quote 6 __ lt procedure quote gt 7 68 4 TS Ox gt 1 x was initialized to 1 process 1 lt B Te O y gt 3 y was initialized to 3 process 1 lt B 7 x y process 1 lt B 7 process 1 lt B 8 lt procedure gt process 1 lt B 8 x process 1 lt B 9 L 1 process 1 lt B 9 y process 1 lt B 10 23 process 1 lt B 10 1 3 the result for 1 3 process 1 lt B 10 Ox 2 x was initialized to 2 process 2 lt B 10 O yo4 y was initialized to 4 process 2 lt B 10 m x 9 process 2 lt B 10 y process 2 lt B 11 lt procedure gt process 2 lt B 11 x process 2 lt B 12 2 process 2 lt B 12 E process 2 l
38. e following Specific operations will be shown for some major platforms Unix like platforms with sh family sh bash and ksh including Mac OS Unix like platforms with csh family csh and tcsh and Windows platforms Please do those operations after confirming that they are correct and suited to your platform For other kinds of platform please do corresponding operations after confirming that they are correct and suited to your platform If your browser supports the feature of extracting a zip file at downloading time you can make the processes i and ii simultaneously at the downloading time If it is the case proceed to 2 3 Downloading Viivi distribution package 2 1 Checking home directory First of all please check your home directory on the platform The home directory for a user whose account name is ilma for example may be as follows depending on the platform types home ilma for Unix like platforms home teamK ilma for Unix like platforms They may be represented as or HOME in the following C Users ilma for Windows platforms D ilma for Windows platforms 2 2 Creating Viivi system directory In the home directory which you have checked in 2 1 Checking home directory create the Viivi system directory named Viivi 8The word folder is usually used for the Windows platforms In this manual however the word directory is generally used both for Unix like and Windows platforms The word
39. e has a main line assigning the memory capacities The boot script file viivi for Unix like platforms is exampled in the following java Xss64m Xms64m Xmx256m jar VIIVI_HOME Viivi jar The first three arguments for the command java represent memory capacity assignments for different purposes Xss64m to assign 64MB for the JVM stack Xms64m to assign 64MB for the JVM minimum heap Xmx256m to assign 256MB for the JVM maximum heap 18 Please try to adjust the values for your platform so as to boot up Viivi correctly You may need to decrease each memory capacity smaller for the platforms with smaller memory capacities such as PDAs and cellular phones The author tried to reduce the memory capacity assignments to the minimum values on the PC platform using Solaris and Ubuntu The minimum values to boot up Viivi were about java Xss2m Xms2m Xmx2m jar Viivi jar for 32 bit JVM java Xss4m Xms4m Xmx4m jar Viivi jar for 64 bit JVM The main line assigning the minimum memory capacity for 32 bit JVM is written in the boot up script file in a commented form java Xss2m Xms2m Xmx2m jar VIIVI_HOME Viivi jar Uncomment it by removing the at the head of the commented line and comment the currently active line by putting a at the head and you can use the boot up script file for minimum memory configurations This is an example for Unix like platforms Use rem in place of to make a line commented for Windows
40. e head of the argument 10 20 30 40 50 60 70 80 given for macro G in the user code The second macro pattern e4 matches 10 20 30 40 50 60 70 80 from the head of the rest argument 10 20 30 40 50 60 70 80 given for macro G in the user code The third macro pattern e5 e6 matches zero elements because no arguments are left in the user code And therefore the pattern matching succeeds as the result 3 When an ellipsis of a scalar element appears in a list or a vector within a macro pattern as shown in the above examples F and G such as e1 or e4 in the respective examples such an ellipsis pattern of a scalar element will match all the rest elements given in the user code Therefore to investigate exactly the internal structures of ellipsis appearing in series in a list or a vector of a macro pattern ellipsis patterns with elements of complex internal structures need to be put ahead of the list vector and a scalar element need be put at the end of the list vector as shown in the next example macro pattern of macro H _ el e2 e3 e4 e5 e6 user code macro H 10 20 30 40 50 60 70 80 90 100 The first macro pattern e1 e2 e3 matches 10 20 30 the longest part repeating the pattern e1 e2 e3 from the head of the argument 10 20 30 40 50 60 70 80 90 100 given for macro H in the user code The second macro pattern e4 e5 matches 40 50 60 70 from the head of
41. e in R5RS use an integer value N integer 39 that is the bit summation of those excluding integer values 8 and 16 representing library procedure and optional procedure respectively Specification generation and deletion of a base level can be performed in the following ways e To specify a base level of lt N gt at boot time 17The user may find stupid the too much structure of a stack for the multiple base levels Only a single set of the base level might be enough This function is just a result of the stack structure convenient for implementing a flexible boot up process of Viivi that is left as it is 70 o in the configuration files viivi set push base level lt N gt o at the head on the command line argument B lt N gt When there exist multiple configuration files only the base level specified in the latest file is effective When there exist multiple descriptions in a configuration file only the final description is effective When a base level specification is provided on the command line the specified base level will be generated and pushed on top of the default base level unless it is specified at the first command line argument option e To generate a new base level of lt N gt during run time o using the procedure invocation viivi set push base level lt N gt o using the command line argument option B lt N gt e To abandon the current base level during run time o using the procedure invo
42. e this style was adopted by default in Viivi The user can choose a robust usage with Viivi s closure rather than a flexible one using the direct input for the objects presented here 76 11 6 Investigating macro pattern matching with the longest match ing method When multiple ellipses appear in series within a list or a vector in syntax definitions Viivi investigates macro pattern matching with the longest matching method macro pattern of macro A _ el e2 e3 user code macro A 10 20 30 40 50 60 70 The macro pattern e1 e2 matches 10 20 30 40 the longest part repeating the pattern e1 e2 from the head of the argument 10 20 30 40 50 60 70 given for macro A in the user code And the rest macro pattern e3 matches 50 60 70 in the rest of the user code And therefore the pattern matching succeeds as the result macro pattern of macro B _ el e2 e3 user code macro B 10 20 30 40 50 60 The macro pattern e1 e2 matches 10 20 the longest part repeating the pattern e1 e2 from the head of the argument 10 20 30 40 50 60 given for macro B in the user code And the rest macro pattern e3 matches 30 40 50 60 in the rest of the user code And there fore the pattern matching succeeds as the result macro pattern of macro C _ el e2 e3 e4 e5 e6 e7 user code macro C 10 20 30 40 50 60 The first macro pattern e1 e2 matches zero elem
43. ead viivi property eval argument number Each property name lt VIIVI PROPERTY SYMBOL gt and the respective function are listed below o base level Returns an integer value representing the current base level which is a bit summation of the following elements 1 A group of the objects defined in R5RS as syntax and so forth 2 library syntax 4 procedure 8 library procedure 16 optional procedure 32 A group of Viivi specific objects Note that this option must be used just for reference Actual predefined symbols may have been appended removed using append predefined symbol and or remove predefined symbol on the current base level Use predefined symbols to see the individual predefined sym bols o continuation argument number Returns an integer value 0 1 or 2 representing argument number accepted to continuation invocation Viivi processes the continuation invocation with no arguments as a continuation invocation with an argument of lt unspecified gt 0 no arguments 1 one argument R5RS compatible default 2 either no arguments or one argument 33 o copyright Returns the string of the copyright description of Viivi o debug fold multiple columns Returns an integer value whose multiples of trace lines are folded and hidden in debug trace output o debug level Returns an integer value representing debug output level which is a bit summation of the following elements No debug trace outputs
44. em as boot up script files in the following Select one appropriate to your platform Even in case that you have a platform which does not run these script files it must not be difficult to write your own boot up script file based on the existing ones 3 2 Trying to run Viivi Stage B The distributed boot up script files must work as they are for most platforms After moving into the Viivi system directory try to run the boot up script file by inputting the following command to the prompt of the platform viivi for Unix like platforms sh family viivi for Unix like platforms csh family gt viivi for Windows platforms If Viivi s prompt appears after the agreement as you saw in 2 5 Trying to run Viivi Stage A then you can continue to use the boot up script file After checking that correct values are returned by inputting 30 or something else quit by inputting exit In case that some error occurs in spite of the correct operations with the appropriate boot up script file you may need to make some modifications on it Please proceed to the next section 3 3 Troubled Try to edit the boot up script file When the boot up script file works for booting up Viivi please proceed to 4 Separating Viivi work directory to use Viivi in a working directory different from the Viivi system directory 3 3 Troubled Try to edit the boot up script file Try to accommodate the boot up script file to boot up Viivi
45. ents the longest part repeating the pat tern e1 e2 from the head of the argument 10 20 30 40 50 60 given for macro C in the user code The second macro pattern e3 e4 e5 matches 10 20 30 40 50 60 the longest part re peating the pattern e3 e4 e5 from the head of the rest argument 10 20 30 40 50 60 given for macro C in the user code And the third macro pattern e6 e7 matches zero elements because no arguments are left in the user code And therefore the pattern matching succeeds as the result TT macro pattern of macro D el e2 e3 e4 e5 e6 e7 user code macro D 10 20 30 40 50 60 70 80 90 The first macro pattern e1 e2 matches 10 20 30 40 the longest part repeating the pattern e1 e2 from the head of the argument 10 20 30 40 50 60 70 80 90 given for macro D in the user code The second macro pattern e3 e4 e5 matches 50 60 70 the longest part repeating the pattern e3 e4 e5 from the head of the rest argument 50 60 70 80 90 given for macro D in the user code And the third macro pattern e6 e7 tries to match the rest argument 80 90 given for macro D in the user code but it fails And therefore the pattern matching fails as the result macro pattern of macro E el e2 e3 user code macro E 10 20 30 40 50 60 70 The macro pattern e1 matches 10 20 30 40 50 60 70 the longest part repeating the pattern e1 fro
46. ermission is prohibited Any kind of redistribution of any part of or whole of this manual is prohibited This manual will be updated independently of the updates of the software Viivi Check the download site as freguent as possible for the latest version of this manual Agreement for the software Viivi is different from this agreement for the manual Before using the software Viivi please read the agreement attached to Viivi The product names of the hardwares and softwares appearing in this manual are registered trademarks of the respective makers When the contents of this agreement conflict between different description languages Japanese description takes precedence over others Viivi release logs User s Manual viiviManual 00 00 _a 2010 10 24 first released version viiviManual 00 01 a 2010 11 23 periodic update viiviManual 00 01 b 2010 12 11 minor revision viiviManual 00 01 c 2010 12 16 minor revision viiviManual 00 02 a 2010 12 30 periodic update viiviManual 00 02 b 2011 01 18 minor revision viiviManual 00 02 c 2011 01 20 minor revision viiviManual 00 14 a 2012 02 21 periodic update viiviManual 00 15 a 2012 03 18 periodic update viiviManual 00 15 b 2012 03 23 minor revision this version SOWNAWR WN i Package viiviPackage 00 00 00 zip 2010 10 24 first released version viiviPackage 00 00 01 zip 2010 10 25 minor revision viiviPackage 00 00 02 zip 2010 10 26 minor revision
47. es not increase even when the number of the supported languages increases Eguipped with a unigue debug trace system which visualizes evaluating processes even continuations as well Not only files but also network ports can be used as I O ports The evaluation environment can be flexibly customized at the boot time with the configu ration files viivi conf and viivirc and command line argument options Eguivalent customization can be performed at runtime using a procedure viivi set Seguential input sources and output destinations can be specified on the command line Customizable for R5RS incompatible Scheme codes widely existing over the world such that invoke eval with only one argument that invoke continuation without arguments that expect newly bound values returned from define set and etc When multiple ellipses appear in series within a list or a vector in a macro pattern the macro pattern matching is investigated based on the principle of the maximum length matching The transcript output is written in a format that will be used as input to the interpreter It enables to redo the same evaluations later or on another network host Introduced a concept of base level which enables to create evaluation environment of an arbitrary combination of predefined object groups procedures and constants classified in R5RS On a base level individual predefined objects can be added or de
48. fine list A quote 10 20 30 0 m define 1 lt procedure define gt 1 quote 10 20 30 13 m quote 23 lt procedure quote gt 33 10 20 30 3 list A 10 20 30 The symbol list A was bound to a proper list 10 20 30 4 lt unspecified gt A new binding generation is shown with the marks O and gt lt unspecified gt gt set cdr cddr list A list A 4 r set cdr cddr list A list A 4 m set cdr 5 lt procedure set cdr gt 5 m cddr list A 5 m cddr 6 lt procedure cddr gt 6 m list A TA 10 20 30 8 30 8 m list A 9 10 20 30 9 H 30 0 30 10 20 0 The list 30 was modified into a circular list 0 30 10 20 0 10 lt unspecified gt Modification of the internal structure of a datum is shown with the marks W and gt lt unspecified gt gt list A 10 list A 11 0 10 20 30 0 The symbol list A is now bound to a circular list 0 10 20 30 0 0 10 20 30 0 gt 69 11 2 Configuring evaluation environment with base level Base level is a local term expediently introduced only for Viivi It means an evaluation environment customized by the user arranging an ensemble of predefined object procedure and constant groups The purpose of this feature is to provide the user with an arbitrary subset of Viivi R5RS evaluation environment and t
49. he continuation k gt 11 O k gt lt continuation 0 gt The symbol k was initialized to the continuation with the binding i 0 11 r set the continuation k lt B 11 m set lt B 12 lt procedure set gt lt B 12 m k lt B 13 lt continuation 0 gt lt B 13 the continuation gt lt continuation 0 gt The bound value of the continuation was lt B 13 lt unspecified gt changed to the continuation with i gt 0 lt B 14 lt unspecified gt 14 r set i ti 1 14 m set 15 lt procedure set gt 15 r i 1 15 pk 16 lt procedure gt 16 pig Lee 0 17 1 18 va 19 T 19 GOi gt 1 The binding was modified to i gt 1 20 lt unspecified gt It reflects to the environment of the continuation bound to the continuation 20 Cs 21 saat 7 ee 20 1 t lt unspecified gt gt 22 r the continuation 22 pr the continuation 23 lt continuation 0 gt 24 mmr lt continuation 0 gt The continuation was invoked Viivi assumes lt unspecified gt lt A 24 lt unspecified gt as the argument missed in invoking a continuation 24 r set i i 1 24 m set 25 lt procedure set gt 25 Cr t 25 pr 26 lt procedure gt 26 m i 27 The invoked continuation has an environment with the binding i gt 1 27 p 4 28 acai E 29 2
50. he list shown below Lower configuration files are prior to the upper files in affecting the state of Viivi at the boot time I5Tf it were not for such a policy specifications on Viivi s behavior would be dispersed over files and the user would be confused In the above example when the verbosity specifications were written in the both files that written in the boot up script file is prior to that in the configuration file because Viivi at last receives the former as a command line argument option set But it is not easy for the user to grasp such priority To avoid this kind of confusion specifications written in the boot up script files should be restricted to those for the JVM 27 In the following VIIVI_HOME HOME and PWD represent the Viivi system directory appended a path separator at the end the user s home directory and the directory where user boots up Viivi Provided that user always tries Viivi in the user s work directory PWD is the user s work directory VIIVI_HOME viivi conf indispensable uneditable HOME viivirc optional editable HOME viivi conf optional editable PWD viivirc optional editable PWD viivi conf optional editable 5 NEO Don t modify but leave the original configuration file VIIVI_HOME viivi conf as it is Strictly speaking the files from 0 to 4 are read seguentially as configuration files just before Viivi is booted up You can provide an arbitrary Sc
51. heme file with the command line argument option L 5 a name of a usual Scheme file following to L on the command line optional editable Strictly speaking the file provided as 5 is read just after Viivi is booted up as the first library file You can provide multiple library files in seguence as well with L option before each filename on the command line And finally specifications given as the command line argument options are read although they are not configuration files 6 specifications given as the command line argument options optional User can flexibly customize Viivi by specifying default settings in the files of lower priority upper in the list and settings specific to the user or the directory for the project in the files and command line argument options of higher priority lower in the list You may have noticed that besides the uneditable file VIIVI_HOME viivi conf there are two ed itable configuration files viivi conf and viivirc in the home directory HOME and the current working directory PWD respectively As viivi conf has higher priority than viivirc these two configuration files can be distinguished as follows e New configuration items that are being tested should be written in the configuration file viivi conf first e After the configuration items are confirmed to work correctly the configuration items should be moved into the other configuration file viivirc 28 6 4 2 Contents
52. irectory do the following operation in the Viivi system directory after unpacking the new package e for Unix like platforms with sh family cp viivi SAVE viivi e for Unix like platforms with csh family 4 cp viivi SAVE viivi e for Windows platforms gt copy viivi bat SAVE viivi bat 14 2 Update of the copyright string For the new versions of Viivi it is enough with one copyright description viivi set copyright COPYRIGHT STRING in the configuration file in the Viivi system directory VIIVI_HOME viivi conf Leave the copyright description as it is The user no more needs to put the copyright description in the user editable configuration files HOME viivi conf HOME viivirc PWD viivi conf 83 OT PWD viivirc Delete the old copyright descriptions in these configuration files or they will cause a system error 84 15 De installing Viivi To delete Viivi completely from the platform do the following operations Remark that Viivi no more runs if you do the following operations Here you are going to delete files and directories Before doing the operations make sure that those files and directories are no more necessary for you In the following the home folder on Windows platforms is assumed to C Users ilma Adjust the underlined parts to your own home folder 15 1 Deleting Viivi system files First delete all the system files of Viivi e Unix like platforms with sh family cd Viivi
53. ity assignments for different purposes Xss64m to assign 64MB for the JVM stack Xms64m to assign 64MB for the JVM minimum heap Xmx256m to assign 256MB for the JVM maximum heap 1Opushing C key with Control key of the keyboard 15 You may need to decrease each memory capacity smaller for the platforms with smaller memory ca pacities such as PDAs and cellular phones The author tried to reduce the memory capacity assignments to the minimum values on the PC plat form OSs are Solaris and Ubuntu Depending on whether the JVM is 32bit or 64bit the minimum values were about java Xss2m Xms2m Xmx2m jar Viivi jar for 32 bit JVM java Xss4m Xms4m Xmx4m jar Viivi jar for 64 bit JVM respectively Please try to adjust the values for your platform so as to boot up Viivi on it 16 3 Trying Viivi boot up script file In this section the boot up script file in the Viivi system directory is tried to boot up Viivi With the boot up script file you can boot up Viivi with fewer strokes of typing Furthermore command line arguments for java command can be written in the boot up scripts file to specify the bit model of the JVM or to assign memory capacities for the JVM 3 1 Selecting an appropriate Viivi boot up script file There are two kinds of script file to boot up Viivi in the Viivi system directory for the major platforms viivi a sh script file for Unix like platforms viivi bat a batch file for Windows platforms We call th
54. ivi predefined procedures 7 1 Numerical constants When they are evaluated in a mathematical expression for example they are immediately replaced with the respective predefined numerical values e E radix of natural logarithm 2 718281828459045 e PI ratio of the circumference of a circle to its diameter 3 141592653589793 7 2 Symbol constants Tt is defined in order to help the Viivi novice e help This symbol is bound to another symbol over eleven lines including empty lines and carriage returns which summarizes information possibly helpful to the novice such as how to guit the interpreter etc The bound value is not a string but a symbol because if a string were used here the guotation marks accompanied at the both ends of the string might confuse the novice exit to exit Control D to exit in Unix systems Control Z Enter to exit in Windows viivi agreement to show agreement viivi copyright to show copyright viivi version to show version number viivi title to show title viivi help to show this help help to show this help 30 8 Viivi predefined procedures In addition to the procedures described in R5RS the following procedures are predefined in Viivi e procedures to show information These procedures are always available independent of the base level configurations viivi agreement to show agreement viivi copyright to show copyright viivi help to show help messages vi
55. ivi title to show title viivi version to show version system properties to show all the properties of the platform e procedures to obtain or to set properties of Viivi These procedures are always available independent of the base level configurations viivi property lt VIIVI PROPERTY SYMBOL gt to return the value of the property lt VIIVI PROPERTY SYMBOL gt of Viivi viivi set lt VIIVI PROPERTY SYMBOL gt lt VIIVI PROPERTY VALUE gt to set the value lt VIIVI PROPERTY VALUE gt for the property lt VIIVI PROPERTY SYMBOL gt of Viivi e procedures for random numbers These procedures are included in the base level 32 Viivi specific predefined constants and pro cedures random lt N gt to return a pseudo random value of floating point number or integer type lt N gt is optional random boolean to return a pseudo random boolean value random gaussian to return a pseudo random floating point value in the normal distribution of zero mean value and one standard deviation random seed lt N gt to specify a seed for the pseudo random number generator lt N gt is optional Each procedure will be detailed in the following 31 8 1 Procedures to show information Each procedure returns lt unspecified gt after displaying information to the standard output port These procedures were prepared to provide the user information If you want to use the information in your program codes use the procedure viivi p
56. ject Direct input lt unspecified gt for the lt unspecified gt object o eg comparison mode lt N gt Specifies an integer value lt N gt 0 1 20r 3 representing eq compares numbers and or characters whether with their memory addresses or with their values 0 3 eq compares both the numbers and the characters with their memory addresses default eq compares the numbers with their values eq compares the characters with their values eq compares both the characters and the characters with their values gt eq 2 2 f eq compares memory addresses of the numeric arguments by default gt viivi set eg comparison mode 1 lt unspecified gt gt eq 2 2 t eq was changed to compare values of the numeric arguments o eval argument number lt N gt Specifies the number of the arguments accepted to eval invocation The second argument lt N gt is an integer value 1 2 or 3 This is eguivalent to the command line argument op tion E lt N gt 40 1 One argument only the S expression of the evaluation target and no environ ment specifier eval 20 30 2 Two arguments R5RS compatible default eval 20 30 scheme report environment 5 3 Either one argument or two arguments viivi set eval argument number 1 Specifies that the eval invocation accepts only one argument flush each output t f Specifies if an output port is flushed at every writing to the out
57. leted This is a feature assumed for the purpose to generate a subset environment of R5RS and to conduct experiments in the environment Length of a circular list is defined as the negative of the number of the actual elements on the list e g the length of 40 10 20 30 0 is 3 When an error occurs detailed error information is displayed When a problem is likely to occur for example a symbol bound to a predefined procedure is re bound to something else or a circular list is given as an argument to a procedure expecting a proper list as the argument then a warning is displayed 1 4 Requirements for Viivi Viivi reguires the platform the following to run e JRE of version 1 6 0 or newer This is a software environment including JVM for Java programs to run It is prepared for various platforms workstations PCs Mac PDAs and cellular phones etc Nowadays many platforms are already eguipped with JREs at the initial configurations Ifit is not yet installed please obtain the latest JRE and install it correctly JREs for PCs are available from the web page of ORACLE lt http www oracle com gt For the JREs for other platforms please ask the makers of your hardwares and OSs JDK includes JRE Please use JRE of 1 6 0 or newer version Viivi does not run on JREs older than 1 6 0 Explanations in this manual assume that the JRE is already installed on the platform e enough memory storage The minimum memory
58. m the head of the argument 10 20 30 40 50 60 70 given for macro E in the user code The second macro pattern e2 e3 matches zero elements because no arguments are left in the user code And therefore the pattern matching succeeds as the result macro pattern of macro F _el e2 e3 user code macro F 10 20 30 40 50 60 70 80 The macro pattern e1 matches 10 20 30 40 50 60 70 80 the longest part repeating the pattern e1 from the head of the argument 10 20 30 40 50 60 70 80 given for macro F in the user code The second macro pattern e2 e3 matches zero elements And therefore the pattern matching succeeds as the result 2 1 ntroducing pattern matching based on the longest matching method the matched pattern may be actually different from that expected from user s intuition such that the pattern e1 would match 10 20 30 and the pattern e2 e3 would match 40 50 60 70 2Introducing pattern matching based on the longest matching method a macro pattern which seems not to match the user code at a glance the pattern e1 matches 10 20 30 but the pattern e2 e3 does not match 40 50 60 70 80 does actually match the user code 78 macro pattern of macro G el e2 e3 e4 e5 e6 user code macro G 10 20 30 40 50 60 70 80 The first macro pattern e1 e2 e3 matches zero elements the longest part repeating the pattern e1 e2 e3 from th
59. n expected one is returned It may be a bug Viivi shows strange behavior It may be a bug Something to improve Viivi is found It may be a help for improvement Something you want concerning Viivi is found Tt may be a help for improvement 82 14 Updating Viivi 14 1 Update of the system files Basically speaking you only need to unpack the zip file of the new Viivi distribution package hereafter we call the file simply package over the existing files in the Viivi system directory to continue using the new version of Viivi in the same environment of yours so far How to unpack the package is the same as those described in 2 Downloading and installing Viivi 1 If you have edited the boot up script file viivi or viivi bat before and if you cannot find a back up file viivi SAVE or viivi bat SAVE of your current boot up script file in the Viivi system directory then you need to make a copy of your current boot up script file to protect it from being overwritten by the files included in the package To do so do the following operation in the Viivi system directory before unpacking the new package e for Unix like platforms with sh family cp viivi viivi SAVE e for Unix like platforms with csh family cp viivi viivi SAVE e for Windows platforms gt copy viivi bat viivi bat SAVE 2 Unpack the new package into the Viivi system directory 3 If you find a back up file viivi SAVE or viivi bat SAVE in the Viivi system d
60. n takes precedence over the other earlier one t Output files are opened in overwrite mode f Output files are opened in append mode default o predefined symbols Returns a list composed of all the symbols predefined on the current base level o prompt Returns the character string currently used as Viivi s prompt o return value Returns an integer value 0 1 2 or 3 representing the values the procedures define and set return 0 Both define and set return lt unspecified gt R5RS compatible default 1 Only define returns the newly bound value Only set returns the newly bound value 3 Both define and set return the newly bound value o system properties Returns an association list composed of all the pairs of a property name string as the key and its property value string as the datum of the platform viewed from the JVM 36 o usage Shows available symbols as lt VIIVI PROPERTY SYMBOL gt Returns lt unspecified gt Same as help o verbose level Returns an integer value 0 1 2 3 4 or 5 representing the output verbosity Does not output lt unspecified gt Does not output prompt Outputs only error messages Outputs also warning messages Outputs title at the boot time Outputs agreement at the boot time oP WN FO o version Returns the string representing the version of Viivi 37 e viivi set lt VIIVI PROPERTY SYMBOL gt lt VIIVI PROPERTY VALUE gt Used to set propertie
61. native speakers of English or German The author s translation into English or German is poor and may be wrong Would you be willing to correct wrong English or German in the messages output from Viivi and the descriptions on the manual homepage Thank you very much in advance Contents 1 Introduction to Viivi 1 1 1 2 1 3 1 4 1 5 Reguirements for VIIVI ais ganren amet it ara mobi ket a a Confirmed platforms for Viivi 0 mr na Downloading and Installing Viivi 2 0 2 1 2 2 2 3 2 4 2 5 2 6 Outline of Viivi installation processes 0 ne na Gheckin6 home directory tk 2 ne ey Me a AS Bo Ee Sc JA Creating Viivi system directory 0 0 ra Downloading Viivi distribution package 2 000000 eee ee Extracting Viivi distribution package file a Trying to run Viivi Stag A a Troubled Try to assign memory capacity ee Trying Viivi boot up script file 3 1 3 2 3 3 Selecting an appropriate Viivi boot upscriptfile Trying to run Viivi Stag B ee Troubled Try to edit the boot up scriptfile 3 3 1 Editing points in the boot up script file for Unix like platforms 3 3 2 Editing points in the batch file for Windows platforms 3 3 3 Editing points common for all the platforms Separating Viivi work directory 4 0 4 1 4 2 4 3 4 4 Outline of pr
62. nd memory storage assignments for the JVM can be written in the files as well I2http www libreoffice org Shttp www openoffice org 25 In both files the most important part is the line beginning with java viivi java Xss64m Xms64m Xmx256m jar VIIVI_HOME Viivi jar viivi bat java Xss64m Xms64m Xmx256m jar VIIVI HOMEViivi jar 41 42 8 9 e The first word java is a command to start the JVM e The first three arguments for java specify the memory capacity assignments for the JVM The underlined parameters below show values of the memory storages If Viivi does not run correctly tune these values suited to your environment The first argument Xss64m is for the stack size of the JVM Here 64MB is assigned to the stack Increasing this value makes it effective for programs of deep procedure calls The second argument Xms64m is for the initial heap size of the JVM Here 64MB is assigned to the initial heap Decreasing this value makes it cost effective for programs of small data amount The third argument Xmx256m is for the maximum heap size of the JVM Here 256MB is assigned to the maximum heap Increasing this value makes it effective for programs of large data amount e The fourth and the fifth arguments jar VIIVI_HOME Viivi jar and jar VIIVI HOME Viivi jar in each file respectively indicate that the JVM runs Viivi jar software in the Viivi system directory e The following arg
63. ngs gt Environment Variables Now you will see VIIVI_HOME the string you set in 4 2 Setting environmental variables PATH existing path strings here VIIVI_HOME Select each with a mouse click then remove the setting choosing gt Delete If you have set other strings to the value of the PATH variable for other applications choose Edit instead and erase only the part VIIVI HOMEY Then select gt 0K and reboot Windows to activate the new settings End of the user s manual 87
64. numbers and characters with their values viivi Q 1 Changes eg to compare values of the numeric arguments e R lt N gt Specifies the values returned by define and set The second argument lt N gt is an integer value 0 1 2 or 3 representing the values define and set return This is equivalent to the procedure invocation viivi set return value lt N gt 0 Both define and set return lt unspecified gt R5RS compatible default 1 Only define returns the newly bound value Only set returns the newly bound value 3 Both define and set return the newly bound values viivi R 2 Specifies that only the procedure set returns the newly bound value The procedure define returns lt unspecified gt 48 9 3 Command line argument options for specifying Viivi s behaviors The following command line argument options specify to change behaviors in evaluation and in put output of Viivi e B lt N gt Generates a new base level and sets it as the current base level The argument parameter lt N gt is a bit summation of integer values 2 n 0 1 5 representing the groups of predefined objects This is equivalent to the procedure invocation viivi set push base level lt N gt Reversion to the previous base level can be performed by a procedure invocation viivi set pop base level or by a command line argument option Bx 1 A group of the objects defined in R5RS as syntax and so forth 2 library synt
65. o let the user conduct various experiments in the environment For example trying to write codes in a still simpler evaluation environment such that similar to Lisp 1 5 environment or an extremely simple one only with the procedures of car cdr and cons must be an interesting puzzle although it may not be practical No languages other than Scheme R5RS are suited for such an experiment The base level generated at boot time can be customized but only this base level cannot be aban doned and other customized base levels can be pushed popped at any time during Viivi runs By default the base level generated at boot time includes all the predefined objects of Viivi Any procedure or constant predefined in Viivi belongs to one of the following groups 1 A group of the objects defined in R5RS as syntax and so forth 2 library syntax 4 procedure 8 library procedure 16 optional procedure 32 A group of Viivi specific objects User can combine these groups arbitrarily into a base level in Viivi The bit summation of the integer value representing each group is used to specify the base level To specify a base level composed of the predefined object groups defined as syntax and procedure in RRS use an integer value 5 that is the sum of integer 1 representing syntax and integer 4 rep resenting procedure To specify a base level composed of the predefined object groups other than those defined as library procedure and optional procedur
66. ocedure invocation are always evaluated from left to right Capital and small letters are distinguished in symbols Square brackets and in addition to parentheses and can be used to express pairs and vectors They are unified to and after they are read by the interpreter Display style of pairs and vectors follows srfi 38 Since the implementation does not depend on the internal structure of the JVM but uses only the basic Java APIs and the exception handling it must be easily transplanted into other Object Oriented platforms It was firstly presented as Gino provisional at Shibuya lisp Technical Talk 3 on July the 4th 2009 lt http shibuya lisp users org 2009 07 04 sl1tt 3 tb gt 5 Java Virtual Machines e Specs on unique extensions Supports multiple natural languages in a parallel way by operating character data through the JVM internal Unicode Currently supports English Japanese and German Characters of the current locale language can be used in symbols and strings Messages for errors and warnings are shown automatically in the current locale language In case of Japanese locale for example HIRAGANA KATAKANA KANJI characters can be used and the messages are shown in Japanese The user can also specify to use a language different from the current locale language Potentially supports all the languages that the JVM Unicode supports Consumed memory storage do
67. ocedures of Viivi such as viivi title viivi set and viivi property 71 etc are not shown Even when multiple base levels are generated each predefined object a constant or a procedure has always only one instance Each predefined object on all the base levels uses a reference to a common instance to suppress increase of occupied memory capacity 72 11 3 Operations on circular lists Display style for circular lists follows srfi 38 A warning message is displayed when a circular list is given as an argument to a procedure which expects the argument a proper list in case of verbose level is 3 or larger Length of a circular list is defined as the negative of the number of the actual elements on the list gt define list A 10 20 30 lt unspecified gt gt set cdr cddr list A list A lt unspecified gt gt list A A gt gt 0 10 20 30 Ott gt length list A B gt gt gt gt Warning lt lt B gt gt lt procedure length gt found a circular list B gt gt A negative value is returned B gt gt Continuing the process C gt gt 3 e A gt gt Display style for circular lists follows srfi 38 e B gt gt Shows warning message when a circular list is given as an argument to a procedure in case of verbose level is 3 or larger e C gt gt Length of a circular list is the negative of the number of the actual elements on the list 73 11 4 Display styles for objects
68. ocesses separating Viivi work directory 0 Creating the user s work directory oaoa nene Setting the environmental variables 2 ee Trying to run Viivi Stage C e mi ee Troubled Check and re set the values of the environmental variables Editing Viivi Configuration File 5 0 5 1 5 2 5 3 5 4 Outline of the processes editing the configuration fle Copying the configuration file aoaaa ee Editing the configuration file 2 2 0 020000 a Trying to run Viivi Stage D muu 2 fe a ae ee pe Troubled Do it over from copying the configuration file Viivi System Files 6 1 6 2 6 3 6 4 QOreadme i Xb ose Baer ae Bes ASU eis Be a ah Scie pel le te i ga ViVi Jary fet ses hate el te ete eee A ee a ea viivi and Viivin bat yd tate ieee pede ae Spe aes et Gace ae ye uy teens Se hoe EE Tiivis Cont ANA CVV EES e bats aie dein Bin tS at oh dey e tp ek Oe eee ee 6 4 1 Hierarchy of the configuration files 2 202008 6 4 2 Contents of the configuration files 2 0 020048 COND OD 10 12 12 12 12 13 13 14 15 17 17 17 17 18 18 18 20 20 20 21 22 22 23 23 23 23 23 24 7 Viivi predefined constants 1 1 Numerical constants rr ses ge a seed Bd ae de ea NUUD ee a ta 7 2 Symbol constants 1 104 aoc al sel open i eh a SE ee eR a a ale eS ae 8 Viivi predefined procedures 8 1 Procedures to show inf
69. ocessing all the configuration files Viivi usually processes the command line argument options seguentially from left to right Their order of appearance is therefore meaningful 9 1 Command line argument options to show information Each of the following options shows corresponding information to the standard output port and immediately quits Viivi Note that they are the only exceptions for the rule of left to right sequential processing on the command line arguments When a command line argument option of this group was found anywhere in the command line argument option sequence then Viivi quits immediately after processing it with all the other options ignored e agreement Shows the agreement Corresponds to the procedure invocation viivi agreement e copyright Shows the copyright Corresponds to the procedure invocation viivi copyright e flags Shows a list of available command line argument options Same as h elp e h elp Shows a list of available command line argument options Same as flags e sysprops Shows all the information on the platform viewed from the JVM Corresponds to the procedure invocation system properties e title Shows the title Corresponds to the procedure invocation viivi title e ver sion Shows the version Corresponds to the procedure invocation viivi version 46 9 2 Command line argument options for R5RS incompatibilities Viivi accepts by default only Scheme codes com
70. of the configuration files Notation in the configuration files follows that of the Scheme programming language including the comment notation Only the following three procedures can be used in the configuration files viivi set a procedure to modify properties of Viivi interpreter 8 Viivi predefined procedures random seed a procedure to set a seed for pseudo random number generation 8 Viivi predefined procedures transcript on a procedure defined in R5RS to begin transcript output 16The copyright description viivi set copyright COPYRIGHT STRING is now needed only in the configuration file in the Viivi system directory VIIVI_HOME viivi conf You no more have to write anything about the copyright in the user editable configuration files the other viivi confs or viivircs 29 7 Viivi predefined constants The following symbols are bound to the respective predefined constants in Viivi These bindings are included in the base level 32 Viivi specific predefined constants procedures When you want to use these symbols not for the predefined constants but as your own variables you can simply override them using define or a procedure of the let group If you don t like to see the predefined constants you can erase the predefined constans themselves from the predefined environment individually using the function remove predefined symbol of the procedure viivi set See viivi set in Section 8 Vi
71. ormation 2 ooa a e a a a e e e a a 8 2 Procedures to obtain or to set properties of Viivi ooa aa 8 3 Procedures for random numbers osoo a a a a 9 Viivi command line argument options 9 1 Command line argument options to show information 9 2 Command line argument options for RRS incompatibilities 0 9 3 Command line argument options for specifying Viivi s behaviors 9 4 Command line argument options for input source output destination 10 R5RS specifications of Viivi 10 1 Equality testing procedures of Viivi aa aa ee 10 2 General timing of argument evaluation in a procedure invocation 11 Unique extensions of Viivi 11 1 Viivi debug trace mechanism 2 a 11 2 Configuring evaluation environment withbaselevd 11 3 Operations on circular lists ooa a ee 11 4 Digplay styles for objects gAs A oi pe a Cee ula UE kb oe a 11 5 Direct inputfor obj cts js iss a Bae key ogad Pde a a Be a We lna 11 6 Investigating macro pattern matching with the longest matching method 11 7 To use a transcript output as another input ooo a a 202000004 12 Other tips for using Viivi 121 To shutdown ViVi e i dsd a 4 Ae eos eh ee sh RA en AAs 12 2 To stop and restart screen scrolling oaoa 0 0000 eee ee eee 12 3 Standard input output files s 214 sos hte ead di r na oe e aa O Me Bod ee 13 Reporting bugs of Viivi 13 1 How to TEport 4 o
72. ort viivi i source scm Input from the file source scm is evaluated Same as viivi source scm viivi i 46497 Input from the network port 46497 of the localhost Same as viivi localhost 46497 or viivi 46497 L FILE PORT After performing library input from the specified file or network port input from the following input sources is evaluated If no following input sources are specified input from the standard input port is evaluated Library input is an input in which side effects of evaluation are effective but no output is performed The purpose of this option is to provide a method for reading beforehand as a library a file network port of reliable Scheme codes that have been tested enough Users are interested only in the side effects but not in the output of the library codes This option can be used also to read a normal Scheme file as a virtual configuration file with the highest priority If you need output during the evaluation as well use option instead viivi L usr local lib scheme math scm i model scm After library inputting from the file usr local lib scheme math scm input from the file model scmis evaluated Same as viivi L usr local lib scheme math scm model scm viivi L 49894 After library inputting from the network port 49894 of the localhost input from the standard input port of the platform is evaluated Same as viivi L localhost 49894 59 e 0 FILE HOST
73. output suppressing warning messages SO NhRO W truel false Specifies a boolean value representing if the output files are opened in overwrite mode or oth erwise in append mode Output files are opened in the append mode by default Output to the network ports is not affected by this setting The procedure invocation viivi set overwrite output files t f can be also used but the later designation takes prece dence over the other earlier one 52 true Output files are opened in overwrite mode false Output files are opened in append mode default 53 9 4 Command line argument options for input source output destination The following command line argument options specify input source output destination Here special symbols are used for the explanation FILE a filename string HOST a string representing a hostname or an IP address of a host PORT a network port number following to a colon character e e FILE HOST PORT Changes error output destination to the specified file or network port viivi e errorOutput txt After changing error output destination to the file errorOutput txt input from the standard input port is evaluated viivi e dev stdout test scm After changing error output destination to the file dev stdout actually the standard output port on Unix like platforms input from the file test scm is evaluated viivi e suuritammi 5963 After changing error output destination to
74. patible with R5RS On the other hand however the user can also let Viivi accept Scheme codes incompatible with R5RS that are already existing everywhere in the world by providing specific command line argument options e C lt N gt Specifies an integer value lt N gt representing the number of the arguments accepted to continuation invocation The argument lt N gt is an integer 0 1 or 2 This is equivalent to the procedure invocation viivi set continuation argument number lt N gt 0 No arguments 1 One argument R5RS compatible default 2 Either zero arguments or one argument viivi C 0 Specifies that the continuation invocation accepts no arguments e E lt N gt Specifies the number of the arguments accepted to eval invocation The argument lt N gt is an integer value 1 2 or 3 This is eguivalent to the procedure invocation viivi set eval argument number lt N gt al One argument 2 Two arguments R5RS compatible default 3 Either one argument and two arguments viivi E 1 Specifies that the eval invocation accepts only one argument e Q lt N gt Specifies an integer value lt N gt 0 1 2 or 3 representing eq compares numbers characters whether with their memory addresses or with their values 47 0 eg compares both numbers and characters with their memory addresses default 1 eg compares numbers with their values eg compares characters with their values 3 eg compares both
75. ption L 4 Rarely used temporary or short term options for Viivi should be specified directly as command line argument options For example it is NOT recommended to specify the verbosity option for Viivi in the boot up script file viivi as java Xss64m Xms64m Xmx256m jar VIIVI HOME Wiivi jar v 3 Instead specify it in the Viivi configuration file viivi conf as viivi set verbose level 3 6 4 viivi conf and viivirc Configuration files viivi conf and viivirc are for users to customize Viivi s behavior at the boot time The Viivi distribution package includes viivi conf file but no viivirc file The contents of viivi conf and viivirc are the same And hence the user can make the file viivirc as a copy of the file viivi conf The only one difference is that the former is visible but the latter is invisible in the default environments of Unix like platforms The contents of the configuration files are Scheme language programs But available procedures are limited and the evaluation processes and the results will never be shown The file viivi conf ORG is a backup file for the configuration file viivi conf Leave the backup file as it is 6 4 1 Hierarchy of the configuration files Multiple configuration files can exist simultaneously Only the configuration file viivi conf in the Viivi system directory is indispensable Other configuration files are optional They are read in the order from upper to lower in t
76. put port The second argument is a boolean value tt or tf This is equivalent to the command line argument option u true false tt Flushes output ports at every output Does not flush output ports not at every output depending on the platform viivi set flush each output t Specifies that the output ports flush at every output help Shows usage of viivi set It does not take the second argument Returns lt unspecified gt Same as usage language en ja de Specifies the natural language that the interpreter uses Currently English Japanese and German are supported The argument is one of the character strings representing these languages en English ja Japanese de German If the specified language is not available English C locale will be used Note that char acters may be possibly garbled in case of specifying a language different from the current 41 locale of the platform This is equivalent to the command line argument option LANG Cenljalde output in floating point number format 4t f Specifies a boolean value representing if the rational number value is output in the floating point number format or otherwise in the rational number format Equivalent to the command line argument option F true false tt The rational number values are output in the floating point number for mat f The rational number values are output in the rational number format default ove
77. racting Viivi environment variable settings Finally retract all the environmental variable settings for Viivi e Unix like platforms with sh family Delete the following four lines at the end of the environment configuration file profile bashrc or kshrc that were appended in 4 2 Setting environmental variables VIIVI_HOME Viivi Remove this line export VIIVI_HOME Remove this line PATH PATH VIIVI HOME Remove this line export PATH Remove this line Then retract the environment variable settings for Viivi from the current environment VIIVI HOME 86 export VIIVI_HOME profile OT bashrc OT kshre e Unix like platforms with csh family Delete the following two lines at the end of the environment configuration file login or cshrc that were appended in 4 2 Setting environmental variables set VIIVI_HOME Viivi Remove this line set PATH PATH VIIVI_HOME Remove this line Then retract the environment variable settings for Viivi from the current environment unset VIIVI_HOME source login or source cshrc e Windows platforms For Windows platforms the standard GUI method is shown here If you know how to erase the environmental variables in the Windows platforms by editing system files directly you may do it at your own risk Start gt Control Panel gt System and Maintenance gt System gt Tasks gt Advanced System Setti
78. rent locale of the platform equivalent to the procedure invocation viivi set language en ja de p PROMPT Specifies Viivi s prompt The argument PROMPT is a character string used for Viivi s prompt This is equivalent to the procedure invocation viivi set prompt PROMPT But the procedure invocation is recommended because the command line argument may be expanded by shells to an unexpected character string such that spaces may be dropped 51 viivi p Experiment 1 Changes Viivi s prompt to Experiment 1 u true false Specifies if an output port is flushed at every writing to the output port The argument is a boolean value true or false This is equivalent to the procedure invocation viivi set flush each output t f true Flushes output ports at every output default false Does not flush output ports at every output depending on the platform viivi u true Specifies that the output ports flush at every output vy lt N gt Specifies verbosity for the output The argument lt N gt is an integer value 0 1 2 3 4 or 5 representing the output verbosity This is equivalent to the procedure invocation viivi set verbose level lt N gt Does not output lt unspecified gt Does not output prompt Outputs only error messages Outputs also warning messages Outputs title at the boot time 5 Outputs agreement at the boot time viivi v 2 Specifies a silent verbosity for the
79. rgument option D lt N gt e as the procedure invocation viivi set direct input objects lt N gt lt N gt is a bit summation of integer values 1 2 4 each of which means 1 to accept direct input expressions for the predefined objects The predefined objects are e predefined constants represented as lt constant predefined constant name gt lt constant PI gt Viivi predefined constant for 7 e predefined procedures represented as lt constant predefined procedure name gt lt procedure let gt R5RS predefined procedure let lt procedure cos gt R5RS predefined procedure cos in R5RS lt procedure viivi set gt Viivi predefined procedure viivi set 2 to accept the direct input expression for the unspecified value lt unspecified gt 4 to accept the direct input expression for a nil lt ni1l gt 19This item may be deleted in the future versions as it is not necessary if the usual S expression is used 75 The purposes of introducing this option are as follows a To specify predefined objects predefined constants and procedures directly independent of the symbol binding relationship There is a problem that when a symbol binding is modified at the top level after defining a closure that uses the symbol then the behavior of the closure becomes different from that was expected at the definition time For example 1 gt define func arg if arg 100 200 definition for a closure 2 g
80. rocedure object lt procedure cos gt defined in R5RS to obtain the value of a mathematical function cosine then the symbol is newly bound to the procedure object on the current base level o continuation argument number lt N gt Specifies an integer value lt N gt representing the number of the arguments accepted to continuation invocation The second argument lt N gt is an integer 0 1 or 2 This is eguivalent to the command line argument option C lt N gt 0 No arguments 1 One argument R5RS compatible default 2 Either zero arguments or one argument 38 viivi set continuation argument number 0 Specifies that the continuation invocation accepts no arguments copyright COPYRIGHT Specifies a character string COPYRIGHT representing the copyright The interpreter con firms the copyright description Don t delete or modify the copyright settings in the configuration files or Viivi never boots up When the copyright string was changed into a new one in a newly distributed package then the copyright strings in all the configuration files need to be updated to the new copyright string debug fold multiple columns lt N gt Specifies an integer value lt N gt whose multiples of trace lines are folded and hidden in debug trace output The numbers of the folded and hidden trace lines are shown with digital numbers This option is provided to display deep procedure invocations compact on the display with a limited wid
81. roperty instead e viivi agreement Shows the agreement Corresponds to the command line argument option agreement e viivi copyright Shows the copyright Corresponds to the command line argument option copyright e viivi help Shows the help messages Actually this procedure displays the symbol value bound to a prede fined symbol help which is prepared in order to help the Viivi novice by letting her him know how to guit the interpreter etc e viivi title Shows the title Corresponds to the command line argument option title e viivi version Shows the version Corresponds to the command line argument option version e system properties Shows all the information on the platform viewed from the JVM Corresponds to the command line argument option sysprops 32 8 2 Procedures to obtain or to set properties of Viivi These are procedures to obtain or to set the values of the properties of Viivi e viivi property lt VIIVI PROPERTY SYMBOL gt Returns a property value of Viivi interpreter It takes the symbol lt VIIVI PROPERTY SYMBOL gt for a property name or a special symbol as the argument As the argument is evaluated the symbol must have been guoted if it is directly given as the argument This procedure was prepared mainly for the Scheme program codes to use the information If the user wants to see the information use the procedures listed above in 8 1 procedures to show information inst
82. rwrite output files t f Specifies a boolean value representing if the output files are opened in overwrite mode or otherwise in append mode Output files are opened in the append mode by default Output to the network ports is not affected by this setting The command line argument options 0 or o can be also used but the later designation takes precedence over the other earlier one t Output files are opened in overwrite mode Output files are opened in append mode default pop base level Discards the current base level and returns to the previous base level It does not take the second argument When the current base level was the first one generated at the boot time it does nothing This is equivalent to the command line argument option Bx prompt PROMPT Specifies Viivi s prompt The second argument PROMPT is a character string used for Viivi s prompt This is equivalent to the command line argument option p PROMPT But this procedure invocation is recommended because the command line argument may be expanded by shells to an unexpected character string viivi set prompt Experiment 1 Change Viivi s prompt to Experiment 1 42 o push base level lt N gt Generates a new base level and sets it as the current base level It takes as the second ar gument lt N gt an integer value of a bit summation of 2 n 0 1 5 This is equivalent to the command line argument option B lt N gt Reversion
83. s of Viivi interpreter The first argument lt VIIVI PROPERTY SYMBOL gt is a property symbol or a special symbol and the second argument lt VIIVI PROPERTY VALUE gt is a property value As the symbol of the first argument is not evaluated at the invocation it must be provided without quotation On the other hand the second argument is evaluated at the invocation Therefore if a symbol is directly provided as the second argument it must have been quoted viivi set append predefined symbol cos A few exceptions do not take the second argument The function for each pair of the property symbol lt VIIVI PROPERTY SYMBOL gt and the corresponding property value lt VIIVI PROPERTY VALUE gt will be detailed in the following o append predefined symbol lt PREDEFSYM gt The second argument lt PREDEFSYM gt is a symbol which is to be appended as a predefined symbol on the current base level The symbol must be an appropriate one that is to be bound to an object prepared in the interpreter When the symbol lt PREDEFSYM gt did not have a binding on the current base level the symbol is newly bound to the corresponding object on the base level When the symbol lt PREDEFSYM gt already had a binding on the current base level it does nothing There are no corresponding command line argument options at the present moment viivi set append predefined symbol cos When the symbol cos did not have a binding on the current base level to the p
84. so as to see what happened during the interacting But the following two points must be remembered when you use the transcript output e If you use the current transcript filename mySessionLog txt in the above example as the input source filename then new transcript output is appended to the same file making Viivi do endless evaluations To avoid such a problem the transcript output file must have been renamed when it is used as the input source file as follows mv mySessionLog txt error scm Rename the transcript file viivi g error scm Read the renamed input source file e When you continue to use a transcript file new contents of transcript output are always ap pended to the file It may make the size of the transcript file huge Rename or delete the transcript file regularly For example it is a good idea to write a script renaming or deleting the transcript file just before java command invocation in the file viivi or viivi bat 80 12 Other tips for using Viivi 12 1 To shut down Viivi When you want Viivi to stop running showing no prompt or when you cannot escape from Viivi you can shut down Viivi by killing JVM with Control1 C 4 on most platforms 12 2 To stop and restart screen scrolling You may miss the output from Viivi due to screen scrolling especially when you are using the debug trace output In such a case you can control the screen scrolling with the following key strokes e Control S to
85. stem gt Tasks gt Advanced System Settings gt Environment Variables gt New 11For Mac OS using bash by default bashrc seems to be appropriate 21 VIIVI HOME c Users ilma Viivi Don t forget at the end of the line PATH existing path strings here VIIVI HOME Then select gt 0K and reboot Windows to activate the new settings 4 3 Trying to run Viivi Stage C Now you must be able to boot up Viivi from any directory Move to the user s work directory and try to boot up Viivi If you see agreement after doing the following operations you have succeeded in separating Viivi work directory e Unix like platforms sh family The boot up script file is viivi cd ViiviWork viivi e Unix like platforms csh family The boot up script file is viivi cd ViiviWork viivi e Windows platforms The boot up batch file is viivi bat The following assumes the user s home folder as C Users ilma Replace the underlined part according to your environment gt C gt cd Users ilma ViiviWork gt viivi 4 4 Troubled Check and re set the values of the environmental variables If Viivi does not boot up check the values of the environmental variables VIIVI_HOME and PATH if they are correctly set If they are not correctly set re set them with the processes described in 4 2 Setting the environmental variables 22 5 Editing Viivi Configuration File This section explains
86. stop the screen scrolling e Control Q to restart the screen scrolling These key strokes can be used not only for Viivi but also for other applications running on Unix shell terminals and Windows cmd generally 12 3 Standard input output files The standard input source the standard output destination and the standard error output destination prepared by default on many platforms are accessible as system files of the platforms Some major examples are as follows e for Unix like platforms standard input source dev stdin standard output destination dev stdout standard error output destination dev stderr e for Windows platforms standard input source con standard output destination con standard error output destination err The debug trace output which is written to the standard error output destination by default can be redirected to the standard output destination as follows viivi g e dev stdout for Unix like platforms gt viivi g e con for Windows platforms 4pushing C key with Control key of the keyboard 81 13 Reporting bugs of Viivi Users are expected to report to the author bugs and problems they found Thank you very much in advance Corrections on the messages from Viivi and the descriptions on the manual in English or German by the native speakers are also welcome 13 1 How to report As the guestbook system is currently unavailable on the web page e mail is the only way for bug report
87. storage that Viivi itself requires to run the sample codes in R5RS for example is about 4MB for the 32bit JVM and 8MB for the 64bit JVM respectively Additional memory storage is practically required for OS and JVM There is no upper limit for the memory storage that Viivi can use The upper limit is restricted by the limitations of the hardware OS and JVM There is a result that Viivi used 48GB on a 64GB memory equipped machine 6 Java Runtime Environment 7 Java Development Kit 10 1 5 Confirmed platforms for Viivi Here is a list of confirmed platforms for Viivi Basically Viivi is expected to run anywhere independent of the platform only if it satisfies 1 4 Requirements for Viivi If you find Viivi to run on other platforms including PDAs and cellular phones please let me know They will be appended to this list Platforms in the following without special notations are confirmed by ilma e Windows XP Sun Microsystems JRE 1 6 0 20 b02 Thanks to taayan hiyoax and ghost e Windows Vista Sun Microsystems JRE 1 6 0_20 b02 32 bit 64 bit e Windows 7 Sun Microsystems JRE 1 6 0_20 b02 32 bit e Windows 7 Sun Microsystems JRE 1 7 0_03 b05 32 bit e Mac OS X 10 6 3 Apple JRE 1 6 0_15 b03 219 64 bit Thanks to pixie and sneex e Fedora 12 Sun Microsystems JRE 1 6 0_20 b02 32 bit 64 bit e Ubuntu 9 10 Karmic Koala Sun Microsystems JRE 1 6 0_20 b02 32 bit 64 bit m Jbuntu 10 04
88. t B 13 4 process 2 lt B 13 1 2 the result for 2 4 process 2 lt B 14 1 3 1 2 map packed the two results into a list 1 3 1 2 gt As shown above there are two exceptions for the trace lines that are not closed not connecting S expressions and their evaluated values e A case that a continuation is invoked It is occurring at the places with the comment lt A in the above When a continuation is invoked all the trace lines showing the evaluating processes so far are cut off The argument given to the continuation invocation is handed to the innermost trace line of the continuation and the evaluation process restarts e A case that a higher order procedure e g apply call cc for each or map is invoked It is occurring at the places with the comment lt B in the and above As these procedures invoke another procedure given as an argument an extra trace line for the internal procedure invocation is shown Since such a trace line neither has its input S expression nor the evaluated value no confusion should occur If it is still confusing the extra trace line would be changed to show the input S expression and the evaluated value as well as the other trace lines in the future version 68 To see modification of a data structure a simple code for generating a circular list is input in the debugging mode gt define list A 10 20 30 0 r de
89. t gt 30 0 r 30 ts 30 30 gt 20 30 T ro 2 lt procedure gt 2 m 20 3 20 sel 20 4 30 5 50 50 gt exit 5 r exit 5 p exit 6 lt procedure exit gt Interpreter terminated normally 3 3 Getting into debugging mode using viivi set Inputting 30 Input S expression 30 before evaluation Integer value 30 after evaluation Evaluation count increased from 0 to 1 30 was returned as a result Inputting 20 30 Input S expression 20 30 before evaluation The first element S expression in the list A procedure lt procedure gt was returned after evaluation The second element S expression 20 in the list An integer value 20 was returned after evaluation The third element S expression 30 in the list An integer value 30 was returned after evaluation The procedure lt procedure gt was applied to 20 and 30 to give the final result 50 Quitting with exit Input S expression exit The first S expression exit A procedure lt procedure exit gt was returned after evaluation The procedure lt procedure exit gt was invoked to exit 62 Next is a little advanced example The following shows the debug trace outputs for the definition and an invocation of a closure distance from origin which returns the distance r x y from the origin to a point whose x and y coordinates are given as the arguments
90. t func t gives 100 No problem 3 gt define if list redefining if as list at the top level 4 gt func t gives t 100 200 Should it give 1007 Such a problem can be avoided by using the direct input for the predefined procedure if at the time of the closure definition 1 gt define func arg lt procedure if gt arg 100 200 the predefined procedure if is directly specified 2 gt func t gives 100 No problem 3 gt define if list redefining if as list at the top level 4 gt func t still gives 100 as expected b To repair the symbol binding modified at the top level When a binding of the symbol representing a predefined object is modified at the top level the symbol would be never correctly used But the direct input for the predefined object can be used to repair the symbol binding 1 gt define cos When the symbol cos was rebound to 2 gt cos 30 gives 30 cos was changed into 3 gt define cos lt procedure cos gt repairing the symbol binding 4 gt cos 30 gives 0 15425144988758405 cos is now repaired 20For example in implementing a closure it could be possible to rewrite all the symbols used in the closure with their binding values at the definition time However I personally think that the referencing mechanism based on the symbol binding even in the closure would make the interpreter more flexible and henc
91. t2 txt t FILE HOST PORT Sets transcript output destination to the specified file or network port When the file already exists output contents will be always appended to the end of the file When the transcript output is already performed to another output destination the output destination is closed and then the specified output destination is newly opened Eguivalent to the procedure invocation transcript on FILE HOST PORT viivi t carbonCopy log After setting transcript output destination to the file carbonCopy log input from the standard input port is evaluated When the file carbonCopy log already existed contents of the tran script output are appended to the end of the file tx Closes the current transcript output port When a transcript output port was not open it does nothing Equivalent to the procedure invocation transcript off FILE S PORT S Reads and evaluates the input from the files and or network ports sequentially in the order as they are specified Files and network ports can be mixed in an arbitrary order Equivalent to the command line argument options in which the option i is inserted in front of each filename and network port Regardless whether single or multiple filename s and network port s with out option switches must be located at the end of the command line viivi Heidi scm Klara scm Peter scm Reads and evaluates the input from the files Heidi scm Klara scm and
92. tem directory created in 2 2 Creating Viivi system directory If you already saved the Viivi distribution package zip file into another directory move it to the Viivi system directory 2 4 Extracting Viivi distribution package file In the Viivi system directory use unzip command to extract the Viivi distribution package zip file as unzip viiviPackage XX YY ZZ zip for Unix like platforms with sh family unzip viiviPackage XX YY ZZ zip for Unix like platforms with csh family gt unzip viiviPackage XX YY ZZ zip for Windows platforms If you are familiar with GUI Graphical User Interface operation you may extract the Viivi distribu tion package file using GUI If you have succeeded in the file extraction you will find in the Viivi system directory nine Viivi system files 13 OOreadmeEN txt attached read me text file English OOreadmeJP txt attached read me text file Japanese Viivi jar main body of the software Viivi viivi boot up script file for Unix like platforms viivi ORG back up file for viivi viivi bat boot up batch file for Windows platforms viivi bat ORG back up file for viivi bat viivi conf configuration file viivi conf ORG back up file for viivi conf Don t forget to read OOreadme EN JP txt file It may contain important information which is not yet written on the User s manual 2 5 Trying to run Viivi Stage A Now Viivi must run Let s try to boot it up In the Viivi system directory
93. th This is equivalent to the command line argument option dc lt N gt viivi set fold multiple columns 20 Specifies that the trace lines multiples of 20 are folded and hidden debug level lt N gt Specifies the level for debug trace output The second argument lt N gt is a bit summation of 1 2 and 4 This is equivalent to the command line argument option d lt N gt No debug trace outputs 1 Outputs trace line connecting an input S expression before evaluation and the value after evaluation 2 Outputs evaluation count 4 Outputs generations and modifications of binding relations and modifi cations of the internal structures of data viivi set debug level 7 Turns Viivi into the debugging mode This is equivalent to the command line argument option g 39 o debug sleep milliseconds lt N gt Specifies an integer value lt N gt for which debug trace output stops in millisecond at every output of input S expression or its evaluated value This is eguivalent to the command line argument option ds lt N gt o direct input objects lt N gt Specifies a bit input directly summation lt N gt of integers which represent the kinds of object that can be No direct input is accepted default Direct input for the predefined objects constants and procedures lt constant PI gt Viivi predefined constant PI lt procedure cos gt R5RS predefined procedure cos Direct input lt nil gt for the nil ob
94. the network port 5963 on the host named suuritammi input from the standard input port is evaluated viivi e 192 168 20 51 5963 After changing error output destination to the network port 5963 on the host of IP address 192 168 20 51 input from the standard input port is evaluated viivi e 11922 After changing error output destination to the network port 11922 of the localhost input from the standard input port is evaluated Same as viivi e localhost 11922 e f FILE PORT After evaluating input from the specified file or network port input from the standard input is evaluated Tf multiple input sources are provided on a command line whether with or without flags i or L and at least one of them is specified with the f flag input from all the input sources is evaluated seguentially and finally input from the standard input port is evaluated viivi f scheme first scm After evaluating input from the file scheme first scm input from the standard input port is evaluated 54 viivi f prepare scm i test1 scm Evaluating input from the file prepare scm first input from testl scm is evaluated next and finally input from the standard input port is evaluated Same as viivi f prepare scm test1 scm viivi f 11291 After evaluating input from the network port 11291 of the localhost input from the standard input port is evaluated i FILE PORT Evaluates input from the specified file or network p
95. the rest argu ment The third macro pattern e6 matches 80 90 100 from the head of the rest argument This pattern matching agrees with our intuition Examples I The following patterns can be also correctly investigated macro pattern of macro I1 _el e2 e3 macro pattern of macro I2 e1 e2 e3 macro pattern of macro I3 _ el e2 e3 macro pattern of macro I4 _ el e2 e3 e4 macro pattern of macro I5 _ el e2 e3 e4 3Note that introducing pattern matching based on the longest matching method a user code which does not seem to match the macro pattern actually matches like Example G 79 11 7 To use a transcript output as another input 6 99 3 In the transcript files of Viivi every output line is commented with a semi colon character inserted at the line head Thanks to this feature user can use the transcript output as another input to reproduce the same evaluation processes later on the same host using a transcript output file or simultaneously on another host by communicating over the network If you are a Scheme beginner for example it is perhaps a good idea to write in a local configuration file viivi conf as transcript on mySessionLog txt When you encountered an error during inputting S expressions from the keyboard to Viivi you can investigate what was wrong by guitting Viivi immediately and then feeding the transcript file to Viivi with the debug option g
96. txt read me file written in Japanese These files are not required to run Viivi But remember to read it as they may contain latest informa tion that is not yet described in the user s manual The character code is UTF 8 If you cannot read the file with the characters garbled you can read it with Web browsers or with LibreOffice OpenOffice by setting the character encoding to UTF 8 6 2 Viivi jar This is the main body of the Viivi software User is not permitted to extract the Viivi jar file or to operate the contents of the file Use it as it is 6 3 viivi and viivi bat They are a script file and a batch file for Unix like platforms and Windows platforms respectively to boot up Viivi The user may edit these files for the user s environments Leave the backup files of the filenames ending with ORG as they are viivi a shell script file for Unix like platforms to boot up Viivi viivi ORG a back up file for viivi viivi bat a batch file for Windows platforms to boot up Viivi viivi bat ORG a back up file for viivi bat Once the boot up script is edited to run correctly it is strongly recommended to make a copy of it with the filename extension SAVE with a name such as viivi SAVE or viivi bat SAVE to avoid being overwritten in the processes updating to newer versions The purpose of these files is to make it easier to boot up Viivi At the same time command line argument options for the JVM specifying bit model of the JVM a
97. ualizes the evaluating processes in a natural way It shows lines connecting input S expressions and the corresponding evaluated values It does not show those for the S expressions not to be evaluated e g the first symbol for define or set the symbol for the name of a named let or the first list of the argument for lambda and etc To enable the debug trace function do one of the following e to give a command line argument option g or d lt N gt e to invoke a procedure viivi set debug level lt N gt The parameter lt N gt takes a bit summation of integer values of 1 2 and 4 each of which means 0 No debug trace outputs default 1 Outputs trace lines connecting an input S expression before evaluation and the value after evaluation 2 Outputs evaluation counts 4 Outputs generations and modifications of binding relations and modifications of the internal structures of data Each of the outputs of 4 is distinguished with its own marks o symbol valueA generation of a new binding e symbol valueB modification of an existing binding m datumC datumD modification in the structure of an existing datum 61 Usually each trace line is closed connecting an input S expression and its evaluated value as shown in Example 1 below Try to get into the debugging mode and then to input 30 and 20 30 Some parts were edited for explanation viivi gt viivi set debug level 7 lt unspecified g
98. uments and 1 2 3 4 5 6 7 8 9 in each file respectively are replaced with the arguments that user gave to the boot up script e If 64 bit mode JVM is available on your platform you can insert d64 as the first argument for java possibly to improve performance and to increase available memory storage e In the boot up script file viivi for Unix like platforms the path to the shell that execute the boot up script is written at the top line It is bin bash by default 4 If it does not work rewrite the path pointing to the right shell at the top line into such as bin sh or usr local bin tcsh etc You could write in the boot up script file viivi or viivi bat arguments for customizing Viivi How ever it is strongly recommended to write them in the configuration files viivi conf and viivirc as far as equivalent option settings are available 14The default shell was changed from bin sh to bin bash as bash seems to be available in most of the modern platforms 26 Please obey the following policy for the locations specifying options to customize Viivi 1 Options for the JVM should be specified in the boot up script files viivi or viivi bat 2 Permanent or long term options for Viivi should be specified in the configuration files viivi conf or viivirc 3 Freguently used temporary or short term options for Viivi should be specified in normal Scheme files and should be read with the command line argument o
99. utput result After changing the standard output destination to the file output result input from the stan dard input port is evaluated When the file output result already existed the output contents are appended to the end of the file viivi o 192 168 12 34 56789 After changing the standard output destination to the network port 56789 of the host with IP address 192 168 12 34 input from the standard input port is evaluated Same as viivi O 192 168 12 34 56789 viivi o dsti txt i src1 scm o dst2 txt i src2 scm After changing the standard output destination to the file dst1 txt input from the file src1 scm is evaluated And then changing the standard output destination to the file dst2 txt input from the file src2 scm is evaluated When the files dst1 txt or dst1 txt already existed the 56 output contents are appended to the ends of the files respectively Conseguently the results of the evaluations from the source files src1 scm and src2 scm are stored into the destination files dst1 txt and dst2 txt respectively The next sample is a possible mistake that does not work in the way you would expect viivi i src1 scm o dsti txt i src2 scm o dst2 txt 4 WRONG The evaluation results from the source file src1 scm will be written to the default standard output port and the evaluation results from the source file src2 scm will be written to the destination file dst1 txt Nothing is written to the destination file ds
100. you cannot escape from Viivi you can shut Viivi down by killing JVM with Control c 1 on most platforms Once Viivi works correctly you may delete the Viivi distribution package zip file viiviPackage XX YY ZZ zip For the time being you are able to boot up Viivi any time you like Go into the Viivi system directory and input the command you confirmed here such as java jar Viivi jar In the next section 3 Viivi boot up script the boot up script is used to make it easier to boot up Viivi 2 6 Troubled Try to assign memory capacity In case that an error message such as Error occurred during initialization of VM See below for the second line error message appears when you try to boot up Viivi you need to assign the memory capacity for Viivi The measures depend on the second line error message e Too small initial heap for new size specified You may need to increase the memory capacity for Viivi e Could not reserve enough space for object heap You may need to decrease the memory capacity for Viivi Give command line arguments to the java command to assign the memory capacity for Viivi java Xss64m Xms64m Xmx256m jar Viivi jar for Unix like platforms sh family java Xss64m Xms64m Xmx256m jar Viivi jar for Unix like platforms csh family gt java Xss64m Xms64m Xmx256m jar Viivi jar Windows platforms The first three arguments given to the java command represent memory capac

Download Pdf Manuals

image

Related Search

Related Contents

Wireless Stereo Headset  Télécharger le livre « Jouets de la mondialisation  PDFファイル  薬機安一発第 1031002 号 薬機安二発第 1031002 号  Seerosen / Water Lilies / Nénuphar / Nenúfar / Waterlelies Seerosen  100a, 200a ul 98 non fusible disconnect switches  MANUAL DE INSTALACIÓN Y USO  Sea Gull Lighting 59132LE-15 Installation Guide  Jensen CD-600 User's Manual    

Copyright © All rights reserved.
Failed to retrieve file