news.texi 122 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097
  1. These changes are in more-or-less reverse chronological order, with the
  2. most recent changes first.
  3. See also the list of @uref{../qexo/news.html,Qexo (XQuery)-specific
  4. changes}.
  5. @subheading In Git repository (master branch) since last release
  6. @anchor{#in-git-repository-since-last-release}
  7. @itemize
  8. @item
  9. Revert 3.0 change in allocating closure objects for inlined functions.
  10. @end itemize
  11. @subheading Kawa 3.0 (October 2, 2017)
  12. @itemize
  13. @item
  14. Binary release are now built for Java 8.
  15. The repository source code is now set up for Java 8.
  16. (Building for Java 6 or 7 is still supported.
  17. Java 5 might also work, but has not been tested recently.)
  18. @item
  19. Tested and updated for Java 9.
  20. @item
  21. Most places where you could declare a new identifier
  22. binding have been generalized to accept @ref{Variables and Patterns,patterns},
  23. including literals and boolean @stxref{guard}s.
  24. Related changes:
  25. @itemize
  26. @item
  27. The form @code{(! @var{pattern} @var{expression})} creates
  28. @ref{exclam-syntax,variable bindings} by matching
  29. the @var{expression} against the @var{pattern}.
  30. It is like @code{define-constant} but generalized to patterns.
  31. @item
  32. The conditional match form @code{(? @var{pattern} @var{expression})}
  33. is similar to @code{!} but can only be
  34. used @ref{Conditionals,in conditional context}.
  35. If the match fails, the condition is true.
  36. @item
  37. @ref{Repeat forms,Repeat patterns and forms} is a
  38. powerful experimental feature, similar to list comprehensions.
  39. @item
  40. The new form @ref{def-match,@code{match}} form is a generalization
  41. of @code{case} using patterns.
  42. @item
  43. The internal calling convention used for ``apply'' (ie. calling
  44. an unknown-at-compile-time procedure) has been completely changed.
  45. @item
  46. New types for arguments list (possibly with keywords)
  47. @ref{Explicit argument list objects, @code{arglist} and @code{argvector}}
  48. along with @ref{Argument list library,an API} for using them.
  49. @end itemize
  50. @item
  51. Major changes to strings:
  52. @itemize
  53. @item
  54. @emph{Incompatible change:} String literals are now
  55. @code{gnu.lists.IString} rather than @code{java.lang.String}.
  56. The advantage of using @code{gnu.lists.IString} is that @code{string-ref}
  57. and @code{string-length} are (roughly) constant-time, rather than
  58. having to linearly scan the string.
  59. @item
  60. @emph{Incompatible change:}
  61. The procedures @code{string-append}, @code{string-map},
  62. @code{substring}, @code{list->string}, @code{vector->string},
  63. @code{string-downcase}, @code{string-upcase}, @code{string-foldcase},
  64. @code{string-titlecase}, and the constructor @code{string}
  65. return an immutable string (an @code{IString}).
  66. (The function @code{string-copy} is similar to @code{substring},
  67. but returns a mutable string.)
  68. This is a work-in-progress with the goal of implementing
  69. @uref{http://srfi.schemers.org/srfi-140/srfi-140.html,SRFI-140}:
  70. Other procedures will be changed to return immutable strings.
  71. If you @code{(import (scheme base))} standard procedures
  72. such as @code{string-append} will return mutable strings;
  73. if you @code{(import (kawa base))} the procedures will return immutable strings.
  74. The command-line options @code{--r5rs} or @code{--r6rs} or @code{--r7rs}
  75. override the default so these procedures return mutable strings.
  76. @item
  77. @emph{Incompatible change:}
  78. Treating a string as a sequence is now simpler but possibly slower:
  79. The @var{I}'th element is now the @var{I}'th Unicode code point.
  80. Indexing with function-call syntax
  81. @code{(@var{string} @var{i})} is the same as @code{(string-ref @var{string} @var{i})} and
  82. @code{(length @var{string})} is the same as @code{(string-length @var{string})}.
  83. This applies to all classes that implement @code{java.lang.CharSequence}.
  84. Indexing may be a linear-time operation (thus much slower),
  85. unless the string is an @code{IString} (in which case it is constant-time),
  86. @item
  87. @emph{Incompatible change:} Before, if a Java parameter type
  88. was @code{java.lang.String} Kawa would accept any value, converting it
  89. using Object's @code{toString} method.
  90. Now Kawa will reject an argument if it is not a @code{java.lang.CharSequence}.
  91. @item
  92. New procedures: @code{istring?}, @code{reverse-list->string},
  93. @code{string-any}, @code{string-concatenate}, @code{string-concatenate-reverse},
  94. @code{string-contains}, @code{string-contains-right},
  95. @code{string-count}, @code{string-drop}, @code{string-drop-right},
  96. @code{string-every}, @code{string-filter}, @code{string-fold},
  97. @code{string-fold-right}, @code{string-for-each-index},
  98. @code{string-index}, @code{string-index-right}, @code{string-join},
  99. @code{string-map-index}, @code{string-null?},
  100. @code{string-prefix?}, @code{string-prefix-length},
  101. @code{string-repeat}, @code{string-remove}, @code{string-replace},
  102. @code{string-skip}, @code{string-skip-right}, @code{string-split},
  103. @code{string-suffix?}, @code{string-suffix-length},
  104. @code{string-tabulate}, @code{string-take}, @code{string-take-right},
  105. @code{string-trim}, @code{string-trim-right}, @code{string-trim-both},
  106. @code{string-unfold}, @code{string-unfold-right},
  107. @code{string->utf16}, @code{string->utf16be}, @code{string->utf16le},
  108. @code{utf16->string}, @code{utf16be->string}, @code{utf16le->string},
  109. @code{xsubstring}.
  110. These follow SRFI-140 and return immutable strings.
  111. (Some of these had previously been available in SRFI-13,
  112. but the older versions return mutable strings.)
  113. @end itemize
  114. @item
  115. @emph{Incompatible change:} Kawa traditionally followed Java in allowing you
  116. to pass an array with the ``rest'' arguments to a varargs method.
  117. For example, you could write:
  118. @verbatim
  119. (define args (Object[] 3 "cm"))
  120. (java.lang.String:format "length:%s%s" args)
  121. @end verbatim
  122. This is no longer allowed. Instead,
  123. use the splice operator:
  124. @verbatim
  125. (java.lang.String:format "length:%s%s" @args)
  126. @end verbatim
  127. @item
  128. @emph{Incompatible change:} You used to be able to write a
  129. type-specifier in a formal parameter or return type without
  130. using @samp{::}, as in:
  131. @example
  132. (define (incr (x int)) int (+ x 1))
  133. @end example
  134. This is no longer allowed, because it conflicts with the
  135. syntax for patterns. Instead you have to write:
  136. @example
  137. (define (incr (x ::int)) ::int (+ x 1))
  138. @end example
  139. @item
  140. New type aliases @code{bitvector} and @code{c16vector}.
  141. The latter is a @ref{Uniform vectors,uniform vector} type for wrapping @code{char[]} arrays.
  142. @item
  143. You can convert a Java array (for example a @code{int[]} to the corresponing uniform vector type
  144. (for example @code{u32vector}) using the @code{as} pseudo-function or the corresponding
  145. conversion procedure (for example @code{->u32vector}). The result shares storage with the
  146. array, so changes in one will update the other.
  147. @item
  148. The expression @code{(module-class)} evaluates to the
  149. containing module class.
  150. @item
  151. Change the @ref{Mangling,mangling} for field and local variables names
  152. to match the @uref{https://blogs.oracle.com/jrose/entry/symbolic_freedom_in_the_vm,Symbolic Freedom} style.
  153. @item
  154. Internally, expressions now record their ending position (line/column),
  155. in addition to the starting position.
  156. @item
  157. The new procedure @code{environment-fold} can be used to iterate
  158. over the bindings of an environment.
  159. @item
  160. Change in how closure objects are allocated for inlined functions.
  161. This sometimes reduces the number of objection allocations
  162. and also of helper classes, though in pathological cases it could cause
  163. objects to be retained (leak) where it didn't before.
  164. @item
  165. New command-line flag @code{--warn-uninitialized}
  166. (by default on) to control warning about using uninitialized variables.
  167. @item
  168. The pre-defined @ref{Character sets,character sets} are now based
  169. on Java 9's Unicode 8 support.
  170. @end itemize
  171. @subheading Kawa 2.4 (April 30, 2017)
  172. @itemize
  173. @item
  174. Final 2.x release.
  175. Minor updates and fixes.
  176. @end itemize
  177. @subheading Kawa 2.3 (January 13, 2017)
  178. @itemize
  179. @item
  180. Moved Kawa's source code repository (version control system)
  181. to use git, hosted at @uref{https://gitlab.com/kashell/Kawa,GitLab}.
  182. @item
  183. Issues (bugs, feature requests, etc) should now be reported using the
  184. @uref{https://gitlab.com/kashell/Kawa/issues,GitLab Issue Tracker}.
  185. @item
  186. New @code{with-docbook-stylesheets} to make it easier to build
  187. the documentation with better functionality and look.
  188. @item
  189. The command-line option @code{console:jline-mouse=yes}
  190. enables moving the input cursor using a mouse click,
  191. when using JLine in the REPL on common xterm-like terminals.
  192. This is disabled by default because it conflicts with
  193. other mouse actions, such as making a selection for copying text.
  194. You can press shift to get the terminal's standard mouse handling.
  195. @end itemize
  196. @subheading Kawa 2.2 (November 12, 2016)
  197. @itemize
  198. @item
  199. A binary release is no longer just a Kawa @code{.jar} file,
  200. but is now a @code{zip} archive that also includes
  201. shell/batch scripts for running Kawa, useful
  202. third-party libraries, and the complete documentation in EPUB format.
  203. The archives are named @code{kawa-version.zip}.
  204. @item
  205. The @code{kawa --browse-manual} switch makes it easy to
  206. @ref{browse-manual-option,browse the local documentation}.
  207. @item
  208. The @ref{Composable pictures,@code{(kawa pictures}) library} lets
  209. you create ``picture'' objects,
  210. display them, transform them, combine them, and more.
  211. @item
  212. There is a new @ref{Pretty-printing,API for pretty-printing}.
  213. @item
  214. Basic support for Java 9 (though still some issues).
  215. @item
  216. Generated files like @code{Makefile.in} and @code{configure} are no
  217. longer in the Subversion source code repository, though they are still
  218. included in the distributed @code{kawa-version.tar.gz} releases. The new
  219. top-level script @code{autogen.sh} should be run before
  220. @code{configure}.
  221. @item
  222. Kawa traditionally followed Java in allowing you to pass an array with
  223. the "rest" arguments to a varargs method. (A "varargs" method includes
  224. Java varargs methods, as well as Kawa methods with a @code{#!rest}
  225. parameter that is explicitly typed to be an array type.) For example,
  226. you could write:
  227. @verbatim
  228. (define args (Object[] 3 "cm"))
  229. (java.lang.String:format "length:%s%s" args)
  230. @end verbatim
  231. This is deprecated, and may stop working in a future release. Instead,
  232. use the splice operator:
  233. @verbatim
  234. (java.lang.String:format "length:%s%s" @args)
  235. @end verbatim
  236. @item
  237. More options for @ref{Ranges,range objects}. For example,
  238. you can write @code{[1 by: 2 <=: 9]}.
  239. @item
  240. Many enhancements to @ref{Arrays,arrays} and vectors:
  241. @itemize
  242. @item
  243. Shape specifiers (used when creating an array) can now be one of a
  244. rank-2 array of low/high-bounds, as in SRFI-25; a vector of upper
  245. bounds; or a vector of ranges.
  246. @item
  247. New type specifiers for array: @code{array} is any array (i.e. any
  248. @code{gnu.lists.Array}); @code{array@var{N}} is the same restricted to rank
  249. @code{@var{N}}; @code{array[etype]} or @code{arrayN[etype]} restrict the types
  250. of elements to @code{etype}.
  251. If the @code{etype} is a primitive type (for example
  252. @code{array2[double]}) then indexing is optimized to method calls that
  253. avoid object allocation.
  254. @item
  255. Generalized array indexing: If A is an array (or a vector), then the
  256. expression:@*
  257. @code{(A I J K ...)}@*
  258. in general evaluates to an array B such that:@*
  259. @code{(B i1 i2 ... j1 j2 ... k1 k2 ... ...)} is@*
  260. @code{(A (I i1 i2 ..) (J j1 j2 ...) (K k1 k2 ...) ...)}
  261. If an index I is an integer, it is treated as a zero-index array - a
  262. scalar.
  263. For example: if @code{(define B (A 2 [4 <: 10]))} then @code{(B i)} is
  264. @code{(A 2 (+ i 4))}.
  265. @item
  266. The procedure @code{array-index-ref} is does the above indexing
  267. explicitly: @code{(array-index-ref A I J K ...)} is
  268. @code{(A I J K ...)}. The result is a read-only snapshot.
  269. @item
  270. The procedure @code{array-index-share} is like @code{array-index-ref}
  271. but creates a modifiable view into argument array.
  272. @item
  273. @code{(build-array shape procedure)} is a general constructor for lazy
  274. arrays: If @code{A} is the result, then @code{(A i j k ...)} is
  275. @code{(procedure [I J K ...])}.
  276. @item
  277. @code{array-transform} creates a view, with a mapping of the indexes.
  278. @item
  279. Other new procedures (like those in the Racket math package):
  280. @code{array-size}, @code{array-fill!}, @code{array-copy!},
  281. @code{array-transform}, @code{array-reshape}, @code{array-flatten},
  282. @code{array->vector}, @code{index-array}, @code{build-array}.
  283. @item
  284. Add Common Lisp array reader syntax (@code{#rankA}) with
  285. @uref{https://www.gnu.org/software/guile/manual/html_node/Array-Syntax.html,Guile
  286. extensions}, including reader sypport for multi-dimensional uniform
  287. (primitive) arrays. This is also used when printing arrays.
  288. @item
  289. New @code{format-array} procedure print an array a tabular 2-dimensional
  290. (APL-like) format. This format is used by default in the top-level of
  291. the REPL.
  292. @end itemize
  293. @item
  294. Print bit-vectors using the Common Lisp (and Guile) reader syntax.
  295. For example @code{#*1100110}. Enhanced the reader to read this format.
  296. @item
  297. Various REPL enhancements and new features:
  298. @itemize
  299. @item
  300. The @code{-w} switch to create a new REPL window
  301. can be followed by various sub-options to control @emph{how} and
  302. where the window is created.
  303. For example @code{-wbrowser} creates a new window
  304. using your default web browser.
  305. @item
  306. Prompts are now normally specified using @code{printf}-style templates.
  307. The normal prompt template is specified by the @code{input-prompt1}
  308. variable, while continuation lines use @code{input-prompt2}. These can
  309. be initialized by command-line options @code{console:prompt1} and
  310. @code{console:prompt2}, or otherwise use language-specific defaults. You
  311. can still use @code{set-input-port-prompter!} to set a more general
  312. prompt-procedure, but it is now only called for the initial line of a
  313. command, not continuation lines.
  314. @item
  315. The new @code{--with-jline3} configure option builds support for the
  316. @uref{https://github.com/jline/jline3,JLine (version 3)} library for
  317. handling console input, similar to GNU readline.
  318. @item
  319. Context-dependent command-completion (tab-completion) works when using
  320. JLine.
  321. @end itemize
  322. @item
  323. Various REPL enhancements when using @uref{http://domterm.org/,DomTerm}.
  324. @itemize
  325. @item
  326. If you ``print'' an XML/HTML node, it gets inserted into the DomTerm
  327. objects. You print images, tables, fancy text, and more.
  328. @item
  329. If you ``print'' a picture object or a @code{BuferredImage}
  330. the picture is shown in the DomTerm console.
  331. @item
  332. You can load or modify styles with the @code{domterm-load-stylesheet}
  333. procedure.
  334. @item
  335. When pretty-printing, calculation of line-breaks and indentation
  336. is handled by DomTerm.
  337. If you change the window width, DomTerm will dynamically
  338. re-calculate the line-breaks of previous pretten output.
  339. This works even in the case of a session saved to an HTML
  340. file, as long as JavaScript is enabled.
  341. @item
  342. Hide/show buttons are emitted as part of the default prompt.
  343. @end itemize
  344. @item
  345. Multiple literals that have the same value (as in @code{equal?}) get
  346. compiled to the same object.
  347. @item
  348. The syntax @code{&<[expr]} is now equivalent to @code{&<@{&[expr]@}},
  349. assuming @code{expr} is an expression that evaluates to a string that
  350. named an existing file. That file is read is the result is the contents
  351. of the file (as if by @code{(path-data expr)}).
  352. @end itemize
  353. @subheading Kawa 2.1 (October 26, 2015)
  354. @anchor{#kawa-2.1-october-26-2015}
  355. Lots of little changes, and some big changes to sequences and strings.
  356. @itemize
  357. @item
  358. Enhancements to the Kawa tutorial.
  359. @item
  360. Added @code{parameter} as a new typename, for Scheme parameter objects.
  361. It can be parameterized (for example @code{parameter[string]}) for
  362. better type inference when "calling" (reading) the parameter.
  363. @item
  364. We now define ``interactive mode'' as a REPL or a source module that
  365. uses the default global top-level environment @emph{or} a source module
  366. imported/required by a interactive module. Interactive mode attempts to
  367. support dynamic re-definition and re-loading of function and other
  368. definitions. This is a work-in-progres; interactive mode currently uses
  369. extra indirection to support re-definitions (at a slight performance
  370. cost).
  371. @item
  372. Various changes and fixes in Path/URI handling. Most significantly, the
  373. resolve argorithm used by @code{resolve-uri} was re-written to use the
  374. algorithm from RFC-3986, rather than the obsolete RFC-2396 algorithm
  375. used by @code{java.net.URI.resolve}.
  376. @item
  377. Change to mangle class and package name in
  378. @uref{https://blogs.oracle.com/jrose/entry/symbolic_freedom_in_the_vm,Symbolic
  379. Freedom} style. This means that class names and class filenames usually
  380. match the source file, even if special charaters are used, except for a
  381. small number of disallowed characters. Note this is currently
  382. @emph{only} used for class and package names.
  383. @item
  384. Allow @code{'synchronized} and @code{'strictfp} as access flags for
  385. methods.
  386. @item
  387. You can now have a type-specifier for @code{define-variable}.
  388. @item
  389. Better support for forward references between macros.
  390. @item
  391. Added unsigned primitive integer types @code{ubyte}, @code{ushort},
  392. @code{uint}, and @code{ulong}. These are represented at run-time by the
  393. corresponding signed types, but Kawa generates code to do unsigned
  394. arithmethic and comparisons. Corresponding boxed classes are
  395. @code{gnu.math.UByte}, @code{gnu.math.UShort}, @code{gnu.math.UInt}, and
  396. @code{gnu.math.ULong}.
  397. @item
  398. Improvements and unification of sequences and strings:
  399. @itemize
  400. @item
  401. The new @code{sequence} type generalizes lists, vectors, arrays,
  402. strings, and more. It is implemented as the @code{java.util.List}
  403. interface, but strings (@code{java.lang.CharSequence}) and Java arrays
  404. are compatible with @code{sequence} and converted as needed.
  405. @item
  406. The @code{length} function is generalized to arbitrary sequences. (For
  407. strings it uses the @code{CharSequence.length} method, which returns the
  408. number of (16-bit) code units. This is different from the
  409. @code{string-length} function, which returns the number of Unicode code
  410. points.)
  411. @item
  412. A new pseudo-character value @code{#\ignorable-char} is introduced. It
  413. is ignored in string-construction contexts.
  414. @item
  415. The function-call syntax for indexing works for all sequences. If the
  416. sequence is a string, the result is the Unicode (20-bit) scalar value at
  417. the specified index. If index references the trailing surrogate of a
  418. surrogate pair the result is @code{#\ignorable-char}. This allows
  419. efficient indexing of strings: Handing of surrogate pairs are handled
  420. automatically as long as @code{#\ignorable-char} is skipped.
  421. @item
  422. Indexing of uniform vector types (such as @code{s64vector} or
  423. @code{f64vector} or @code{u16vector}) now return the ``standard''
  424. primitive type (such as @code{long} or @code{double}) or the new
  425. unsigned primitive (such as @code{ushort}). This improves performance
  426. (since we can generally use primitive types), and improves compatibility
  427. with Java arrays. Specifically, @code{s64vector} now implements
  428. @code{Sequence<Long>}, and thus @code{java.util.List<Long>} Note that
  429. indexing a @code{f64vector} returns a @code{double} which as an object
  430. is a @code{java.lang.Double}, not the Kawa floating-point type
  431. @code{gnu.math.DFloNum}. The result is usually the same, but @code{eqv?}
  432. might return a different result than previously.
  433. @item
  434. The arguments to @code{map}, @code{for-each}, and @code{vector-for-each}
  435. can now be any sequence (including strings and native arrays). The
  436. arguments to @code{vector-for-each} can now be arbitrary
  437. @code{java.util.List} values. All of these are inlined. If the sequence
  438. type is known, more efficient custom code is generated.
  439. @item
  440. A range represents an enumerable sequence, normally integers, but it is
  441. represented compactly using the start value, the step (usually 1), and
  442. size. There is a new convenient syntax for writing a range: if @code{i}
  443. and @code{j} are integers then @code{[i <=: j]} is the sequence of
  444. integers starting at @code{i} and ending at @code{j} (inclusive). You
  445. can also write @code{[i <=: j]} (excludes the upper bound),
  446. @code{[i >: j]} (counts down to @code{j}, exclusive), and
  447. @code{[i >=: j]} (counts down to @code{j}, inclusive).
  448. @item
  449. You can use a sequences of integers to index a sequence. The result is
  450. the sequence of the selected elements. In general
  451. @code{(seq [i0 ... in])} is @code{[(seq i0) ... (seq in)]}. This work
  452. well with ranges: @code{(seq [i <: j])} is the subsequence of @code{seq}
  453. from @code{i} to @code{j} (exclusive).
  454. If the @code{seq} is a string (a @code{CharSequence}) then the result is
  455. also a string. In this case the indexing behavior is slightly different
  456. in that indexing selects (16-bit) code units, which are combined to a
  457. string.
  458. @end itemize
  459. @item
  460. A new @code{dynamic} type is like @code{Object}. However, it forces
  461. runtime lookup and type-checking, and supresses compile-time type check
  462. and errors. (This is similar to C#. It is useful as an escape hatch if
  463. we ever implement traditional strict static type-checking.)
  464. @item
  465. Specifying the parameter type or return type of a function or method
  466. without a '@code{::}' is deprecated and results in a warning.
  467. @item
  468. In @code{--r7rs} mode: The '@code{l}' exponent suffix of a number
  469. literal creates a floating-point double, rather than a
  470. @code{BigInteger}.
  471. @item
  472. Added the hyperbolic functions: sinh, cosh, tanh, asinh, acosh, atanh.
  473. @item
  474. The @code{equal?} function can now handle cyclic lists and vectors. So
  475. can @code{equal-hash}.
  476. @item
  477. The command-line option @code{--with-arg-count=N} allows finer control
  478. of command-line-processing. It is used before an ``action'', and
  479. specifies the @code{N} arguments following the action are set as the
  480. command-line-arguments. After the action, command-line-processing
  481. continues following those @code{N} arguments.
  482. @item
  483. Added the R6RS module @code{(rnrs arithmetic bitwise)}.
  484. @item
  485. The @code{kawa.repl} argument processor now handles @code{-D} options.
  486. @item
  487. The new @code{class} sub-form of @code{import} allows you to import
  488. classes, and give them abbreviated names, like the Java @code{import}
  489. statement. The new form is more compact and convenient than
  490. @code{define-alias}.
  491. You can also use a classname directly, as a symbol, instead of writing
  492. it in the form of a list:
  493. @verbatim
  494. (import (only java.lang.Math PI))
  495. @end verbatim
  496. @item
  497. In the @code{only} clause of the @code{import} syntax you can now
  498. directly rename, without having to write a @code{rename} clause.
  499. @item
  500. Changes in the calling-convention for @code{--full-tailcalls} yields a
  501. substantial speed-up in some situations.
  502. @item
  503. The type of boolean literals @code{#f} and @code{#t} is now primitive
  504. @code{boolean} rather than @code{java.lang.Boolean}.
  505. @item
  506. General multi-dimensional arrays can be indexed with function call
  507. notation. E.g. @code{(arr i j k)} is equivalent to
  508. @code{(array-ref a i j k)}. You can also use @code{set!} with either
  509. @code{array-ref} or function call notation.
  510. @item
  511. The @code{#!null} value (Java @code{null}) is now considered false, not
  512. true. Likewise for non-canonical false Boolean objects (i.e. all
  513. instances of @code{java.lang.Boolean} for which @code{booleanValue}
  514. returns false, not just @code{Boolean.FALSE}).
  515. @item
  516. New standard libraries @code{(kawa base)} and @code{(kawa reflect)}.
  517. @item
  518. You can now use patterns in the @code{let} form and related forms.
  519. @item
  520. Implemented the @uref{http://en.wikipedia.org/wiki/Lambda_lifting,lambda
  521. lifting} optimzation.
  522. @item
  523. An expression that has type T is now considered compatible with a
  524. context requiring an interface type I only if T implements I (or T is
  525. Object). (Before they were considered possibly-compatible if T was
  526. non-final because the run-time class might be a subclass of T that
  527. implements I.)
  528. @item
  529. New @code{--console} flag forces input to be treated as an interactive
  530. console, with prompting. This is needed on Windows under Emacs, where
  531. @code{System.console()} gives the wrong result.
  532. @item
  533. You can now in a sub-class reference fields from not-yet-compiled
  534. super-classes. (This doesn't work for methods yet.)
  535. @item
  536. The @code{(? name::type value)} operator supports conditional binding.
  537. The @code{(! name::type value)} operator supports unconditional binding;
  538. it is similar to @code{define-constant}, but supports patterns.
  539. @item
  540. More efficient implementation of @code{call-with-values}: If either
  541. argument is a fixed-arity lambda expression it is inlined. Better
  542. type-checking of both @code{call-with-values} and @code{values}.
  543. @item
  544. Jamison Hope enhanced the support for quaternions, primarily the new
  545. @code{(kawa rotations)} library.
  546. @end itemize
  547. @subheading Kawa 2.0 (December 2 2014)
  548. @anchor{#kawa-2.0-december-2-2014}
  549. There are many new features, but the big one is R7RS compatibility.
  550. @itemize
  551. @item
  552. New @code{define-alias} can define aliases for static class members.
  553. @item
  554. The treatment of keywords is changing to not be self-evaluating (in
  555. Scheme). If you want a literal keyword, you should quote it. Unquoted
  556. keywords should only be used for keyword arguments. (This will be
  557. enforced in a future release.) The compiler now warns about badly formed
  558. keyword arguments, for example if a value is missing following a
  559. keyword.
  560. @item
  561. The default is now Java 7, rather than Java 6. This means the checked-in
  562. source code is pre-processed for Java 7, and future binary releases will
  563. require Java 7.
  564. @item
  565. The behavior of parameters and fluid variables has changed. Setting a
  566. parameter no longer changes its value in already-running sub-threads.
  567. The implementation is simpler and should be more efficient.
  568. @item
  569. The form @code{define-early-constant} is similar to
  570. @code{define-constant}, but it is evaluated in a module's class
  571. initializer (or constructor in the case of a non-static definition).
  572. @item
  573. Almost all of R7RS is now working:
  574. @itemize
  575. @item
  576. Importing a SRFI library can now use the syntax
  577. @code{(import (srfi N [name]))}
  578. @item
  579. The various standard libraries such as @code{(scheme base)} are
  580. implemented.
  581. @item
  582. The functions @code{eval} and @code{load} can now take an
  583. environment-specifier. Implemented the @code{environment} function.
  584. @item
  585. Extended @code{numerator}, @code{denominator}, @code{gcd}, and
  586. @code{lcm} to inexacts.
  587. @item
  588. The full R7RS library functionality is working, including
  589. @code{define-library} The keyword @code{export} is now a synonym for
  590. @code{module-export}, and both support the @code{rename} keyword. The
  591. @code{prefix} option of @code{import} now works.
  592. @item
  593. The @code{cond-expand} form now supports the @code{library} clause.
  594. @item
  595. Implemented @code{make-promise} and @code{delay-force} (equivalent to
  596. the older name @code{lazy}).
  597. @item
  598. Changed @code{include} so that by default it first seaches the directory
  599. containing the included file, so by default it has the same effect as
  600. @code{include-relative}. However, you can override the search path with
  601. the @code{-Dkawa.include.path} property. Also implemented
  602. @code{include-ci}.
  603. @item
  604. Implemented @code{define-values}.
  605. @item
  606. Fixed @code{string->number} to correctly handle a radix specifier in the
  607. string.
  608. @item
  609. The @code{read} procedure now returns mutable pairs.
  610. @item
  611. If you need to use @code{...} in a @code{syntax-rules} template you can
  612. use @code{(... template)}, which disables the special meaning of
  613. @code{...} in @code{template}. (This is an extension of the older
  614. @code{(... ...)}.)
  615. @item
  616. Alternatively, you can can write
  617. @code{(syntax-rules dots (literals) rules)}. The symbol @code{dots}
  618. replaces the functionality of @code{...} in the @code{rules}.
  619. @item
  620. An underscore @code{_} in a @code{syntax-rules} pattern matches
  621. anything, and is ignored.
  622. @item
  623. The @code{syntax-error} syntax (renamed from @code{%syntax-error})
  624. allows error reporting in @code{syntax-rules} macros. (The older
  625. Kawa-specific @code{syntax-error} procedure was renamed to
  626. @code{report-syntax-error}.)
  627. @item
  628. Implemented and documented R7RS exception handling: The syntax
  629. @code{guard} and the procedures @code{with-exception-handler},
  630. @code{raise}, and @code{raise-continuable} all work. The @code{error}
  631. procedure is R7RS-compatible, and the procedures @code{error-object?},
  632. @code{error-object-message}, @code{error-object-irritants},
  633. @code{file-error?}, and @code{read-error?} were implemented.
  634. @item
  635. Implemented @code{emergency-exit}, and modified @code{exit} so
  636. finally-blocks are executed.
  637. @item
  638. Implemented @code{exact-integer?}, @code{floor/}, @code{floor-quotient},
  639. @code{floor-remainder}, @code{truncate/}, @code{truncate-quotient}, and
  640. @code{truncate-remainder}.
  641. @item
  642. The @code{letrec*} syntax is now supported. (It works the same as
  643. @code{letrec}, which is an allowed extension of @code{letrec}.)
  644. @item
  645. The functions @code{utf8->string} and @code{string->utf8} are now
  646. documented in the manual.
  647. @end itemize
  648. @item
  649. The changes to characters and strings are worth covering separately:
  650. @itemize
  651. @item
  652. The @code{character} type is now a new primitive type (implemented as
  653. @code{int}). This can avoid boxing (object allocation)
  654. @item
  655. There is also a new @code{character-or-eof}. (A union of
  656. @code{character} and the EOF value, except the latter is encoded as -1,
  657. thus avoiding object allocation.) The functions read-char and
  658. @code{peek-char} now return a @code{character-or-eof} value.
  659. @item
  660. Functions like @code{string-ref} that take a character index would not
  661. take into account non-BMP characters (those whose value is greater than
  662. @code{#xffff}, thus requiring two surrogate characters). This was
  663. contrary to R6RS/R7RS. This has been fixed, though at some performance
  664. cost . (For example @code{string-ref} and @code{string-length} are no
  665. longer constant-time.)
  666. @item
  667. Implemented a @uref{Strings.html#String-Cursor-API,@code{string-cursor}
  668. API} (based on Chibi Scheme). Thes allow efficient indexing, based on
  669. opaque cursors (actually counts of 16-bits @code{char}s).
  670. @item
  671. Optimized @code{string-for-each}, which is now the preferred way to
  672. iterate through a string.
  673. @item
  674. Implemented @code{string-map}.
  675. @item
  676. New function @code{string-append!} for in-place appending to a mutable
  677. string.
  678. @item
  679. New function @code{string-replace!} for replacing a substring of a
  680. string with some other string.
  681. @item
  682. The SRFI-13 function @code{string-append/shared} is no longer
  683. automatically visible; you have to @code{(import (srfi :13 strings))} or
  684. similar.
  685. @end itemize
  686. @item
  687. The @code{module-name} form allows the name to be a list, as in a
  688. R6RS/R7RS-style library name.
  689. @item
  690. The syntax @code{@@expression} is a @emph{splicing form}. The
  691. @code{expression} must evaluate to a sequence (vector, list, array,
  692. etc). The function application or constructor form is equivalent to all
  693. the elements of the sequence.
  694. @item
  695. The parameter object @code{current-path} returns (or sets) the default
  696. directory of the current thread.
  697. @item
  698. Add convenience procedures and syntax for @uref{Processes.html,working
  699. with processes}: @code{run-process}, @code{process-exit-wait},
  700. @code{process-exit-ok?}, @code{&cmd}, @code{&`}, @code{&sh}.
  701. @item
  702. The functions @code{path-bytes}, and @code{path-data} can
  703. @uref{http://www.gnu.org/software/kawa/Reading-and-writing-whole-files.html,read
  704. or write the entire contents of a file}. Alternatively, you can use the
  705. short-hand syntax: @code{&<@{pname@}} @code{&>@{pname@}}
  706. @code{&>>@{pname@}}. These work with "blobs" which may be text or binary
  707. depending on context.
  708. @item
  709. The initial values of @code{(current-output-port)} and
  710. @code{(current-error-port)} are now hybrid textual/binary ports. This
  711. means you can call @code{write-bytevector} and @code{write-u8} on them,
  712. making it possible for an application to write binary data to standard
  713. output. Similarly, initial value of @code{(current-input-port)} is a
  714. hybrid textual/binary port, but only if there is no console (standard
  715. input is not a tty).
  716. @item
  717. Jamison Hope contributed support for
  718. @uref{http://en.wikipedia.org/wiki/Quaternion,quaternions}, a
  719. generalization of complex numbers containing 4 real components.
  720. @item
  721. Andrea Bernardini contributed an optimized implementation of @code{case}
  722. expressions. He was sponsored by Google Summer of Code.
  723. @item
  724. The @code{kawa.sh} shell script (which is installed as @code{kawa} when
  725. @emph{not} configuring with @code{--enable-kawa-frontend}) now handles
  726. @code{-D} and @code{-J} options. The @code{kawa.sh} script is now also
  727. built when usint Ant.
  728. @item
  729. The @code{cond-expand} features @code{java-6} though @code{java-9} are
  730. now set based on the @code{System} property @code{"java.version"}
  731. (rather than how Kawa was configured).
  732. @item
  733. An Emacs-style @code{coding} declaration allows you to specify the
  734. encoding of a Scheme source file.
  735. @item
  736. The command-line option @code{--debug-syntax-pattern-match} prints
  737. logging importation to standard error when a @code{syntax-rules} or
  738. @code{syntax-case} pattern matches.
  739. @item
  740. @uref{http://srfi.schemers.org/srfi-60/srfi-60.html,SRFI-60 (Integers as
  741. Bits)} is now fully implemented.
  742. @item
  743. Ported @uref{http://srfi.schemers.org/srfi-101/srfi-101.html,SRFI-101}.
  744. These are immutable (read-only) lists with fast (logarithmic) indexing
  745. and functional update (i.e. return a modified list). These are
  746. implemented by a @code{RAPair} class which extends the generic
  747. @code{pair} type, which means that most code that expects a standard
  748. list will work on these lists as well.
  749. @item
  750. The class @code{kawa.lib.kawa.expressions} contains an experimental
  751. Scheme API for manipulating and validating expressions.
  752. @item
  753. Internal: Changed representation used for multiple values to an abstract
  754. class with multiple implementations.
  755. @item
  756. Internal: Started converting to more standard Java code formatting and
  757. indentation conventions, rather than GNU conventions. Some files
  758. converted; this is ongoing work.
  759. @item
  760. Internal: Various I/O-related classes moved to new package
  761. @code{gnu.kawa.io}.
  762. @item
  763. Various changes to the @code{configure+make} build framework: A C
  764. compiler is now only needed if you configure with
  765. @code{--enable-kawa-frontend}. Improved support for building under
  766. Windows (using MinGW/MSYS).
  767. @item
  768. Support for building with @uref{http://gcc.gnu.org/java/,GCJ} was
  769. removed.
  770. @end itemize
  771. @subheading Kawa 1.14 (October 4, 2013)
  772. @anchor{#kawa-1.14-october-4-2013}
  773. @itemize
  774. @item
  775. You can pass flags from the @code{kawa} front-end to the @code{java}
  776. launcher using @code{-J} and @code{-D} flags. The @code{kawa} front-end
  777. now passes the @code{kawa.command.line} property to Java; this is used
  778. by the @code{(command-line)} procedure.
  779. @item
  780. Various improvements to the shell-script handling, including
  781. @uref{Scripts.html,re-written documentation}.
  782. @item
  783. Some initial support for Java 8.
  784. @item
  785. More of R7RS is now working:
  786. @itemize
  787. @item
  788. After adding list procedures @code{make-list}, @code{list-copy},
  789. @code{list-set!} all the R7RS list procedures are implemented.
  790. @item
  791. Other added procedures: @code{square}, @code{boolean=?},
  792. @code{string-copy!}, @code{digit-value},
  793. @code{get-environment-variable}, @code{get-environment-variables},
  794. @code{current-second}, @code{current-jiffy}, @code{jiffies-per-second},
  795. and @code{features}.
  796. @item
  797. The predicates @code{finite?}, @code{infinite?}, and @code{nan?} are
  798. generalized to complex numbers.
  799. @item
  800. The procedures @code{write}, @code{write-simple}, and
  801. @code{write-shared} are now consistent with R7RS.
  802. @item
  803. String and character comparison functions are generalized to more than
  804. two arguments (but restricted to strings or characters, respectively).
  805. @item
  806. The procedures @code{string-copy}, @code{string->list}, and
  807. @code{string-fill!} now take optional (start,end)-bounds. All of the
  808. R7RS string functions are now implemented.
  809. @item
  810. Support @code{=>} syntax in @code{case} form.
  811. @item
  812. Support backslash-escaped special characters in symbols when inside
  813. vertical bars, such as @code{'|Hello\nworld|}.
  814. @item
  815. The new functions and syntax are documented in the @uref{index.html,Kawa
  816. manual}; look for the functions in the @uref{Overall-Index.html,index}.
  817. @end itemize
  818. @item
  819. Added @code{define-private-alias} keyword.
  820. @item
  821. Extended @uref{Strings.html#String-templates,string quasi-literals
  822. (templates)} as specified by
  823. @uref{http://srfi.schemers.org/srfi-109/srfi-109.html,SRFI-109}. For
  824. example, if @code{name} has the value @code{"John"}, then:
  825. @verbatim
  826. &{Hello &[name]!}
  827. @end verbatim
  828. evaluates to: @code{"Hello John!"}.
  829. @item
  830. Named quasi-literal constructors as specified by
  831. @uref{http://srfi.schemers.org/srfi-108/srfi-108.html,SRFI-108}.
  832. @item
  833. A symbol having the form @code{->type} is a type conversion function
  834. that converts a value to @code{type}.
  835. @item
  836. New and improved check for void-valued expressions in a context
  837. requiring a value. This is controlled by the new option
  838. @code{--warn-void-used}, which defaults to true.
  839. @item
  840. The @code{datum->syntax} procedure takes an optional third parameter to
  841. specify the source location. See @code{testsuite/srfi-108-test.scm} for
  842. an example.
  843. @item
  844. Instead of specifying @code{--main} the command line, you can now
  845. specify @code{(module-compile-options: main: #t)} in the Scheme file.
  846. This makes it easier to compile one or more application (main) modules
  847. along with other modules.
  848. @item
  849. A change to the data structure used to detect never-returning procedure
  850. uses a lot less memory. (Kawa 1.13 implemented a conservative detection
  851. of when a procedure cannot return. This analysis would sometimes cause
  852. the Kawa compiler to run out of memory. The improved analysis uses the
  853. same basic algorithm, but with a more space-efficient ``inverted'' data
  854. structure.)
  855. @item
  856. Multiple fixes to get Emacs Lisp (JEmacs) working (somewhat) again.
  857. @end itemize
  858. @subheading Kawa 1.13 (December 10, 2012)
  859. @anchor{#kawa-1.13-december-10-2012}
  860. @itemize
  861. @item
  862. We now do a simple (conservative) analysis of when a procedure cannot
  863. return. This is combined with earlier and more precise analysis of
  864. reachable code. Not only does this catch programmer errors better, but
  865. it also avoids some internal compiler errors, because Kawa could get
  866. confused by unreachable code.
  867. @item
  868. Implement 2-argument version of @code{log} function, as specified by
  869. R6RS and R7RS (and, prematurely, the Kawa documentation).
  870. @item
  871. Implement the R7RS @code{bytevector} functions. The @code{bytevector}
  872. type is a synonym for older @code{u8vector} type.
  873. @item
  874. Implement R7RS @code{vector} procedures. Various procedures now take
  875. (start,end)-bounds.
  876. @item
  877. Implement most of the R7RS input/output proecdures. Most significant
  878. enhancement is support for R7RS-conforming binary ports.
  879. @item
  880. Various enhancements to the manual, including merging in lots of text
  881. from R7RS.
  882. @item
  883. Improved Android support, including a more convenient Ant script
  884. contributed by Julien Rousseau. Also, documentation merged into manual.
  885. @end itemize
  886. @subheading Kawa 1.12 (May 30, 2012)
  887. @anchor{#kawa-1.12-may-30-2012}
  888. @itemize
  889. @item
  890. Implement a compile-time data-flow framework, similar to Single Static
  891. Assignment. This enables better type inference, improves some
  892. warnings/errors, and enables some optimizations.
  893. @item
  894. Jamison Hope added support for co-variant return types and bridge
  895. methods for generics.
  896. @item
  897. Macros were improved and more standards-conforming:
  898. @itemize
  899. @item
  900. @code{datum->syntax} and @code{syntax->datum} are preferred names for
  901. @code{datum->syntax-object} and @code{syntax-object->datum}.
  902. @item
  903. Implemented @code{bound-identifier=?} and re-wrote implementation of
  904. @code{free-identifier=?}.
  905. @item
  906. Implement @code{unsyntax} and @code{unsyntax-splicing}, along with the
  907. reader prefixes @code{#,} and @code{#,@@}.
  908. @end itemize
  909. @item
  910. New and improved lazy evaluation functionality:
  911. @itemize
  912. @item
  913. Lazy values (resulting from @code{delay} or @code{future}) are
  914. implicitly forced as needed. This makes ``lazy programming'' more
  915. convenient.
  916. @item
  917. New type @code{promise}.
  918. @item
  919. The semantics of promises (@code{delay} etc) is now compatible with
  920. @uref{http://srfi.schemers.org/srfi-45/srfi-45.html,SRFI 45}.
  921. @item
  922. ``Blank promises'' are useful for passing data between processes, logic
  923. programmming, and more. New functions @code{promise-set-value!},
  924. @code{promise-set-alias!}, @code{promise-set-exception!}, and
  925. @code{promise-set-thunk!}.
  926. @item
  927. The stream functions of
  928. @uref{http://srfi.schemers.org/srfi-41/srfi-41.html,SRFI-41} were
  929. re-implemented to use the new promise functionality.
  930. @end itemize
  931. @item
  932. Different functions in the same module can be compiled with or without
  933. full tailcall support. You can control this by using
  934. @code{full-tailcalls} in @code{with-compile-options}. You can also
  935. control @code{full-tailcalls} using @code{module-compile-options}.
  936. @item
  937. Charles Turner (sponsored by @uref{http://code.google.com/soc/,Google's
  938. Summer of Code}) enhanced the printer with support for
  939. @uref{http://srfi.schemers.org/srfi-38/,SRFI-38: External Representation
  940. for Data With Shared Structure}.
  941. @item
  942. Optimize tail-recursion in module-level procedures. (We used to only do
  943. this for internal functions, for reasons that are no longer relevant.)
  944. @item
  945. Add support for building Kawa on Windows using configure+make
  946. (autotools) and Cygwin.
  947. @item
  948. Some support for parameterized (generic) types:
  949. @verbatim
  950. Type[Arg1 Arg2 ... ArgN]
  951. @end verbatim
  952. is more-or-less equivalent to Java's:
  953. @verbatim
  954. Type<Arg1, Arg2, ..., ArgN>
  955. @end verbatim
  956. @item
  957. New language options @code{--r5rs}, @code{--r6rs}, and @code{--r7rs}
  958. provide better compatibility with those Scheme standards. (This is a
  959. work-in-progress.) For example @code{--r6rs} aims to disable Kawa
  960. extensions that conflict with R6RS. It does not aim to disable all
  961. extensions, only incompatible extensions. So far these extensions
  962. disable the colon operator and keyword literals. Selecting @code{--r5rs}
  963. makes symbols by default case-insensitive.
  964. @item
  965. The special tokens @code{#!fold-case} and @code{#!no-fold-case} act like
  966. comments except they enable or disable case-folding of symbols. The old
  967. @code{symbol-read-case} global is now only checked when a LispReader is
  968. created, not each time a symbol is read.
  969. @item
  970. You can now use square brackets to construct immutable sequences
  971. (vectors).
  972. @item
  973. A record type defined using @code{define-record-type} is now compiled to
  974. a class that is a member of the module class.
  975. @item
  976. Annotations are now supported.
  977. @uref{http://per.bothner.com/blog/2011/Using-JAXB-annotations/,This
  978. example} shows how to use
  979. @uref{http://java.sun.com/xml/downloads/jaxb.html,JAXB} annotations to
  980. automatically convert between between Java objects and XML files.
  981. @item
  982. Prevent mutation of vector literals.
  983. @item
  984. More R6RS procedures: @code{vector-map}, @code{vector-for-each},
  985. @code{string-for-each}, @code{real-valued?}, @code{rational-valued?},
  986. @code{integer-valued?}, @code{finite?}, @code{infinite?}, @code{nan?},
  987. @code{exact-integer-sqrt}.
  988. @item
  989. @uref{http://srfi.schemers.org/srfi-14/srfi-14.html,SRFI-14} ("character
  990. sets") and @uref{http://srfi.schemers.org/srfi-41/srfi-41.html,SRFI-41}
  991. ("streams") are now supported, thanks to porting done by Jamison Hope.
  992. @item
  993. Kawa now runs under JDK 1.7. This mostly involved fixing some errors in
  994. @code{StackMapTable} generation.
  995. @item
  996. You can now have a class created by @code{define-simple-class} with the
  997. same name as the module class. For example
  998. @code{(define-simple-class foo ...)} in a file @code{foo.scm}. The
  999. defined class will serve dual-purpose as the module class.
  1000. @item
  1001. Improvements in separating compile-time from run-time code, reducing the
  1002. size of the runtime jar used for compiled code.
  1003. @item
  1004. In the @code{cond-expand} conditional form you can now use
  1005. @code{class-exists:ClassName} as a feature ``name'' to tests that
  1006. @code{ClassName} exists.
  1007. @end itemize
  1008. @subheading Kawa 1.11 (November 11, 2010)
  1009. @anchor{#kawa-1.11-november-11-2010}
  1010. @itemize
  1011. @item
  1012. A new Kawa logo, contributed by @uref{http://jcubic.pl,Jakub
  1013. Jankiewicz}.
  1014. @item
  1015. A new @code{--warn-unknown-member} option, which generalizes
  1016. @code{--warn-invoke-unknown-method} to fields as well as methods.
  1017. @item
  1018. A new @uref{ant-kawac.html,@code{kawac} task}, useful for Ant
  1019. @code{build.xml} files, contributed by Jamison Hope.
  1020. @item
  1021. @uref{http://per.bothner.com/blog/2010/AndroidHelloScheme,Updated
  1022. Android support}.
  1023. @item
  1024. New @uref{Enumerations.html,@code{define-enum} macro} contributed by
  1025. Jamison Hope.
  1026. @item
  1027. Access specifiers @code{'final} and @code{'enum} are now allowed in
  1028. @code{define-class} and related forms.
  1029. @item
  1030. Optimized @code{odd?} and @code{even?}.
  1031. @item
  1032. If you specify the type of a @code{#!rest} parameter as an array type,
  1033. that will now be used for the "varargs" method parameter. (Before only
  1034. object arrays did this.)
  1035. @item
  1036. When constructing an object and there is no matching constructor method,
  1037. look for "@code{add}" methods in addition to "@code{set}" methods. Also,
  1038. allow passing constructor args as well as keyword setters.
  1039. @uref{Allocating-objects.html,See here} for the gory details.
  1040. @item
  1041. New @code{expand} function (contributed by Helmut Eller, and enabled by
  1042. @code{(require 'syntax-utils)}) for converting Scheme expressions to
  1043. macro-expanded forms.
  1044. @item
  1045. @uref{Anonymous-classes.html#SAM-conversion,SAM-conversion}: In a
  1046. context that expects a Single Abstract Method (SAM) type (for example
  1047. @code{java.lang.Runnable}), if you pass a lambda you will get an
  1048. @code{object} where the lambda implements the abstract method.
  1049. @item
  1050. In interactive mode allow dynamic rebinding of procedures. I.e. if you
  1051. re-define a procedure, the old procedure objects gets modified in-place
  1052. and re-used, rather than creating a new procedure object. Thus calls in
  1053. existing procedures will call the new version.
  1054. @item
  1055. Fix various threading issues related to compilation and eval.
  1056. @item
  1057. When @code{format} returns a string, return a @code{java.lang.String}
  1058. rather than a @code{gnu.lists.FString}. Also, add some minor
  1059. optimization.
  1060. @item
  1061. Inheritance of environments and fluid variables now work properly for
  1062. all child threads, not just ones created using @code{future}.
  1063. @end itemize
  1064. @subheading Kawa 1.10 (July 24, 2010)
  1065. @anchor{#kawa-1.10-july-24-2010}
  1066. @itemize
  1067. @item
  1068. Now defaults to using Java 6, when compiling from source. The pre-built
  1069. @code{jar} works with Java 5, but makes use of some Java 6 features
  1070. (@code{javax.script}, built-in HTTP server) if available.
  1071. @item
  1072. You can write @uref{XML-literals.html,XML literals} in Scheme code
  1073. prefixed by a @code{#}, for example:
  1074. @verbatim
  1075. #<p>The result is &{result}.</p>
  1076. @end verbatim
  1077. @item
  1078. New functions @code{element-name} and @code{attribute-name}.
  1079. @item
  1080. Various @uref{Server-side-scripts.html,Web server improvements}. You
  1081. have the option of using JDK 6's builtin
  1082. @uref{Options.html#Options-for-web-servers,web-server} for
  1083. @uref{Self-configuring-page-scripts.html,auto-configued web pages}.
  1084. Automatic import of web server functions, so you should not need to
  1085. @code{(import 'http)} any more.
  1086. @item
  1087. Kawa @uref{Hash-tables.html,hashtables} now extend @code{java.util.Map}.
  1088. @item
  1089. If a source file is specified on the @code{kawa} command line without
  1090. any options, it is read and compiled as a whole module before it is run.
  1091. In contrast, if you want to read and evaluate a source file line-by-line
  1092. you must use the @code{-f} flag.
  1093. @item
  1094. You can specify a class name on the @code{kawa} command line:
  1095. @verbatim
  1096. $ kawa fully.qualified.name
  1097. @end verbatim
  1098. This is like the @code{java} command. but you don't need to specify the
  1099. path to the Kawa runtime library, and you don't need a @code{main}
  1100. method (as long as the class is @code{Runnable}).
  1101. @item
  1102. The usual bug-fixes, including better handling of the @code{~F}
  1103. @code{format} directive; and fix in handling of macro hygiene of the
  1104. @code{lambda} (@uref{https://savannah.gnu.org/bugs/index.php?27042,bug
  1105. #27042}).
  1106. @item
  1107. Spaces are now optional before and after the '::' in type specifiers.
  1108. The preferred syntax leave no space after the '::', as in:
  1109. @verbatim
  1110. (define xx ::int 1)
  1111. @end verbatim
  1112. @item
  1113. @code{define-for-syntax} and @code{begin-for-syntax} work.
  1114. @item
  1115. You can now use @code{car}, @code{cdr} etc to work with @code{syntax}
  1116. objects that wrap lists, as in SRFI-72.
  1117. @item
  1118. You can now define a package alias:
  1119. @verbatim
  1120. (define-alias jutil java.util)
  1121. (define mylist :: jutil:List (jutil:ArrayList))
  1122. @end verbatim
  1123. @item
  1124. @code{--module-static} is now the default. A new
  1125. @code{--module-nonstatic} (or @code{--no-module-static}) option can be
  1126. used to get the old behavior.
  1127. @item
  1128. You can use @code{access:} to specify that a field is @code{'volatile}
  1129. or @code{'transient}.
  1130. @item
  1131. You can now have type-specifiers for multiple variables in a @code{do}.
  1132. @item
  1133. Imported variables are read-only.
  1134. @item
  1135. Exported variables are only made into Locations when needed.
  1136. @item
  1137. The letter used for the exponent in a floating-point literal determines
  1138. its type: @code{12s2} is a @code{java.lang.Float}, @code{12d2} is a
  1139. @code{java.lang.Double}, @code{12l2} is a @code{java.math.BigInteger},
  1140. @code{12e2} is a @code{gnu.math.DFloat}.
  1141. @item
  1142. Internal: Asking for a @code{.class} file using
  1143. @code{getResourceAsStream} on an @code{ArrayClassLoader} will now open a
  1144. @code{ByteArrayInputStream} on the class bytes.
  1145. @item
  1146. A new @code{disassemble} function.
  1147. @item
  1148. If @code{exp1} has type @code{int}, the type of @code{(+ exp1 1)} is now
  1149. (32-bit) @code{int}, rather than (unlimited-precision) @code{integer}.
  1150. Similar for @code{long} expressions, other arithmetic operations (as
  1151. appropriate), and other untyped integer literals (as long as they fit in
  1152. 32/64 bits respectively).
  1153. @item
  1154. Many more oprimization/specializations of arithmetic, especially when
  1155. argument types are known.
  1156. @item
  1157. Top-level bindings in a module compiled with @code{--main} are now
  1158. implicitly module-private, unless there is an explicit
  1159. @code{module-export}.
  1160. @item
  1161. @uref{http://srfi.schemers.org/srfi-2/srfi-2.html,SRFI-2}
  1162. (@code{and-let*}: an @code{and} with local bindings, a guarded @code{*}
  1163. special form) is now supported.
  1164. @item
  1165. The reader now supports shared sub-objects, as in
  1166. @uref{http://srfi.schemers.org/srfi-38/srfi-38.html,SRFI-38} and Common
  1167. Lisp: @code{(#2=(3 4) 9 #2# #2#)}. (Writing shared sub-objects is not
  1168. yet implemented.)
  1169. @item
  1170. A module compiled with @code{--main} by default exports no bindings
  1171. (unless overriden by an explicit @code{module-export}).
  1172. @item
  1173. Factor out compile-time only code from run-time code. The new
  1174. @code{kawart-version.jar} is smaller because it has less compile-time
  1175. only code. (Work in progress.)
  1176. @item
  1177. More changes for R6RS compatibility:
  1178. @itemize
  1179. @item
  1180. The reader now recognizes @code{+nan.0}, @code{+inf.0} and variations.
  1181. @item
  1182. The @code{div}, @code{mod}, @code{div0}, @code{mod0},
  1183. @code{div-and-mod}, @code{div0-and-mod0}, @code{inexact} and
  1184. @code{exact} functions were implemented.
  1185. @item
  1186. @code{command-line} and @code{exit}.
  1187. @end itemize
  1188. @end itemize
  1189. @subheading Kawa 1.9.90 (August 8, 2009)
  1190. @anchor{#kawa-1.9.90-august-8-2009}
  1191. @itemize
  1192. @item
  1193. Support for @code{javax.script}.
  1194. @item
  1195. Support for @uref{Regular-expressions.html,regular expressions}.
  1196. @item
  1197. Performance improvements:
  1198. @itemize
  1199. @item
  1200. Emit @code{iinc} instruction (to increment a local @code{int} by a
  1201. constant).
  1202. @item
  1203. Inline the @code{not} function if the argument is constant.
  1204. @item
  1205. If @code{call-with-current-continuation} is only used to exit a block in
  1206. the current method, optimize to a @code{goto}.
  1207. @item
  1208. Generate @code{StackMapTable} attributes when targeting Java 6.
  1209. @item
  1210. Kawa can now inline a function with multiple calls (without code
  1211. duplication) if all call sites have the same return location
  1212. (continuation). For example: @code{(if p (f a) (f b))}. Also mutually
  1213. tail-recursive functions are inlined, so you get constant stack space
  1214. even without @code{--full-tailcalls}. (Thanks for Helmut Eller for a
  1215. prototype.)
  1216. @end itemize
  1217. @item
  1218. A number of changes for R6RS compatibility:
  1219. @itemize
  1220. @item
  1221. The @code{char-titlecase}, @code{char-foldcase}, @code{char-title-case?}
  1222. library functions are implemented.
  1223. @item
  1224. Imported variables are read-only.
  1225. @item
  1226. Support the R6RS @code{import} keyword, including support for renaming.
  1227. @item
  1228. Support the R6RS @code{export} keyword (though without support for
  1229. renaming).
  1230. @item
  1231. Implemented the @code{(rnrs hashtables)} library.
  1232. @item
  1233. Implemented the @code{(rnrs sorting)} library.
  1234. @item
  1235. CommonLisp-style keyword syntax is no longer supported (for Scheme): A
  1236. colon followed by an identifier is no longer a keyword (though an
  1237. identifier followed by a colon is still a keyword). (One reason for this
  1238. change is to support SRFI-97.)
  1239. @item
  1240. The character names @code{#\delete}, @code{#\alarm}, @code{#\vtab} are
  1241. now supported. The old names @code{#\del}, @code{#\rubout}, and
  1242. @code{#\bel} are deprecated.
  1243. @item
  1244. Hex escapes in character literals are supported. These are now printed
  1245. where we before printed octal escapes.
  1246. @item
  1247. A hex escape in a string literal should be terminated by a semi-colon,
  1248. but for compatibily any other non-hex-digit will also terminate the
  1249. escape. (A terminating semi-colon will be skipped, though a different
  1250. terminator will be included in the string.)
  1251. @item
  1252. A backslash-whitespace escape in a string literal will not only ignore
  1253. the whitespace through the end of the line, but also any initial
  1254. whitespace at the start of the following line.
  1255. @item
  1256. The comment prefix @code{#;} skips the following S-expression, as
  1257. specified by
  1258. @uref{http://srfi.schemers.org/srfi-62/srfi-62.html,SRFI-62}.
  1259. @item
  1260. All the
  1261. @uref{http://www.r6rs.org/final/html/r6rs-lib/r6rs-lib-Z-H-12.html#node_sec_11.4,R6RS
  1262. exact bitwise arithmetic} functions are now implemented and
  1263. @uref{Logical-Number-Operations.html,documented in the manual}. The new
  1264. standard functions (for example @code{bitwise-and}) are now preferred
  1265. over the old functions (for example @code{logand}).
  1266. @item
  1267. If @code{delete-file} fails, throws an exception instead of returning
  1268. @code{#f}.
  1269. @end itemize
  1270. @item
  1271. The code-base now by default assumes Java 5 (JDK 1.5 or newer), and
  1272. pre-built @code{jar} files will require Java 5. Also, the Kawa source
  1273. code now uses generics, so you need to use a generics-aware
  1274. @code{javac}, passing it the appropriate @code{--target} flag.
  1275. @item
  1276. New SRFIs supported:
  1277. @itemize
  1278. @item
  1279. @uref{http://srfi.schemers.org/srfi-62/srfi-62.html,SRFI-62} -
  1280. S-expression comments.
  1281. @item
  1282. @uref{http://srfi.schemers.org/srfi-64/srfi-64.html,SRFI-64} - Scheme
  1283. API for test suites.
  1284. @item
  1285. @uref{http://srfi.schemers.org/srfi-95/srfi-95.html,SRFI-95} - Sorting
  1286. and Merging.
  1287. @item
  1288. @uref{http://srfi.schemers.org/srfi-97/srfi-97.html,SRFI-97} - Names for
  1289. SRFI Libraries. This is a naming convention for R6RS @code{import}
  1290. statements to reference SRFI libraries.
  1291. @end itemize
  1292. @item
  1293. In BRL text outside square brackets (or nested like @code{]this[}) now
  1294. evaluates to @code{UnescapedData}, which a Scheme quoted string
  1295. evaluates to @code{String}, rather than an @code{FString}. (All of the
  1296. mentioned types implement @code{java.lang.CharSequence}.)
  1297. @item
  1298. You can now
  1299. @uref{http://per.bothner.com/blog/2009/AndroidHelloScheme/,run Kawa
  1300. Scheme programs on Android}, Google's mobile-phone operating system.
  1301. @item
  1302. The macro @code{resource-url} is useful for accessing resources.
  1303. @item
  1304. A new command-line option @code{--target} (or @code{-target}) similar to
  1305. @code{javac}'s @code{-target} option.
  1306. @item
  1307. If there is no console, by default create a window as if @code{-w} was
  1308. specificed.
  1309. @item
  1310. If a class method (defined in @code{define-class},
  1311. @code{define-simple-class} or @code{object}) does not have its parameter
  1312. or return type specified, search the super-classes/interfaces for
  1313. matching methods (same name and number of parameters), and if these are
  1314. consistent, use that type.
  1315. @item
  1316. Trying to modify the @code{car} or @code{cdr} of a literal list now
  1317. throws an exception.
  1318. @item
  1319. The @code{.zip} archive created by @code{compile-file} is now
  1320. compressed.
  1321. @item
  1322. Java5-style varargs-methods are recognized as such.
  1323. @item
  1324. When evaluating or loading a source file, we now always compile to
  1325. bytecode, rather than interpreting ``simple'' expressions. This makes
  1326. semantics and performance more consistent, and gives us better exception
  1327. stack traces.
  1328. @item
  1329. The Scheme type specifier @code{<integer>} now handles automatic
  1330. conversion from @code{java.math.BigInteger} and the @code{java.lang}
  1331. classes @code{Long}, @code{Integer}, @code{Short}, and @code{Byte}. The
  1332. various standard functions that work on @code{<integer>} (for example
  1333. @code{gcd} and @code{arithmetic-shift}) can be passed (say) a
  1334. @code{java.lang.Integer}. The generic functions such as @code{+} and the
  1335. real function @code{modulo} should also work. (The result is still a
  1336. @code{gnu.math.IntNum}.)
  1337. @item
  1338. If a name such as (@code{java.util}) is lexically unbound, and there is
  1339. a known package with that name, return the @code{java.lang.Package}
  1340. instance. Also, the colon operator is extended so that
  1341. @code{package:name} evaluates to the @code{Class} for
  1342. @code{package.name}.
  1343. @item
  1344. @code{`prefix:,expression} works - it finds a symbol in @code{prefix}'s
  1345. package (aka namespace), whose local-name is the value of
  1346. @code{expression}.
  1347. @item
  1348. A quantity @code{3.0cm} is now syntactic sugar for
  1349. @code{(* 3.0 unit:cm)}. Similarly:@*
  1350. @code{(define-unit name value)}@*
  1351. is equivalent to:@*
  1352. @code{(define-constant unit:name value)}@*
  1353. This means that unit names follow normal name-lookup rules (except being
  1354. in the @code{unit} ``package''), so for example you can have local unit
  1355. definitions.
  1356. @item
  1357. You can specify whether a class has public or package access, and
  1358. whether it is translated to an interface or class.
  1359. @item
  1360. You can declare an abstract method by writing @code{#!abstract} as its
  1361. body.
  1362. @item
  1363. If a name of the form @code{type?} is undefined, but @code{type} is
  1364. defined, then treat the former as
  1365. @code{(lambda (x) (instance? x type))}.
  1366. @item
  1367. A major incompatible (but long-sought) change: Java strings (i.e.
  1368. @code{java.lang.String} values) are now Scheme strings, rather than
  1369. Scheme symbols. Since Scheme strings are mutable, while Java
  1370. @code{String}s are not, we use a different type for mutable strings:
  1371. @code{gnu.lists.FString} (this is not a change). Scheme string literals
  1372. are @code{java.lang.String} values. The common type for Scheme string is
  1373. @code{java.lang.CharSequence} (which was introducted in JDK 1.4).
  1374. Scheme symbols are now instances of
  1375. @uref{api/gnu/mapping/Symbol.html,@code{gnu.mapping.Symbol}},
  1376. specifically the @code{SimpleSymbol} class.
  1377. @item
  1378. A fully-qualified class name such as @code{java.lang.Integer} now
  1379. evaluates to the corresponding @code{java.lang.Class} object. I.e. it is
  1380. equivalent to the Java term @code{java.lang.Integer.class}. This assumes
  1381. that the name does not have a lexical binding, @emph{and} that it exists
  1382. in the class-path at compile time.
  1383. Array class names (such as @code{java.lang.Integer[]}) and primitive
  1384. types (such as @code{int}) also work.
  1385. The older angle-bracket syntax @code{<java.lang.Integer>} also works and
  1386. has the same meaning. It also evaluates to a @code{Class}. It used to
  1387. evaluate to a @uref{api/gnu/bytecode/Type.html,@code{Type}}, so this is
  1388. a change.
  1389. The name bound by a @code{define-simple-class} now evaluates to a
  1390. @code{Class}, rather than a
  1391. @uref{api/gnu/bytecode/ClassType.html,@code{ClassType}}. A
  1392. @code{define-simple-class} is not allowed to reference non-static
  1393. module-level bindings; for that use @code{define-class}.
  1394. @item
  1395. New convenience macro
  1396. @uref{Syntax-and-conditional-compilation.html,@code{define-syntax-case}}.
  1397. @end itemize
  1398. @subheading Kawa 1.9.1 (January 23, 2007)
  1399. @anchor{#kawa-1.9.1-january-23-2007}
  1400. @itemize
  1401. @item
  1402. Fix some problems building Kawa from source using @code{configure+make}.
  1403. @end itemize
  1404. @subheading Kawa 1.9.0 (January 21, 2007)
  1405. @anchor{#kawa-1.9.0-january-21-2007}
  1406. @itemize
  1407. @item
  1408. New types and functions for working with @uref{Paths.html,paths and
  1409. URIs}.
  1410. @item
  1411. Reader macros URI, namespace, duration.
  1412. @item
  1413. Simplified @uref{Source-distribution.html,build using gcj}, and added
  1414. configure flag --with-gcj-dbtool.
  1415. @item
  1416. If two ``word'' values are written, a space is written between them. A
  1417. word is most Scheme values, including numbers and lists. A Scheme string
  1418. is treated as a word by @code{write} but by not @code{display}.
  1419. @item
  1420. A new @code{--pedantic} command-line flag. It currently only affects the
  1421. XQuery parser.
  1422. @item
  1423. The @code{load-compile} procedure was removed.
  1424. @item
  1425. The string printed by the @code{--version} switch now includes the
  1426. Subversion revision and date (but only if Kawa was built using
  1427. @code{make} rather than @code{ant} from a checked-out Subversion tree).
  1428. @item
  1429. Kawa development now uses the
  1430. @uref{http://subversion.tigris.org/,Subversion (svn)} version control
  1431. system instead of CVS.
  1432. @item
  1433. Show file/line/column on unbound symbols (both when interpreted and when
  1434. compiled).
  1435. @item
  1436. Cycles are now allowed between @code{require}'d modules. Also, compiling
  1437. at set of modules that depend on each other can now specified on the
  1438. compilation command line in any order, as long as needed @code{require}
  1439. forms are given.
  1440. @item
  1441. The @uref{PathExpressions.html,``colon notation'' has been
  1442. generalized.}. The syntax @code{object:name} generally means to extract
  1443. a component with a given @code{name} from @code{object}, which may be an
  1444. object, a class, or a namespace.
  1445. @item
  1446. New command-line options @code{--debug-error-prints-stack-trace} and
  1447. @code{--debug-warning-prints-stack-trace} provide stack trace on static
  1448. error messages.
  1449. @item
  1450. The @uref{Software-License.html,license for the Kawa software} has been
  1451. changed to the
  1452. @uref{http://opensource.org/licenses/mit-license.php,X11/MIT license}.
  1453. @item
  1454. A much more @uref{Array-operations.html,convenient syntax for working
  1455. with Java arrays}.
  1456. The same function-call syntax also works for Scheme vectors, uniform
  1457. vectors, strings, lists - and anything else that implements
  1458. @code{java.util.List}.
  1459. @item
  1460. The fields and methods of a class and its bases classes are in scope
  1461. within methods of the class.
  1462. @item
  1463. Unnamed procedures (such as lambda expressions) are printed with the
  1464. source filename and line.
  1465. @item
  1466. The numeric compare functions (@code{=}, @code{<=}, etc) and
  1467. @code{number->string} now work when passed standard Java @code{Number}
  1468. objects (such as @code{java.lang.Long} or @code{java.math.BigDecimal}).
  1469. @item
  1470. @uref{http://srfi.schemers.org/srfi-10/srfi-10.html,SRFI-10} is now
  1471. implemented, providing the @code{#,(name args ...)} form. Predefined
  1472. constructor @code{name}s so far are @code{URI} and @code{namespace}. The
  1473. @code{define-reader-ctor} function is available if you
  1474. @code{(require 'srfi-10)}.
  1475. @item
  1476. A new @code{--script} option makes it easier to write Unix shell
  1477. scripts.
  1478. @item
  1479. Allow general URLs for loading (including the @code{-f} flag),
  1480. compilation and @code{open-input-file}, if the ``file name'' starts with
  1481. a URL ``scheme'' like @code{http:}.
  1482. @item
  1483. Classes defined (@emph{e.g.} with @code{define-simple-class}) in a
  1484. module can now mutually reference each other. On the other hand, you can
  1485. no longer @code{define-class} if the class extends a class rather than
  1486. an interface; you must use @code{define-simple-class}.
  1487. @item
  1488. @code{KawaPageServlet} now automatically selects language.
  1489. @item
  1490. @code{provide} macro.
  1491. @item
  1492. @code{quasisyntax} and the convenience syntax @code{#`}, from
  1493. @uref{http://srfi.schemers.org/srfi-72/srfi-72.html,SRFI-72}.
  1494. @item
  1495. @code{define-for-syntax}, @code{syntax-source}, @code{syntax-line}, and
  1496. @code{syntax-column}, for better compatibility with mzscheme.
  1497. @item
  1498. @uref{http://srfi.schemers.org/srfi-34/srfi-34.html,SRFI-34} (Exception
  1499. Handling for Programs), which implements @code{with-exception-handler},
  1500. @code{guard}, and @code{raise}, is now available, if you
  1501. @code{(require 'srfi-34)}.@*
  1502. Also, @uref{http://srfi.schemers.org/srfi-35/srfi-35.html,SRFI-35}
  1503. (Conditions) is available, if you @code{(require 'srfi-35)}.
  1504. @item
  1505. The @code{case-lambda} form from
  1506. @uref{http://srfi.schemers.org/srfi-16/srfi-16.html,SRFI-16} is now
  1507. implemented more efficiently.
  1508. @end itemize
  1509. @subheading Kawa 1.8 (October 18, 2005)
  1510. @anchor{#kawa-1.8-october-18-2005}
  1511. @uref{http://srfi.schemers.org/srfi-69/srfi-69.html,SRFI-69 ``Basic hash
  1512. tables''} is now available, if you @code{(require 'hash-table)} or
  1513. @code{(require 'srfi-69)}. This is an optimized and Java-compatible port
  1514. whose default hash function calls the standard @code{hashCode} method.
  1515. A @code{define-simple-class} can now have one (or more) explicit
  1516. constructor methods. These have the spcial name @code{*init*}. You can
  1517. call superclass constructors or sibling constructors (@code{this}
  1518. constructor calls) using the (admittedly verbose but powerful)
  1519. @code{invoke-special} form.
  1520. The @code{runnable} function creates a @code{Runnable} from a
  1521. @code{Procedure}. It is implemented using the new class
  1522. @code{RunnableClosure}, which is now also used to implement
  1523. @code{future}.
  1524. The @code{kawa} command can now be run ``in-place'' from the build
  1525. directory: @code{$build_dir/bin/kawa}.
  1526. The special field name @code{class} in @code{(static-name type 'class)}
  1527. or @code{(prefix:.class)} returns the @code{java.lang.Class} object
  1528. corresponding to the @code{type} or @code{prefix}. This is similar to
  1529. the Java syntax.
  1530. Contructing an instance (perhaps using @code{make}) of a class defined
  1531. using @code{define-simple-class} in the current module is much more
  1532. efficient, since it no longer uses reflection. (Optimizing classes
  1533. defined using @code{define-class} is more difficult.) The constructor
  1534. function defined by the @code{define-record-type} macro is also
  1535. optimized.
  1536. You can now access instance methods using this short-hand:
  1537. @code{(*:methodname instance arg ...)}@*
  1538. This is equivalent to: @code{(invoke instance 'methodname arg ...)}
  1539. You can now also access a fields using the same colon-notation as used
  1540. for accessing methods, except you write a dot before the field name:@*
  1541. @code{(type:.fieldname)} @code{ ;; }is like:
  1542. @code{(static-field type 'fieldname)}.@*
  1543. @code{(*:.fieldname instance)} @code{;;} is like:
  1544. @code{(field 'fieldname instance)}@*
  1545. @code{(type:.fieldname instance)} @code{;;} is like:
  1546. @code{(*:.fieldname (as instance type))}@*
  1547. These all work with @code{set!} - for example:
  1548. @code{(set! (*:.fieldname instance) value)}.
  1549. In the above uses of colon-notation, a @code{type} can be any one of:@*
  1550. - a namespace prefix bound using @code{define-namespace} to a namespace
  1551. uri of the form @code{"class:classname"};@*
  1552. - a namespace prefix using @code{define-namespace} bound to a
  1553. @code{<classname>} name, which can be a fully-qualified class name or a
  1554. locally-declared class, or an alias (which might be an imported
  1555. class);@*
  1556. - a fully qualified name of a class (that exists at compile-time), as in
  1557. @code{(java.lang.Integer:toHexString 123)}; or@*
  1558. - a @code{<classname>} variable, for example:
  1559. @code{(<list>:list3 11 12 13)}.
  1560. New fluid variables @code{*print-base*}, @code{*print-radix*},
  1561. @code{*print-right-margin*}, and @code{*print-miser-width*} can control
  1562. output formatting. (These are based on Common Lisp.)
  1563. You can new emit elipsis (@code{...}) in the output of a @code{syntax}
  1564. template using the syntax @code{(... ...)}, as in other
  1565. @code{syntax-case} implementations.
  1566. The @code{args-fold} program-argument processor from
  1567. @uref{http://srfi.schemers.org/srfi-37/srfi-37.html,SRFI-37} is
  1568. available after you @code{(require 'args-fold)} or
  1569. @code{(require 'srfi-37)}.
  1570. The @code{fluid-let} form now works with lexical bindings, and should be
  1571. more compatible with other Scheme implementations.
  1572. @code{(module-export namespace:prefix)} can be used to export a
  1573. namespace prefix.
  1574. Static modules are now implemented more similarly to non-static modules.
  1575. Specifically, the module body is not automatically run by the class
  1576. initializer. To get the old behavior, use the new
  1577. @code{--module-static-run} flag. Alternatively, instead of
  1578. @code{(module-static #t)} use @code{(module-static 'init-run)}.
  1579. Implement @uref{http://srfi.schemers.org/srfi-39/srfi-39.html,SRFI-39}
  1580. "Parameter-objects". These are like anonymous fluid values and use the
  1581. same implementation. @code{current-input-port},
  1582. @code{current-output-port}, and @code{current-error-port} are now
  1583. parameters.
  1584. Infer types of variables declared with a @code{let}.
  1585. Character comparisons (such as @code{char-=?}, @code{char-ci<?})
  1586. implemented much more efficiently --- and (if using Java5) work for
  1587. characters not in the Basic Multilingual Plane.
  1588. Major re-write of symbol and namespace handling. A
  1589. @uref{api/gnu/mapping/Symbol.html,@code{Symbol}} is now immutable,
  1590. consisting of a "print-name" and a pointer to a
  1591. @uref{api/gnu/mapping/Namespace.html,@code{Namespace}} (package). An
  1592. @uref{api/gnu/mapping/Environment.html,@code{Environment}} is a mapping
  1593. from @code{Symbol} to
  1594. @uref{api/gnu/mapping/Location.html,@code{Location}}.
  1595. Rename @code{Interpreter} to
  1596. @uref{api/gnu/expr/Language.html,@code{Language}} and
  1597. @code{LispInterpreter} to
  1598. @uref{api/gnu/kawa/lispexpr/LispLanguage.html,@code{LispLanguage}}.
  1599. Constant-time property list operations.
  1600. Namespace-prefixes are now always resolved at compile-time, never at
  1601. run-time.
  1602. @code{(define-namespace PREFIX <CLASS>)} is loosely the same as
  1603. @code{(define-namespace PREFIX "class:CLASS")} but does the right thing
  1604. for classes defined in this module, including nested or non-simple
  1605. classes.
  1606. Macros capture proper scope automatically, not just when using require.
  1607. This allows some internal macros to become private.
  1608. Major re-write of the macro-handling and hygiene framework. Usable
  1609. support for @code{syntax-case}; in fact some of the primitives (such as
  1610. @code{if}) are now implemented using @code{syntax-case}.
  1611. @code{(syntax form)} (or the short-cut @code{#!form)} evaluates to a
  1612. syntax object. @code{(define-syntax (mac x) tr)} same as
  1613. @code{(define-syntax mac (lambda (x) tr))}. The following non-hygienic
  1614. forms are equivalent:
  1615. @verbatim
  1616. (define-macro (macro-name (param ...) transformer)
  1617. (define-macro macro-name (lambda (param ...) transformer))
  1618. (defmacro macro-name (PARAM ...) transformer)
  1619. @end verbatim
  1620. Allow vectors and more general ellipsis-forms in patterns and templates.
  1621. A new configure switch @code{--with-java-source=version} allows you to
  1622. tweak the Kawa sources to match Java compiler and libraries you're
  1623. using. The default (and how the sources are distributed) is @code{2}
  1624. (for "Java 2" -- jdk 1.2 or better), but you can also select "@code{1}"
  1625. (for jdk 1.1.x), and "@code{5}" for Java 5 (jdk 1.5). You can also
  1626. specify a jdk version number: "@code{1.4.1}" is equivalent to "2" (for
  1627. now). Note the default source-base is incompatible with Java 5 (or more
  1628. generally JAXB 1.3 or DOM 3), unless you also @code{--disable-xml}.
  1629. Configure argument @code{--with-servlet}[@code{=servlet-api.jar}]
  1630. replaces @code{--enable-servlet}.
  1631. Function argument in error message are now numbered starting at one.
  1632. Type errors now give better error messages.
  1633. A new function calling convention, used for @code{--full-tailcalls}. A
  1634. function call is split up in two parts: A
  1635. @code{match0}/.../@code{matchN} method checks that the actual arguments
  1636. match the expected formal arguments, and leaves them in the per-thread
  1637. @uref{api/gnu/mapping/CallContext.html,@code{CallContext}}. Then after
  1638. the calling function returns, a zero-argument @code{apply()} methods
  1639. evaluates the function body. This new convention has long-term
  1640. advantages (performance, full continuations), but the most immediate
  1641. benefit is better handling of generic (otherloaded) functions. There are
  1642. also improved error messages.
  1643. Real numbers, characters, Lisp/Scheme strings
  1644. (@uref{api/gnu/lists/FString.html,@code{FString}}) and symbols all now
  1645. implement the @code{Comparable} interface.
  1646. In @code{define-class}/@code{define-simple-class}: [Most of this work
  1647. was funded by @uref{http://www.mercedsystems.com/,Merced Systems}.]
  1648. @itemize
  1649. @item
  1650. You can specify
  1651. @code{access: }[@code{'private}|@code{'protected}|@code{'publi}c|@code{'package}]
  1652. to set the Java access permissions of fields and methods.
  1653. @item
  1654. Methods can be static by using the @code{access: 'static} specifier.
  1655. @item
  1656. The reflective routines @code{invoke} , @code{field} ,
  1657. @code{static-field} , @code{slot-ref} , @code{slot-set!} can now access
  1658. non-public methods/fields when appropriate.
  1659. @item
  1660. Such classes are no longer initialized when the containing module is
  1661. loaded.
  1662. @item
  1663. The @code{expr} in @code{init-form: expr} is now evaluated in the outer
  1664. scope.
  1665. @item
  1666. A new @code{init: expr} evalues @code{expr} in the inner scope.
  1667. @item
  1668. An option name following @code{allocation:} can now be a string literal
  1669. or a quoted symbol. The latter is preferred: @code{allocation: 'class}.
  1670. @item
  1671. Added @code{'static} as a synonym for @code{'class} following
  1672. @code{allocation:}.
  1673. @item
  1674. Initialization of static field (@code{allocation: 'class init: expr})
  1675. now works, and is performed at class initialization time.
  1676. @item
  1677. You can use unnamed ``dummy fields'' to add initialization-time actions
  1678. not tied to a field:
  1679. @verbatim
  1680. (define-simple-class Foo ()
  1681. (:init (perform-some-action)))
  1682. @end verbatim
  1683. @end itemize
  1684. @subheading Kawa 1.7.90 (2003)
  1685. @anchor{#kawa-1.7.90-2003}
  1686. Various fixes and better error messages in number parsing. Some
  1687. optimizations for the divide function.
  1688. New framework for controlling compiler warnings and other features,
  1689. supporting command-line flags, and the Scheme forms
  1690. @code{with-compile-options} and @code{module-compile-options}. The flag
  1691. @code{--warn-undefined-variable} is useful for catching typos.
  1692. Implementation funded by @uref{http://www.mercedsystems.com/,Merced
  1693. Systems}.
  1694. New @code{invoke-special} syntax form (implemented by Chris Dean).
  1695. New @code{define-variable} form (similar to Common Lisp's
  1696. @code{defvar}).
  1697. @subheading Kawa 1.7 (June 7, 2003)
  1698. @anchor{#kawa-1.7-june-7-2003}
  1699. @uref{api/gnu/kawa/servlet/KawaPageServlet.html,@code{KawaPageServlet}}
  1700. allows automatic loading and on-the-fly compilation in a servlet engine.
  1701. See
  1702. @uref{../qexo/simple-xquery-webapp.html,http://www.gnu.org/software/qexo/simple-xquery-webapp.html}.
  1703. The default source-base requires various Java 2 features, such as
  1704. collection. However, @code{make-select1} will comment out Java2
  1705. dependencies, allowing you to build Kawa with an older Java
  1706. implementation.
  1707. The @code{-f} flag and the load function can take an absolute URL. New
  1708. Scheme functions @code{load-relative} and @code{base-uri}.
  1709. Imported implementation of cut and cute from
  1710. @uref{http://srfi.schemers.org/srfi-26/srfi-26.html,SRFI-26} (Notation
  1711. for Specializing Parameters without Currying).
  1712. The way top-level definitions (including Scheme procedures) are mapped
  1713. into Java fields is changed to use a mostly reversible mapping. (The
  1714. mapping to method names remains more natural but non-reversible.)
  1715. @code{define-alias} of types can now be exported from a module.
  1716. New @code{--no-inline} and @code{--inline=none} options.
  1717. You can use @code{define-namespace} to define ``namespace aliases''.
  1718. This is used for the new short-hard syntax for method invocation:@*
  1719. @code{(define-namespace Int32 "class:java.lang.Integer")}@*
  1720. @code{(Int32:toHexString 255)} => @code{"ff"}@*
  1721. @code{(Int32:toString (Int32:new "00255"))} => @code{"255"}@*
  1722. Alternatively, you can write:@*
  1723. @code{(java.lang.Integer:toHexString 255)} => @code{"ff"}
  1724. @uref{http://srfi.schemers.org/srfi-9/srfi-9.html,SRFI-9}
  1725. (define-record-type) has been implemented, and compiled to a
  1726. @code{define-class}, with efficient code.
  1727. The configure option @code{--with-collections} is now the default.
  1728. Unknowns are no longer automatically static.
  1729. If type not specified in a declaration, don't infer it from it initial
  1730. value. If no return type is specified for a function, default to
  1731. @code{Object}, rather than the return type of the body. (The latter
  1732. leads to undesirable different behaviour if definitions are
  1733. re-arranged.)
  1734. You can now define and use classes defined using @code{object},
  1735. @code{define-class}, and @code{define-simple-class} from the
  1736. ``interpreter'', as well as the compiler. Also, a bug where inherited
  1737. fields did not get initialized has been fixed.
  1738. There are several new procedures useful for servlets.
  1739. Numerical comparisions (@code{<}, @code{<=}, etc) now generates
  1740. optimized bytecode if the types of the operands have certain known
  1741. types. including efficient code for @code{<int>}, @code{<long>},
  1742. @code{<double>}, and @code{<integer>}. Much more code can now (with type
  1743. declaration) be written just as efficiently in Scheme as in Java.
  1744. There have been some internal re-arranging of how Expressions are
  1745. processed. The Scheme-specific Translator type now inherits from
  1746. Compilation, which replaces the old Parser class. A Complation is now
  1747. allocated much earlier, as part of parsing, and includes a
  1748. SourceMessages object. SourcesMessages now includes (default) line
  1749. number, which is used by Compilation for the "current" line numbers. The
  1750. ExpWalker class includes a SourceMessages instance (which it gets from
  1751. the Compilation). CanInline.inline method now takes ExpWalker parameter.
  1752. Checking of the number or parameters, and mapping known procedures to
  1753. Java methods are now both done during the inlining pass.
  1754. The user-visible effect is that Kawa can now emit error mesages more
  1755. cleanly more places; the inlining pass can be more agressive, and can
  1756. emit better error messages, which yields better type information. This
  1757. gives us better code with fewer warnings about unknown methods.
  1758. @subheading Changes from Kawa 1.6.98 to 1.6.99.
  1759. @anchor{#changes-from-kawa-1.6.98-to-1.6.99.}
  1760. A new language front-end handles a tiny subset of XSLT. An example is
  1761. the check-format-users test in gnu/xquery/testsuite/Makefile.
  1762. There are now converters between SAX2 and Consumer events, and a basic
  1763. implementation of XMLReader based on XMLParser.
  1764. The function as-xml prints a value in XML format.
  1765. Srfi-0 (cond-expand), srfi-8 (receive), and srfi-25 (multi-dimensional
  1766. arrays) are now implemented. So is srfi-1 (list library), though that
  1767. requires doing (require 'list-lib).
  1768. The JEmacs code is being re-organized, splitting out the Swing-dependent
  1769. code into a separate gnu.jemacs.swing package. This should make it
  1770. easier to add JEmacs implementation without Swing.
  1771. The class gnu.expr.Interpreter has various new 'eval' methods that are
  1772. useful for evaluating Scheme/BRL/XQuery/... expressions from Java.
  1773. Kawa now uses current versions of autoconf, autoamke, and libtool,
  1774. allowing the use of automake file inclusion.
  1775. The comparisons @code{<<}, @code{<=}, @code{-}, @code{>}, and @code{=>}
  1776. now compile to optimized Java arithmetic if both operands are
  1777. @code{<int>} or a literal that fits in @code{<int>}.
  1778. @subheading Changes from Kawa 1.6.97 to 1.6.98
  1779. @anchor{#changes-from-kawa-1.6.97-to-1.6.98}
  1780. Generated HTML and Postscrpt documents are no longer included in the
  1781. source distribution. Get @code{kawa-doc-version.tar.gz} instead.
  1782. (format #t ...) and (format PORT ...) now returns #!void instead of #t.
  1783. Support fluid bindings (fluid-let) for any thread, not just Future and
  1784. main.
  1785. A Unix script header @code{#!/PROGRAM} is ignored.
  1786. You can now take the same Kawa "web" program (written in Scheme,
  1787. KRL/BRL, or XQuery) and run it as either a servlet or a CGI script.
  1788. There are a number of new functions for accessing HTTP requests and
  1789. generating HTTP responses.
  1790. Kawa now supports a new experimental programming KRL (the "Kawa Report
  1791. Language"). You select this language using --krl on the Kawa command
  1792. link. It allows Scheme code to be inside template files, like HTML
  1793. pages, using a syntax based on BRL (brl.sourceforge.net). However, KRL
  1794. has soem experimental changes to both BRL and standard Scheme. There is
  1795. also a BRL-compatibile mode, selected using --brl, though that currently
  1796. only supports a subset of BRL functions.
  1797. If language is not explicitly specified and you're running a source file
  1798. (e.g. "java kawa.repl myscript.xql"), Kawa tried to derive the language
  1799. from the the filename extension (e.g. "xql"). It still defaults to
  1800. Scheme if there is no extension or the extension is unrecognized.
  1801. New command-line option --output-format alias --format can be used to
  1802. over-ride the format used to write out top-level (repl, load) values.
  1803. XMLPrinter can now print in (non-well-formed-XML) HTML.
  1804. @subheading Changes from Kawa 1.6.96 to 1.6.97
  1805. @anchor{#changes-from-kawa-1.6.96-to-1.6.97}
  1806. Changed lots of error messages to use pairs of single quotes rather than
  1807. starting with a backquote (accent grave): 'name' instead of `name'. Many
  1808. newer fonts make the latter look bad, so it is now discouraged.
  1809. The types @code{<String>} and @code{<java.lang.String>} new behave
  1810. differently. The type @code{<java.lang.String>} now works just like
  1811. (say) @code{<java.util.Hashtable>}. Converting an object to a
  1812. @code{<java.lang.String>} is done by a simple coercion, so the incoming
  1813. value must be a java.lang.String reference or null. The special type
  1814. @code{<String>} converts any object to a java.string.String by calling
  1815. toString; it also handles null by specially testing for it.
  1816. For convenience (and backwards compatibility) Kawa uses the type
  1817. @code{<String>} (rather than @code{<java.lang.String>}) when it sees the
  1818. Java type @code{java.lang}.String, for example in the argument to an
  1819. @code{invoke}.
  1820. The default behaviour of '[' and '] was changed back to be token (word)
  1821. constituents, matching R5RS and Common Lisp. However, you can easily
  1822. change this behaviour using the new setBrackMode method or the
  1823. defaultBracketMode static field in ReadTable.
  1824. You can now build Kawa from source using the Ant build system (from
  1825. Apache's Jakarta project), as an alternative to using the traditional
  1826. configure+make system. An advantage of Ant is that it works on most Java
  1827. systems, without requiring a Unix shell and commands. Specifically, this
  1828. makes it easy to build Kawa under MS-Windows. Thanks to James White for
  1829. contributing this support.
  1830. Added (current-error-port) which does the obvious.
  1831. The new let-values and let-values* macros from srfi-11 provide a more
  1832. convenient way to use multiple values.
  1833. All the abstract apply* and eval* methods now specify 'throws
  1834. Throwable'. A bunch of code was changed to match. The main visible
  1835. advantage is that the throw and primitive-throw procedures work for any
  1836. Throwable without requiring it to be (confusingly) wrapped.
  1837. @subheading Changes from Kawa 1.6.95 to 1.6.96
  1838. @anchor{#changes-from-kawa-1.6.95-to-1.6.96}
  1839. A new compilation flag --servlet generates a Servlet which can be
  1840. deployed in a servlet engin like Tomcat. This is experimental, but it
  1841. seesm to work for both Scheme source and XQuery source.
  1842. The interface gnu.lists.CharSequence was renamed to avoid conflitcs with
  1843. the (similar) interface java.lang.CharSequence in JDK 1.4beta.
  1844. New --help option (contributed by Andreas Schlapbach).
  1845. Changed the code generation used when --full-tailcalls. It now is closer
  1846. to that used by default, in that we don't generate a class for each
  1847. non-inlined procedure. In both cases calling an unknown procedure
  1848. involves executing a switch statement to select a method. In addition to
  1849. generating fewer classes and simplifying one of the more fragile parts
  1850. of Kawa, it is also a step towards how full continuations will be
  1851. implemented.
  1852. Changed the convention for name "mangling" - i.e. how Scheme names are
  1853. mapped into Java names. Now, if a Scheme name is a valid Java name it is
  1854. used as is; otherwise a reversible mangling using "$" characters is
  1855. used. Thus the Scheme names @code{'<} and @code{'$Leq} are both mapped
  1856. into the same Java name @code{"$Leq"}. However, other names not
  1857. containing "@code{$}" should no longer clash, including pairs like
  1858. "@code{char-letter?}" and "@code{charLetter?}" and "@code{isCharLetter}"
  1859. which used to be all mapped to "@code{isCharLetter}". Now only names
  1860. containing "@code{$}" can be ambiguous.
  1861. If the compiler can determine that all the operands of (+ ...) or (-
  1862. ...) are floating-point, then it will generate optimized code using Java
  1863. primitive arithmetic.
  1864. Guile-style keyword syntax '#:KEYWORD' is recognized. (Note this
  1865. conflicts with Common Lisp syntax for uninterned symbols.)
  1866. New syntax forms define-class and define-simple-class allow you to
  1867. define classes more easily. define-class supports true multiple
  1868. inheritance and first class class values, where each Scheme class is
  1869. compiled to a pair of an inteface and a class. define-simple-class
  1870. generates more efficient and Java-compatible classes.
  1871. @subheading Changes from Kawa 1.6.94 to 1.6.95.
  1872. @anchor{#changes-from-kawa-1.6.94-to-1.6.95.}
  1873. A new language "xquery" implements a (so far small subset of) XQuery,
  1874. the draft XML Query languaage.
  1875. Various internal (Java API) changes: Changes to gnu.expr.Interpreter to
  1876. make it easier to add non-Lisp-like languages; gnu.lists.Consumer now
  1877. has an endAttribute method that need to be called after each attribute,
  1878. rather than endAttributes that was called after all of them.
  1879. If configured with --with-gcj, Kawa builds and intalls a 'gckawa' script
  1880. to simlify linking with needed libraries.
  1881. The @code{setter} function is now inlined, and
  1882. @code{(set! (field X 'N) V)} and @code{(set! (static-field <T> "N) V)}
  1883. are now inlined.
  1884. If configured @code{--with-gcj}, then a @code{gckawa} helper script is
  1885. installed, to make it easier to link Kawa+gcj-compiled applications.
  1886. @subheading Changes from Kawa 1.6.92 to 1.6.94
  1887. @anchor{#changes-from-kawa-1.6.92-to-1.6.94}
  1888. The JEmacs code now depends on CommonLisp, rather than vice versa, which
  1889. means Commonlisp no longer depends on Swing, and can be built with GCJ.
  1890. CommonLisp and JEmacs symbols are now implemented using Binding, not
  1891. String.
  1892. @subheading Changes from Kawa 1.6.90 to 1.6.92
  1893. @anchor{#changes-from-kawa-1.6.90-to-1.6.92}
  1894. Kawa now installs as a .jar file (kawa.jar symlinked to
  1895. kawa-VERSION.jar), rather than a collection of .class files.
  1896. The Kawa manual includes instructions for how to build Kawa using GCJ,
  1897. and how to compile Scheme code to a native executable using GCJ.
  1898. Kawa now has builtin pretty-printer support, using an algorithm from
  1899. Steel Bank Common Lisp converted from Lisp to Java. The high-level
  1900. Common Lisp pretty-printing features are mostly not yet implemented, but
  1901. the low-level support is there. The standard output and error ports
  1902. default to pretty-printing.
  1903. A new formatting framework uses the Consumer interface from gnu.lists.
  1904. You can associate a format with an output port. Common Lisp and JEmacs
  1905. finally print using their respective syntaxes.
  1906. All output ports (OutPort instances) are now automatically flushed on
  1907. program exit, using a new WriterManager helper class.
  1908. The new commmand-line option --debug-print-expr causes the Expression
  1909. for each expression to be printed. The option --debug-print-final-expr
  1910. is similar, but prints Expressions after optimization and just before
  1911. compilation. They are printed using the new pretty-printer.
  1912. Changed calling convention for --full-tailcalls to write results to a
  1913. Consumer, usually a TreeList or something to be printed. A top-level
  1914. ModuleBody now uses the same CpsProcedure convention. This is useful for
  1915. generating xml or html.
  1916. New libtool support allows kawa to be built as a shared library.
  1917. The new configure flag --with-gcj uses gcj to compile Kawa to both
  1918. .class files and native code. This is experimental.
  1919. @subheading Changes from Kawa 1.6.70 to 1.6.90
  1920. @anchor{#changes-from-kawa-1.6.70-to-1.6.90}
  1921. The reader (for Scheme and Lisp) has been re-written to be table-driven,
  1922. based on the design of Common Lisp readtables.
  1923. The new gnu.lists package has new implementations of sequence-related
  1924. classes. It replaces most of gnu.kawa.util. See the package.html file.
  1925. If the expected type of a non-unary @code{+} or @code{-} is @code{<int>}
  1926. or @code{<long>} and the operands are integeral types, then the operands
  1927. will converted to the primitive integer type and the addition or
  1928. subtraction done using primitive arithmetic. Similarly if the expected
  1929. type is @code{<float>} or @code{<long>} and the operands have
  1930. appropriate type. This optimization an make a big performance
  1931. difference. (We still need to also optimize compare operations like
  1932. @code{(< x y)} to really benefit from @code{<int>} declarations of loop
  1933. variables.)
  1934. The implementation of procedure closures has been changed to basically
  1935. be the same as top-level procedures (except when --full-tailcalls is
  1936. specified): Each procedure is now an instance of a ModuleMethod, which
  1937. each "frame" is an instance of ModuleBody, just like for top-level
  1938. functions. This sometimes reduces the number of classes generated, but
  1939. more importantly it simplifies the implementation.
  1940. A new @uref{api/gnu/xml/package-summary.html,@code{gnu.xml}} package
  1941. contains XML-related code, currently an XML parser and printer, plus
  1942. some XPath support. The class
  1943. @uref{api/gnu/lists/TreeList.html,@code{gnu.lists.TreeList}} (alias
  1944. @code{<document>}) is useful for compactly representing nested
  1945. structures, including XML documents. If you @code{(require 'xml)} you
  1946. will get Scheme interfaces (@code{print-as-xml} and
  1947. @code{parse-xml-from-url}) to these classes.
  1948. New package gnu.kawa.functions, for primitive functions (written in
  1949. Java).
  1950. The map and for-each procedure is now inlined. This is most especially
  1951. beneficial when it allows the mapped-over procedure to also be inlined,
  1952. such as when that procedure is a lambda expression.
  1953. Added documentation on compiling with Jikes. Renamed some classes to
  1954. avoid warning when compiling with Jikes.
  1955. The reverse! procedure was added.
  1956. Internal changes: * If a variable reference is unknown, create a
  1957. Declaration instance with the IS_UNKNOWN flag to represent an imported
  1958. binding. * The ExpWalker framework for "tree walking" Expressions had a
  1959. bit of reorganization. * New package gnu.kawa.functions, for primitive
  1960. functions (written in Java).
  1961. Added a hook for constant-folding and other optimization/inlining at
  1962. traversal (ExpWalker) time. Optimization of + and - procedures to use
  1963. primitive Java operations when the operands are primitive types.
  1964. Implementation of SRFI-17. Change the definitions of (set! (f x ...)
  1965. val) to ((setter f) x ... val), rather then the old ((setter f) val x
  1966. ...). You can now associate a setter with a procedure, either using
  1967. make-procedure or set-procedure-property!. Also, (setter f) is now
  1968. inlined, when possible.
  1969. Internally, Syntax (and hence Macro) no longer extend Declaration.
  1970. Various Java-level changes, which may be reflected in Scheme later: *
  1971. gnu.kawa.util.Consumer interface is similar to ObjectOutput and SAX's
  1972. ContentHandler interfaces. * A gnu.expr.ConsumerTarget is used when
  1973. evaluating to an implicit Consumer. * These interfaces will make it easy
  1974. to write functional-style but efficient code for transforming data
  1975. streams, including XML. * gnu.kawa.util.FString is now variable-size.
  1976. @subheading Changes from Kawa 1.6.68 to 1.6.70
  1977. @anchor{#changes-from-kawa-1.6.68-to-1.6.70}
  1978. The bare beginnings of Common Lisp support, enabled by the --commonlisp
  1979. (or --clisp) command line option. This is so far little more than a hack
  1980. of the EmacsLisp support, but with lexical scoping and CL-style format.
  1981. @subheading Changes from Kawa 1.6.66 to 1.6.68
  1982. @anchor{#changes-from-kawa-1.6.66-to-1.6.68}
  1983. JEmacs news:
  1984. @itemize
  1985. @item
  1986. Define emacs-version as Kawa version but with leading 0 instead of 1.
  1987. For example, the current value is "0.6.68 JEmacs".
  1988. @item
  1989. New testsuite directory.
  1990. @item
  1991. Improved autoload framework. Handle ELisp autoload comments.
  1992. @item
  1993. Handle escape and meta-key.
  1994. @item
  1995. Handle lot more of ELisp.
  1996. @item
  1997. Lots more is now done in ELisp, using .el files imported from XEmacs.
  1998. @item
  1999. Incomplete support for setting mark, including using selection.
  2000. @item
  2001. Basic (but incomplete) implementation of (interactive spec).
  2002. @item
  2003. Common Lisp extensions: typep, default arguments.
  2004. @item
  2005. A new status.html file to note what works and what doesn't.
  2006. @end itemize
  2007. You can now specify in @code{define} and @code{define-private} the type
  2008. of a variable. If the variable is module-level,
  2009. @code{(define name :: <type> value)} creates a field named
  2010. ``@code{name}'' having the specified type and initial value. (If type is
  2011. not specified, the default is not @code{Object}, but rather a
  2012. @code{Binding} that @emph{contains} the variable's value.)
  2013. You can now define the type of a module-level variable: In
  2014. (define[-private] :: type expression) New (define-constant name [::
  2015. type] expression) definition form.
  2016. A procedure can now have arbitrary properties associated with it. Use
  2017. procedure-property and set-procedure-property! to get and set them.
  2018. The new procedure make-procedure creates a generic procedure that may
  2019. contain one or more methods, as well as specified properties.
  2020. New declaration form define-base-unit. Both it and define-unit have been
  2021. re-implemented to be module-safe. Basically '(define-unit ft 12in)' is
  2022. sugar for '(define-constant ft$unit (... (* 12 in$unit)))', where
  2023. ft$unit and in$unit are standard identifiers managed by the module
  2024. system. Also, the output syntax for units and quantities is cleaner.
  2025. The new declaration (module-export name ...) allows control over the
  2026. names exported from a module. The new declaration (module-static ...)
  2027. allows control over which definitions are static and which are
  2028. non-static. This makes it easier to use a module as a Java class.
  2029. Procedures names that accidentally clash with inherited method names
  2030. (such as "run") are now re-named.
  2031. Simple aliases (define-aliases defining an alias for a variable name)
  2032. are implemented more efficiently.
  2033. The package hierarchy is getter cleaner, with fewer cyclic dependencies:
  2034. The gnu.math package no longer has any dependencies on kawa.* or gnu.*.
  2035. Two classes were moved from gnu.text to other classes, avoiding another
  2036. cyclic package dependency between gnu.text and gnu.mapping. The new
  2037. gnu.kawa.lispexpr is for compile-time handling of Lisp-like languages.
  2038. Compliation of literals has been re-done. A class that can be used in a
  2039. literal no longer needs to be declared as Compilable. Instead, you
  2040. declare it as implementaing java.io.Externalizable, and make sure it has
  2041. appropriate methods.
  2042. All the standard "data" types (i.e. not procedures or ports) now
  2043. implement java.io.Externalizable, and can thus be serialized. If they
  2044. appear in literals, they can also be compiled.
  2045. Created a new class gnu.kawa.util.AbstractString, with the Scheme alias
  2046. @code{<abstract-string>}. The old gnu.kawa.util.FString now extends
  2047. AbstractString. A new class CharBuffer provides an growable buffer, with
  2048. markers (automatically-adjusted positions). Many of the Scheme
  2049. @code{<string>} procedures now work on @code{<abstract-string>}. The
  2050. JEmacs BufferContnat class (contains the characters of a buffer) now
  2051. extends CharBuffer.
  2052. Some JEmacs changes to support a "mode" concept, as well as preliminary
  2053. support for inferior-process and telnet modes.
  2054. New section in manual / web page for projects using Kawa.
  2055. The record feasture (make-record-type etc) how handles "funny" type and
  2056. fields names that need to be "mangled" to Java names.
  2057. Re-did implementation of define-alias. For example, you can define
  2058. type-aliases:@*
  2059. @code{(define-alias <marker> <gnu.jemacs.buffer.Marker>)}@*
  2060. and then use <marker> instead of <gnu.jemacs.buffer.Marker>.
  2061. @code{(field array 'length)} now works.
  2062. @subheading Changes from Kawa 1.6.64 to 1.6.66
  2063. @anchor{#changes-from-kawa-1.6.64-to-1.6.66}
  2064. Added documentation to the manual for Homogeneous numeric vector
  2065. datatypes (SRFI-4).
  2066. You can now specify characters using their Unicode value: #\u05d0 is
  2067. alef.
  2068. Kawa now uses a more mnemonic name mangling Scheme. For example, a
  2069. Scheme function named @code{<=} would get compiled to method
  2070. @code{$Ls$Eq}.
  2071. There is now working and useful module support, thought not all features
  2072. are implemented. The basic idea is that a module can be any class that
  2073. has a default constructor (or all of whose fields and methods are
  2074. static); the public fields and methods of such a class are its exported
  2075. definitions. Compiling a Scheme file produces such a module. Doing:@*
  2076. @code{ (require <classname>)}@*
  2077. will create an anonymous instance of @code{<classname>} (if needed), and
  2078. add all its exported definitions to the current environment. Note that
  2079. if you import a class in a module you are compiling, then an instance of
  2080. the module will be created at compile-time, and imported definitions are
  2081. not re-imported. (For now you must compile a module, you cannot just
  2082. load it.)
  2083. The define-private keyword creates a module-local definition.
  2084. New syntax to override some properties of the current module:@*
  2085. @code{(module-name <name>)} overrides the default name for a module.@*
  2086. @code{(module-extends <class>)} specifies the super-class.@*
  2087. @code{(module-implements <interface> ...)} specfies the implemented
  2088. interfaces.
  2089. The syntax: (require 'keyword) is syntactic sugar for (require
  2090. <classname>) where the classname is find is a "module catalog"
  2091. (currently hard-wired). This provides compatibility with Slib. The Slib
  2092. "features" gen-write, pretty-print, pprint-file, and printf are now
  2093. available in Kawa; more will be added, depending on time and demand. See
  2094. the package directory gnu/kawa/slib for what is available.
  2095. @subheading Changes from Kawa 1.6.62 to 1.6.64
  2096. @anchor{#changes-from-kawa-1.6.62-to-1.6.64}
  2097. A lot of improvements to JEmacs (see JEmacs.SourceForge.net).
  2098. kawa-compiled-VERSION.zip is replaced by kawa-compiled-VERSION.jar.
  2099. You can now use Kawa to generate applets, using the new --applet switch,
  2100. Check the "Applet compilation" section in the manual. Generating an
  2101. application using the --main flag should work again. Neither --applet
  2102. nor --main has Scheme hard-wired any more.
  2103. A new macro `(this)' evaluates to the "this object" - the current
  2104. instance of the current class. The current implementation is incomplete,
  2105. and buggy, but it will have to do for now.
  2106. The command-line argument -f FILENAME will load the same files types as
  2107. load.
  2108. When a source file is compiled, the top-level definitions (procedures,
  2109. variables, and macros) are compiled to final fields on the resulting
  2110. class. This are not automatically entered into the current environment;
  2111. instead that is the responsibility of whoever loads the compiled class.
  2112. This is a major step towards a module system for Kawa.
  2113. There is a new form define-private which is like define, except that the
  2114. defined name is not exported from the current module.
  2115. A procedure that has optional arguments is now typically compiled into
  2116. multiple methods. If it's a top-level procedure, these will be methods
  2117. in the modules "ModuleBody" class, with the same (mangled) name. The
  2118. compiler can in many cases call the appropriate method directly.
  2119. Usually, each method takes a fixed number of arguments, which means we
  2120. save the overhead of creating an array for the arguments.
  2121. A top-level procedure declared using the form (define (NAME ARS ...)
  2122. BODY ..) is assumed to be "constant" if it isn't assigned to in the
  2123. current compilation unit. A call in the same compilation unit will now
  2124. be implemented as a direct method call. This is not done if the prcedure
  2125. is declared with the form: (define NAME (lambda (ARGS ,,,) BODY ...)
  2126. gnu.expr.Declaration no longer inherits from gnu.bytecode.Variable.
  2127. A gnu.mapping.Environment now resolves hash index collisions using
  2128. "double hashing" and "open addressing" instead of "chaining" through
  2129. Binding. This allows a Binding to appear in multiple Environments.
  2130. The classes Sequence, Pair, PairWithPosition, FString, and Char were
  2131. moved from kawa.lang to the new package gnu.kawa.util. It seems that
  2132. these classes (except perhaps Char) belong together. The classes List
  2133. and Vector were also moved, and at the same time renamed to LList and
  2134. FVector, respectively, to avoid clashed with classes in java.util.
  2135. New data types and procedures for "uniform vectors" of primitive types
  2136. were implemented. These follow the SRFI-4 specification, which you can
  2137. find at http://srfi.schemers.org/srfi-4/srfi-4.html .
  2138. You can now use the syntax @code{name :: type} to specify the type of a
  2139. parameter. For example:@*
  2140. @code{(define (vector-length x :: <vector>) (invoke x 'length))}@*
  2141. The following also works:@*
  2142. @code{(define (vector-length (x :: <vector>)) ...)}.
  2143. @code{(define-member-alias name object [fname])} is new syntactic sugar
  2144. for @code{(define-alias name (field object fname))}, where the default
  2145. for @code{fname} is the mangling of @code{name}.
  2146. @subheading Changes from Kawa 1.6.60 to 1.6.62
  2147. @anchor{#changes-from-kawa-1.6.60-to-1.6.62}
  2148. The new function `invoke' allows you to call a Java method. All of
  2149. `invoke', `invoke-static' and `make' now select the bets method. They
  2150. are also inlined at compile time in many cases. Specifically, if there
  2151. is a method known to be definitely applicable, based on compile-time
  2152. types of the argument expressions, the compiler will choose the most
  2153. specific such method.
  2154. The functions slot-ref, slot-set!, field, and static-field are now
  2155. inlined by the compiler when it can.
  2156. Added open-input-string, open-output-string, get-output-string from
  2157. SRFI-6. See http://srfi.schemers.org/srfi-6/srfi-6.html.
  2158. The manual has a new section "Mapping Scheme names to Java names", and a
  2159. new chapter "Types". The chapters "Extensions", "Objects and Classes",
  2160. and "Low-level functions" have been extensivley re-organized.
  2161. The Kawa license has been simplified. There used to be two licenses: One
  2162. for the packages gnu.*, and one for the packages kawa.*. There latter
  2163. has been replaced by the former. The "License" section of the manual was
  2164. also improved.
  2165. @subheading Changes from Kawa 1.6.59 to 1.6.60
  2166. @anchor{#changes-from-kawa-1.6.59-to-1.6.60}
  2167. There is a new package gnu.kawa.reflect. Some classes that used to be in
  2168. kawa.lang or kawa.standard are now there.
  2169. The procedures slot-ref and slot-set! are now available. They are
  2170. equivalent to the existing `field', but reading a field `x' will look
  2171. for `getX' method if there is no public `x' field; writing to a field
  2172. will look for `setX'.
  2173. The procedure `make' makes it convenient to create new objects.
  2174. There is now a teaser screen snapshot of "JEmacs" at
  2175. http://www.bothner.com/~per/papers/jemacs.png.
  2176. The html version of the manual now has a primitive index. The manual has
  2177. been slightly re-organized, with a new "Classes and Objects" chapter.
  2178. The new functions invoke-static and class-methods allow you to call an
  2179. arbitary Java method. They both take a class specification and a method
  2180. name. The result of class-methods is a generic procedure consisting of
  2181. those methods whose names match. (Instance methods are also matched;
  2182. they are treated the asme as class methods with an extra initial
  2183. argument.) The invoke-static function also takes extra arguments, and
  2184. actually calls the "best"-matching method. An example:
  2185. @verbatim
  2186. (invoke-static <java.lang.Thread> 'sleep 100)
  2187. @end verbatim
  2188. Many fewer classes are now generated when compiling a Scheme file. It
  2189. used to be that each top-level procedure got compiled to its own class;
  2190. that is no longer the case. The change should lead to faster startup and
  2191. less resource use, but procedure application will probably be noticably
  2192. slower (though not so much slower as when reflection is used). The
  2193. reason for the slowdown is that we in the general case now do an extra
  2194. method call, plus a not-yet-optimized switch statement. This change is
  2195. part of the new Kawa module system. That will allow the compiler to
  2196. substitute direct methods calls in more cases, which I hope will more
  2197. than make up for the slowdown.
  2198. A Scheme procedure is now in general compiled to a Java method whose
  2199. name is a "mangling" of the Scheme procedure's name. If the procedure
  2200. takes a variable number of parameters, then "$V" is added to the name;
  2201. this indicates that the last argument is a Java array containing the
  2202. rest of the arguments. Conversely, calling a Java method whose name ends
  2203. in "$V" passes any excess arguments in the last argument, which must be
  2204. an array type.
  2205. Many changes to the "Emacs-emulation" library in gnu.jemacs.buffer: *
  2206. Implemented commands to read and save files. * We ask for file and
  2207. buffer names using a dialog pop-up window. * Split windows correctly, so
  2208. that the windows that are not split keep their sizes, the windows being
  2209. split gets split as specified, and the frame does not change size. Now
  2210. also handles horizonal splits. * Fairly good support for buffer-local
  2211. keymaps and Emacs-style keymap search order. A new class BufferKeymap
  2212. manages the active keymaps of a buffer. Multi-key key-sequences are
  2213. handled. Pending prefix keys are remembered on a per-buffer basis
  2214. (whereas Emacs does it globally).
  2215. There is now some low-level support for generic procedures.
  2216. The R5RS primitives let-syntax and letrec-syntax for defining local
  2217. syntax extensions (macros) should now work. Also define-syntax works as
  2218. an internal definition. All of these should now be properly "hygienic".
  2219. (There is one known exception: symbols listed among the literals lists
  2220. are matched as raw symbols, rather that checking that the symbol has the
  2221. same binding, if any, as at the defining site.) The plan is to support
  2222. general functions as hygienic rewriters, as in the Chez Scheme
  2223. "syntax-case" system; as one part of that plan, the syntax-case
  2224. primitive is available, but so far without any of the supporting
  2225. machinary to support hygiene.
  2226. The read-line procedure was added. This allows you to efficiently read a
  2227. line from an input port. The interface is the same as scsh and Guile.
  2228. @subheading Changes from Kawa 1.6.58 to 1.6.59
  2229. @anchor{#changes-from-kawa-1.6.58-to-1.6.59}
  2230. define-alias now works both top-level and inside a function.
  2231. Optimized eqv? so if one of the arguments is constant and not Char or
  2232. Numeric, inline it the same way eq? is. (This helps case when the labels
  2233. are symbols, which help the "lattice" benchmark.) ???
  2234. The Emacs-related packages are now grouped under a new gnu.jemacs
  2235. package.
  2236. Improved framework for catching errors. This means improved error
  2237. messages when passing a parameter of the wrong type. Many standard
  2238. procedures have been improved.
  2239. Simplified, documented, and tested (!) procedure for building Kawa from
  2240. source under Windows (95/98/NT).
  2241. New macros trace and untrace for tracing procedures. After executing
  2242. (trace PROCEDURE), debugging output will be written (to the standard
  2243. error port) every time PROCEDURE is called, with the parameters and
  2244. return value. Use (untrace PROCEDURE) to turn tracing off.
  2245. New utility functions (system-tmpdir) and (make-temporary-file
  2246. [format]).
  2247. A new (unfinished) framework supports multiple languages. The
  2248. command-line option --elisp selects Emacs Lisp, while --scheme (the
  2249. default) selects Scheme. (The only difference so far is the reader
  2250. syntax; that will change.)
  2251. The `format' function now provides fairly complete functionality for
  2252. CommonLisp-style formatting. (See the Comon Lisp hyperspec at
  2253. http://www.harlequin.com/education/books/HyperSpec/Body/sec_22-3.html.)
  2254. The floating point formatters (~F, ~E, ~G, ~$) now pass the formatst.scm
  2255. test (from Slib, but with some "fixes"; in the testsuite directory).
  2256. Also, output ports now track column numbers, so @code{~T} and @code{~&}
  2257. also work correctly.
  2258. A new package gnu.emacs provides various building blocks for building an
  2259. Emacs-like text editor. These classes are only compiled when Kawa is
  2260. configured with the new --with-swing configuration option. This is a
  2261. large initial step towards "JEmacs" - an Emacs re-implemented to use
  2262. Kawa, Java, and Swing, but with full support (using gnu.elisp) for
  2263. traditional Emacs Lisp. For more imformation see
  2264. gnu/emacs/overview.html.
  2265. A new configuration option --with-swing can be used if Swing is
  2266. available. It is currently only used in gnu.emacs, but that may change.
  2267. @subheading Changes from Kawa 1.6.56 to 1.6.58
  2268. @anchor{#changes-from-kawa-1.6.56-to-1.6.58}
  2269. Kawa is now "properly tail-recursive" if you invoke it with the
  2270. --full-tail-calls flag. (Exception: the eval procedure does not perform
  2271. proper tail calls, in violation of R5RS. This will be fixed in a future
  2272. release.) Code compiled when --full-tail-calls is in effect is also
  2273. properly tail-recursive. Procedures compiled with --full-tail-calls can
  2274. call procedures compiled without it, and vice versa (but of course
  2275. without doing proper tail calls). The default is still
  2276. --no-full-tail-calls, partly because of performance concerns, partly
  2277. because that provides better compatibility with Java conventions and
  2278. tools.
  2279. The keywords let (including named let), let*, and letrec support type
  2280. specifiers for the declared variables For example:
  2281. @verbatim
  2282. (let ((lst :: <list> (foo x))) (reverse lst))
  2283. @end verbatim
  2284. Square brackets [ ... ] are allowed as a synonym of parentheses ( ... ).
  2285. @subheading Changes from Kawa 1.6.55 to 1.6.57
  2286. @anchor{#changes-from-kawa-1.6.55-to-1.6.57}
  2287. A new command-line flag --server PORT specifies that Kawa should run as
  2288. a telnet server on the specified PORT, creating a new read-eval-print
  2289. loop for each connection. This allows you to connect using any telnet
  2290. client program to a remote "Kawa server".
  2291. A new front-end program, written in C, that provides editing of input
  2292. lines, using the GNU readline library. This is a friendlier interface
  2293. than the plain "java kawa.repl". However, because kawa.c needs readline
  2294. and suitable networking library support, it is not built by default, but
  2295. only when you configure Kawa with the --enable-kawa-frontend flag.
  2296. The way Scheme names are mapped ("mangled") into Java identifiers is now
  2297. more natural. E.g. "foo-bar?" now is mapped to "isFooBar".
  2298. New syntax (object (SUPERS ...) FIELD-AND-METHODS ...) for creating a
  2299. new object instance of an anonymous class. Now fairly powerful.
  2300. New procedures field and static-field for more convenient field access.
  2301. Syntactic sugar: @code{(lambda args <type> body)} ->
  2302. @code{(lambda args (as <type> body))}. This is especially useful for
  2303. declaring methods in classes.
  2304. A new synchonized form allows you to synchronize on an arbitrary Java
  2305. object, and execute some forms while having an exclusive lock on the
  2306. object. (The syntax matches that used by Skij.)
  2307. @subheading Changes from Kawa 1.6.53 to 1.6.55
  2308. @anchor{#changes-from-kawa-1.6.53-to-1.6.55}
  2309. New --debug-dump-zip option writes out a .zip file for compilation.
  2310. (Useful for debugging Kawa.)
  2311. You can now declare parameter types.
  2312. Lot of work on more efficient procedure representation and calling
  2313. convention: Inlining, directly callable statics method, plus some
  2314. procedures no longer generate a separate Class.
  2315. Local functions that are only called from one locations, except for
  2316. tail-recursion, are now inlined. This inlines do loops, and most "named
  2317. let" loops.
  2318. New representation of closures (closures with captured local variables).
  2319. We no longer use an array for the closure. Instead we store the captured
  2320. variables in the Procedure itself. This should be faster (since we can
  2321. use field accesses rather than array indexing, which requires bounds
  2322. checking), and avoids a separate environment object.
  2323. If the compiler sees a function call whose (non-lexically-bound) name
  2324. matches an existing (globally-defined) procedure, and that procedure
  2325. instance has a static method named either "apply" or the mangled
  2326. procedure name, them the compiler emits a direct call to that method.
  2327. This can make a very noticable speed difference, though it may violate
  2328. strict Scheme sementics, and some code may break.
  2329. Partial support for first-class "location" variables.
  2330. @subheading Changes from Kawa 1.6.53 to 1.6.54
  2331. @anchor{#changes-from-kawa-1.6.53-to-1.6.54}
  2332. Created new packages gnu.mapping and gnu.expr. Many classes were moved
  2333. from kawa.lang to the new packages. (This is part of the long-term
  2334. process of splitting Kawa into more manageable chunks, separating the
  2335. Scheme-specific code from the language-independent code, and moving
  2336. classes under the gnu hierarchy.)
  2337. You can now write keywords with the colon first (e.g. :KEYWORD), which
  2338. has exactly the same effect and meaning as putting the colon last (e.g.
  2339. KEYWORD:). The latter is preferred is being more consistent with normal
  2340. English use of punctuation, but the former is allowed for compatibility
  2341. with soem other Scheme implementations and Common Lisp.
  2342. @subheading Changes from Kawa 1.6.52 to 1.6.53
  2343. @anchor{#changes-from-kawa-1.6.52-to-1.6.53}
  2344. The new package gnu.text contains facilities for reading, formatting,
  2345. and manipulating text. Some classes in kawa.lang where moved to there.
  2346. Added string-upcase!, string-downcase!, string-capitalize!,
  2347. string-upcase, string-downcase, and string-capitalize; compatible with
  2348. Slib.
  2349. Character constants can now use octal notation (as in Guile). Writing a
  2350. character uses octal format when that seems best.
  2351. A format function, similar to that in Common Lisp (and Slib) has been
  2352. added.
  2353. The default parameter of a #!optional or #!key parameter can now be
  2354. #!null.
  2355. @subheading Changes since Kawa 1.6.51
  2356. @anchor{#changes-since-kawa-1.6.51}
  2357. The "record" feature has been changed to that a "record-type descriptor"
  2358. is now a gnu.bytecode.ClassType (a @code{<record-type>}), rather than a
  2359. java.lang.Class. Thus make-record-type now returns a
  2360. @code{<record-typee>}, not a Class, and @code{record-type-descriptor}
  2361. takes a @code{<record-typee>}, not a Class.
  2362. More robust Eval interfaces.
  2363. New Lexer abstract class. New ScmRead class (which extends Lexer) now
  2364. contains the Scheme reader (moved from Inport). Now read errors are kept
  2365. in queue, and can be recovered from.
  2366. Comparing an exact rational and an inexact real (double) is now done as
  2367. if by first converting the double to exact, to satisfy R5RS.
  2368. @subheading Changes since Kawa 1.6.1
  2369. @anchor{#changes-since-kawa-1.6.1}
  2370. The compile virtual method in Expression now takes a Target object,
  2371. representing the "destination". The special ConditionalTarget is used to
  2372. evaluate the test of an 'if expression. This allows us to generate much
  2373. better code for and, or, eq?, not and nested if inside an if.
  2374. Added port-line, port-column, and set-port-line! to match Guile.
  2375. The Makefiles have been written so all out-of-date .java (or .scm).
  2376. files in a directory are compiled using a single invocation of javac (or
  2377. kawa). Building Kawa should now be much faster. (But note that this
  2378. depends on unreleased recent autoamke changes.)
  2379. How the Kawa version number is compiled into Kawa was changed to make it
  2380. easier for people who want to build from source on non-Unix-like
  2381. systems.
  2382. A new gnu.ecmascript package contains an extremely incomplete
  2383. implementation of ECMSScript, the ECMA standardized version of
  2384. JavaScript. It includes an ECMAScript lexer (basically complete), parser
  2385. (the framework is there but most of the language is missing), incomplete
  2386. expression evaluation, and a read-eval-print-loop (for testing only).
  2387. @subheading Changes in Kawa 1.6.1
  2388. @anchor{#changes-in-kawa-1.6.1}
  2389. Improved Kawa home page with extra links, pointer to Java-generated api
  2390. docs, and homepages for gnu.math and gnu.bytecode.
  2391. Implemented system, make-process, and some related procedures.
  2392. Added macros for primitive access to object fields, static fields, and
  2393. Java arrays. Added constant-fold syntax, and used it for the other
  2394. macros.
  2395. The --main flag compiles Scheme code to an application (containing a
  2396. main method), which can be be invoked directly by a Java interpreter.
  2397. Implemented --version (following GNU standards) as kawa.repl
  2398. command-line flag.
  2399. @subheading Changes since Kawa 1.5.93
  2400. @anchor{#changes-since-kawa-1.5.93}
  2401. Adding make procedure to create new objects/records.
  2402. Extended (set! (f . args) value) to be equivalent to ((setter f) value .
  2403. args). Implemented setter, as well as (setter car) and (setter cdr).
  2404. Can now get and set a record field value using an application: (rec
  2405. 'fname) gets the value of the field named fname in record rec. (set!
  2406. (rec 'fname) value) sets the value of the field named fname in rec.
  2407. A partial re-write of the implementation of input ports and the Scheme
  2408. reader, to fix some problems, add some features, and improve
  2409. performance.
  2410. Compiled .class files are now installed in $(datadir)/java, rather than
  2411. $(prefix)/java. By default, that means they are installed in
  2412. /usr/local/shared/java, rather than /usr/local/java.
  2413. There is now internal infrastructure to support inlining of procedures,
  2414. and general procedure-specific optimized code generation.
  2415. There is better testing that the right number of arguments are passed to
  2416. a procedure, and better error messages when you don't. If the procedure
  2417. is inlined, you get a compile-time error message.
  2418. The functions created by primitive-constructor,
  2419. primitive-virtual-method, primitive-static-method, and
  2420. primitive-interface-method are now first-class procedure values. They
  2421. use the Java reflection facily, except when the compiler can directly
  2422. inline them (in which case it generates the same efficient bytecodes as
  2423. before).
  2424. New functions instance? (tests type membership) and as (converts).
  2425. The kawa.html is now split into several files, one per chapter. The
  2426. table of contents is now kawa_toc.html.
  2427. The syntactic form try-catch provides low-level exception handler
  2428. support. It is basically the same as Java's try/catch form, but in
  2429. Scheme syntax. The new procedure primitive-throw throws an exception
  2430. object.
  2431. The higher-level catch and throw procedures implement exception handling
  2432. where the handler is specified with a "key" (a symbol). These functions
  2433. were taken from Guile.
  2434. The error function has been generalized to take multiple arguments (as
  2435. in Guile). It is now a wrapper around (throw 'misc-error ...).
  2436. There is a new "friendly" GUI access to the Kawa command-line. If you
  2437. invoke kawa.repl with the -w flag, a new interaction window is created.
  2438. This is uses the AWT TextArea class. You can create multiple "consoles".
  2439. They can either share top-level enevironments, or have separate
  2440. environments. This window interface has some nice features, including
  2441. editing. Added a scheme-window procedure, which is another way to create
  2442. a window.
  2443. @subheading Changes since Kawa 1.5
  2444. @anchor{#changes-since-kawa-1.5}
  2445. The default prompt now shows continuations lines differently.
  2446. The copy-file function was added.
  2447. The variable port-char-encoding controls how external files are
  2448. converted to/from internal Unicode characters. It also controls whether
  2449. CR and CR-LF are converted to LF.
  2450. The reader by default no longer down-cases letters in symbols. A new
  2451. variable symbol-read-case control how case is handled: 'P (the default)
  2452. preserves case; 'U upper-cases letters; 'D or -" down-cases letters; and
  2453. 'I inverts case.
  2454. The gnu.bytecode package now supports exception handlers. The new
  2455. syntactic form try-finally supports a cleanup hook that is run after
  2456. some other code finishes (normally or abnormally). Try-finally is used
  2457. to implement dynamic-wind and fluid-let.
  2458. The environment handling has been improved to support thread-specific
  2459. environments, a thread-safe fluid-let, and multiple top-levels. (The
  2460. latter still needs a bit of work.)
  2461. The gnu.bytecode package has been extensively changed. There are new
  2462. classes representing the various standard Attributes, and data
  2463. associated with an attribute is now stored there.
  2464. Added new procedures environment-bound? and
  2465. scheme-implementation-version.
  2466. Scheme symbols are represented as java.lang.String objects. Interned
  2467. symbols are interned Strings; uninterned symbols are uninterned Strings.
  2468. Note that Java strings literals are automatically interned in JDK 1.1.
  2469. This change makes symbols slightly more efficient, and moves Kawa closer
  2470. to Java.
  2471. Ports now use the JDK 1.1 character-based Reader and Writer classes,
  2472. rather than the byte-oriented InputStream and OutputStream classes. This
  2473. supports different reading and writing different character encodings [in
  2474. theory - there is no support yet for other than Ascii or binary files].
  2475. An interactive input port now has a prompt function associated with it.
  2476. It is settable with set-input-port-prompter!. The prompt function takes
  2477. one argument (the input port), and returns a prompt string. There are
  2478. also user functions for inquiring about the current line and column
  2479. number of an input port.
  2480. The R4RS procedures transcript-on and transcript-off are implemented.
  2481. Standard types can be referred to using syntax similar to RScheme. For
  2482. example Scheme strings now have the type @code{<string>} which is
  2483. preferred to "@code{kawa.lang.FString}" (which in addition to being
  2484. longer, is also more suspectible to changes in internal implementation).
  2485. Though these types are first-class values, this is so far mainly useful
  2486. for invoking primitive methods.
  2487. @subheading Changes from Kawa 1.4 to 1.5
  2488. @anchor{#changes-from-kawa-1.4-to-1.5}
  2489. Execute a ~/.kawarc.scm file on startup, if it exists.
  2490. Add a number of functions for testing, renaming, and deleting files.
  2491. These are meant to be compatible with scsh, Guile, and MIT Scheme:
  2492. file-exists?, file-directory?, file-readable?, file-writable?,
  2493. delete-file, rename-file, create-diretory, and the variable
  2494. home-directory.
  2495. Fixed some small bugs, mainly in gnu.math and in load.
  2496. Generalize apply to accept an arbitrary Sequence, or a primitive Java
  2497. array.
  2498. @subheading Changes from Kawa 1.2 to 1.4
  2499. @anchor{#changes-from-kawa-1.2-to-1.4}
  2500. The codegen package has been renamed gnu.bytecode. The kawa.math package
  2501. has been moved to gnu.math. Both packages have new license: No
  2502. restrictions if you use an unmodified release, but GNU General Public
  2503. License. Let me know if that causes problems. The rest of Kawa still has
  2504. the old license.
  2505. Implement defmacro and gentemp.
  2506. Implement make-record-type and related functions to create and use new
  2507. record types. A record type is implemented as a java.lang.Class object,
  2508. and this feature depends on the new reflection features of JDK 1.1.
  2509. Implement keywords, and extend lambda parameter lists to support
  2510. #!optional #!rest and #!keyword parameters (following DSSSL).
  2511. Added more primitives to call arbitrary interface and constructor
  2512. methods.
  2513. @subheading Changes from Kawa 1.0 to 1.2
  2514. @anchor{#changes-from-kawa-1.0-to-1.2}
  2515. Added primitives to make it easy to call arbitrary Java methods from
  2516. Scheme.
  2517. Exact rational arithetic is now fully implemented. All integer functions
  2518. now believed to correctly handle bignums. Logical operations on exact
  2519. integers have been implemented. These include all the logical functions
  2520. from Guile.
  2521. Complex numbers are implemented (except @{,a@}@{sin,cos,tan@}).
  2522. Quantities (with units) are implemented (as in DSSSL).
  2523. Eval is available, as specified for R5RS. Also implemented are
  2524. scheme-report-environment, null-environment, and
  2525. interaction-environment.
  2526. Internal define is implemented.
  2527. Rough support for multiple threads is implemented.
  2528. Moved kawa class to kawa/repl. Merged in kawac (compiler) functionality.
  2529. A 'kawa' shell-script is now created. This is now the preferred
  2530. interface to both the interactive evaluator and the compiler (on
  2531. Unix-like systems).
  2532. Now builds "without a snag" using Cafe 1.51 under Win95. (Symantec JIT
  2533. (ver 2.00b19) requires disabling JIT - @code{JAVA_COMPCMD=disable}.)
  2534. Compiles under JDK 1.1 beta (with some warnings).
  2535. A testsuite (and testing framework) was added.
  2536. Documentation moved to doc directory. There is now an internals
  2537. overview, in doc/kawa-tour.ps.
  2538. @subheading Changes since 0.4
  2539. @anchor{#changes-since-0.4}
  2540. The numeric classes have been re-written. There is partial support for
  2541. bignums (infinite-precision integers), but divide (for example) has not
  2542. been implemented yet. The representation of bignums uses 2's complement,
  2543. where the "big digits" are laid out so as to be compatible with the mpn
  2544. functions of the GNU Multi-Precision library (gmp). (The intent is that
  2545. a future version of Kawa will support an option to use gmp native
  2546. functions for speed.)
  2547. The kawa application takes a number of useful command-line switches.
  2548. Basically all of R4RS has been implemented. All the essential forms and
  2549. functions are implemented. Almost all of the optional forms are
  2550. implemented. The exceptions are transcript-on, transcript-off, and the
  2551. functions for complex numbers, and fractions (exact non-integer
  2552. rationals).
  2553. Loading a source file with load now wraps the entire file in a lambda
  2554. (named "atFileLevel"). This is for better error reporting, and
  2555. consistency with compile-file.
  2556. @subheading Changes since 0.3
  2557. @anchor{#changes-since-0.3}
  2558. The hygienic macros described in the appendix to R4RS are now impemented
  2559. (but only the define-syntax form). They are used to implement the
  2560. standard "do" form.
  2561. The R5RS multiple value functions @code{values} and
  2562. @code{call-with-values} are implemented.
  2563. Macros (and primitive syntax) can now be autoloaded as well as
  2564. procedures.
  2565. New kawac application compiles to one or more .class files.
  2566. Compile time errors include line numbers. Uncaught exceptions cause a
  2567. stack trace that includes .scm line numbers. This makes it more
  2568. practical to debug Kawa with a Java debugger.
  2569. Quasiquotation is implemented.
  2570. Various minor bug fixes and optimizations.
  2571. @subheading Changes since 0.2
  2572. @anchor{#changes-since-0.2}
  2573. The biggest single change is that Scheme procedures are now compiled to
  2574. Java bytecodes. This is mainly for efficiency, but it also allows us to
  2575. do tail-recursion-elimination in some cases.
  2576. The "codegen" library is included. This is a toolkit that handles most
  2577. of the details needed to generate Java bytecode (.class) files.
  2578. The internal structure of Kawa has been extensively re-written,
  2579. especially how syntax transforms, eval, and apply are done, largely due
  2580. to the needs for compilation.
  2581. Almost all the R4RS procedures are now implemented, except that there
  2582. are still large gaps in Section 6.5 "Numbers".