NEWS 180 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802
  1. Guile NEWS --- history of user-visible changes. -*- text -*-
  2. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
  3. See the end for copying conditions.
  4. Please send Guile bug reports to bug-guile@gnu.org.
  5. Guile 1.4.1 released 2002-05-13
  6. Changes since Guile 1.4:
  7. * installation fix: (ice-9 and-let*) has been renamed to (ice-9 and-let-star)
  8. This has been done to prevent problems on lesser operating systems
  9. that can't tolerate `*'s in file names. The exported macro continues
  10. to be named `and-let*', of course.
  11. On systems that support it, there is also a compatibility module named
  12. (ice-9 and-let*). It will go away in a future release.
  13. * build fix: net_db.c `inet_aton' declaration now properly conditionalized
  14. This buglet typically caused compilation to fail at
  15. libguile/net_db.c:85, and in fact, motivated 1.4.1 release.
  16. * bugfix: `expt' now handles negative exponents correctly
  17. * installation fix: some programs are no longer installed
  18. The following programs are used in the build process and are now no longer
  19. installed in $bindir.
  20. guile-doc-snarf
  21. guile-func-name-check
  22. guile-snarf.awk
  23. * guile-snarf usage now internalizes output-file creation/deletion
  24. In Guile 1.4, the installed (in $bindir) program "guile-snarf" wrote
  25. to standard output and required this kind of construction in the Makefile:
  26. guile-snarf foo.c $(snarf-cpp-opts) > foo.x || { rm foo.x; false; }
  27. The program now handles output-file deletion on error interanlly, and
  28. can be used like so:
  29. guile-snarf -o foo.x foo.c $(snarf-cpp-opts)
  30. The "-o OUTFILE INFILE $(snarf-cpp-opts)" must appear in the specified order.
  31. This usage is upward compatible with future guile-snarf programs. Support
  32. for the old usage is likely to be dropped in the future.
  33. * installation fix: libltdl now "installable" instead of "convenience"
  34. Previously, libguile included a private copy of libltdl. Now,
  35. configuration detects if libltdl is already installed, and uses that.
  36. If libltdl is not already installed, a copy is built and installed.
  37. In any case, libguile no longer includes libltdl, see next item.
  38. * library versioning now more disciplined
  39. The CURRENT:REVISION:AGE scheme is now applied to all shared-object
  40. libraries built as part of guile:
  41. guile-1.4 guile-1.4.1
  42. libguile 9.0.0 10.0.0
  43. libqthreads 0.0.0 0.1.0
  44. libguile-readline 0.0.0 0.1.0
  45. The change in CURRENT for libguile is due to libltdl unbundling
  46. (14 symbols w/ "lt_" prefix are no longer provided).
  47. * "make check" now works
  48. This optional step in the build process (between "make" and "make
  49. install") runs some tests on the built guile and reports a summary,
  50. something like:
  51. Totals for this test run:
  52. passes: 2109
  53. failures: 0
  54. unexpected passes: 0
  55. expected failures: 11
  56. unresolved test cases: 11
  57. untested test cases: 0
  58. unsupported test cases: 9
  59. errors: 0
  60. If there are any errors, "make check" fails.
  61. The tests comprising "make check" are located under the test-suite
  62. subdir, and can be run individually using the "check-guile" script, like
  63. so:
  64. check-guile numbers.test
  65. (This is how "make check" does it, too.) See the header comments in
  66. check-guile for more info. If you write new tests, send them to
  67. bug-guile.
  68. * provisional documentation available
  69. The data-rep.info that was included in Guile 1.4 is now incorporated
  70. into guile.info, which is a temporary placeholder for the reference manual
  71. that is still to be fully integrated at some point in the future.
  72. * interface summarization available
  73. Programming interfaces are now summarized in doc/guile-api.alist, in a
  74. program-friendly format. This file contains a single sexp of the form:
  75. ((meta ...) (interface ...))
  76. The meta fields are `GUILE_LOAD_PATH', `LTDL_LIBRARY_PATH', `guile'
  77. `libguileinterface', `sofile' and `groups'. The interface elements are
  78. in turn sub-alists w/ keys `groups' and `scan-data'. Interface elements
  79. initially belong in one of two groups `Scheme' or `C' (but not both) and
  80. sometimes belong in other groups (see doc/groupings.alist for defs).
  81. Guile 1.4 released 2000-06-21
  82. Changes since Guile 1.3.4:
  83. * Changes to the distribution
  84. ** Trees from nightly snapshots and CVS now require you to run autogen.sh.
  85. We've changed the way we handle generated files in the Guile source
  86. repository. As a result, the procedure for building trees obtained
  87. from the nightly FTP snapshots or via CVS has changed:
  88. - You must have appropriate versions of autoconf, automake, and
  89. libtool installed on your system. See README for info on how to
  90. obtain these programs.
  91. - Before configuring the tree, you must first run the script
  92. `autogen.sh' at the top of the source tree.
  93. The Guile repository used to contain not only source files, written by
  94. humans, but also some generated files, like configure scripts and
  95. Makefile.in files. Even though the contents of these files could be
  96. derived mechanically from other files present, we thought it would
  97. make the tree easier to build if we checked them into CVS.
  98. However, this approach means that minor differences between
  99. developer's installed tools and habits affected the whole team.
  100. So we have removed the generated files from the repository, and
  101. added the autogen.sh script, which will reconstruct them
  102. appropriately.
  103. ** configure now has experimental options to remove support for certain
  104. features:
  105. --disable-arrays omit array and uniform array support
  106. --disable-posix omit posix interfaces
  107. --disable-networking omit networking interfaces
  108. --disable-regex omit regular expression interfaces
  109. These are likely to become separate modules some day.
  110. ** New configure option --enable-debug-freelist
  111. This enables a debugging version of SCM_NEWCELL(), and also registers
  112. an extra primitive, the setter `gc-set-debug-check-freelist!'.
  113. Configure with the --enable-debug-freelist option to enable
  114. the gc-set-debug-check-freelist! primitive, and then use:
  115. (gc-set-debug-check-freelist! #t) # turn on checking of the freelist
  116. (gc-set-debug-check-freelist! #f) # turn off checking
  117. Checking of the freelist forces a traversal of the freelist and
  118. a garbage collection before each allocation of a cell. This can
  119. slow down the interpreter dramatically, so the setter should be used to
  120. turn on this extra processing only when necessary.
  121. ** New configure option --enable-debug-malloc
  122. Include code for debugging of calls to scm_must_malloc/realloc/free.
  123. Checks that
  124. 1. objects freed by scm_must_free has been mallocated by scm_must_malloc
  125. 2. objects reallocated by scm_must_realloc has been allocated by
  126. scm_must_malloc
  127. 3. reallocated objects are reallocated with the same what string
  128. But, most importantly, it records the number of allocated objects of
  129. each kind. This is useful when searching for memory leaks.
  130. A Guile compiled with this option provides the primitive
  131. `malloc-stats' which returns an alist with pairs of kind and the
  132. number of objects of that kind.
  133. ** All includes are now referenced relative to the root directory
  134. Since some users have had problems with mixups between Guile and
  135. system headers, we have decided to always refer to Guile headers via
  136. their parent directories. This essentially creates a "private name
  137. space" for Guile headers. This means that the compiler only is given
  138. -I options for the root build and root source directory.
  139. ** Header files kw.h and genio.h have been removed.
  140. ** The module (ice-9 getopt-gnu-style) has been removed.
  141. ** New module (ice-9 documentation)
  142. Implements the interface to documentation strings associated with
  143. objects.
  144. * Changes to the stand-alone interpreter
  145. ** New command line option --debug
  146. Start Guile with debugging evaluator and backtraces enabled.
  147. This is useful when debugging your .guile init file or scripts.
  148. ** New help facility
  149. Usage: (help NAME) gives documentation about objects named NAME (a symbol)
  150. (help REGEXP) ditto for objects with names matching REGEXP (a string)
  151. (help ,EXPR) gives documentation for object returned by EXPR
  152. (help) gives this text
  153. `help' searches among bindings exported from loaded modules, while
  154. `apropos' searches among bindings visible from the "current" module.
  155. Examples: (help help)
  156. (help cons)
  157. (help "output-string")
  158. ** `help' and `apropos' now prints full module names
  159. ** Dynamic linking now uses libltdl from the libtool package.
  160. The old system dependent code for doing dynamic linking has been
  161. replaced with calls to the libltdl functions which do all the hairy
  162. details for us.
  163. The major improvement is that you can now directly pass libtool
  164. library names like "libfoo.la" to `dynamic-link' and `dynamic-link'
  165. will be able to do the best shared library job you can get, via
  166. libltdl.
  167. The way dynamic libraries are found has changed and is not really
  168. portable across platforms, probably. It is therefore recommended to
  169. use absolute filenames when possible.
  170. If you pass a filename without an extension to `dynamic-link', it will
  171. try a few appropriate ones. Thus, the most platform ignorant way is
  172. to specify a name like "libfoo", without any directories and
  173. extensions.
  174. ** Guile COOP threads are now compatible with LinuxThreads
  175. Previously, COOP threading wasn't possible in applications linked with
  176. Linux POSIX threads due to their use of the stack pointer to find the
  177. thread context. This has now been fixed with a workaround which uses
  178. the pthreads to allocate the stack.
  179. ** New primitives: `pkgdata-dir', `site-dir', `library-dir'
  180. ** Positions of erring expression in scripts
  181. With version 1.3.4, the location of the erring expression in Guile
  182. scipts is no longer automatically reported. (This should have been
  183. documented before the 1.3.4 release.)
  184. You can get this information by enabling recording of positions of
  185. source expressions and running the debugging evaluator. Put this at
  186. the top of your script (or in your "site" file):
  187. (read-enable 'positions)
  188. (debug-enable 'debug)
  189. ** Backtraces in scripts
  190. It is now possible to get backtraces in scripts.
  191. Put
  192. (debug-enable 'debug 'backtrace)
  193. at the top of the script.
  194. (The first options enables the debugging evaluator.
  195. The second enables backtraces.)
  196. ** Part of module system symbol lookup now implemented in C
  197. The eval closure of most modules is now implemented in C. Since this
  198. was one of the bottlenecks for loading speed, Guile now loads code
  199. substantially faster than before.
  200. ** Attempting to get the value of an unbound variable now produces
  201. an exception with a key of 'unbound-variable instead of 'misc-error.
  202. ** The initial default output port is now unbuffered if it's using a
  203. tty device. Previously in this situation it was line-buffered.
  204. ** gc-thunk is deprecated
  205. gc-thunk will be removed in next release of Guile. It has been
  206. replaced by after-gc-hook.
  207. ** New hook: after-gc-hook
  208. after-gc-hook takes over the role of gc-thunk. This hook is run at
  209. the first SCM_TICK after a GC. (Thus, the code is run at the same
  210. point during evaluation as signal handlers.)
  211. Note that this hook should be used only for diagnostic and debugging
  212. purposes. It is not certain that it will continue to be well-defined
  213. when this hook is run in the future.
  214. C programmers: Note the new C level hooks scm_before_gc_c_hook,
  215. scm_before_sweep_c_hook, scm_after_gc_c_hook.
  216. ** Improvements to garbage collector
  217. Guile 1.4 has a new policy for triggering heap allocation and
  218. determining the sizes of heap segments. It fixes a number of problems
  219. in the old GC.
  220. 1. The new policy can handle two separate pools of cells
  221. (2-word/4-word) better. (The old policy would run wild, allocating
  222. more and more memory for certain programs.)
  223. 2. The old code would sometimes allocate far too much heap so that the
  224. Guile process became gigantic. The new code avoids this.
  225. 3. The old code would sometimes allocate too little so that few cells
  226. were freed at GC so that, in turn, too much time was spent in GC.
  227. 4. The old code would often trigger heap allocation several times in a
  228. row. (The new scheme predicts how large the segments needs to be
  229. in order not to need further allocation.)
  230. All in all, the new GC policy will make larger applications more
  231. efficient.
  232. The new GC scheme also is prepared for POSIX threading. Threads can
  233. allocate private pools of cells ("clusters") with just a single
  234. function call. Allocation of single cells from such a cluster can
  235. then proceed without any need of inter-thread synchronization.
  236. ** New environment variables controlling GC parameters
  237. GUILE_MAX_SEGMENT_SIZE Maximal segment size
  238. (default = 2097000)
  239. Allocation of 2-word cell heaps:
  240. GUILE_INIT_SEGMENT_SIZE_1 Size of initial heap segment in bytes
  241. (default = 360000)
  242. GUILE_MIN_YIELD_1 Minimum number of freed cells at each
  243. GC in percent of total heap size
  244. (default = 40)
  245. Allocation of 4-word cell heaps
  246. (used for real numbers and misc other objects):
  247. GUILE_INIT_SEGMENT_SIZE_2, GUILE_MIN_YIELD_2
  248. (See entry "Way for application to customize GC parameters" under
  249. section "Changes to the scm_ interface" below.)
  250. ** Guile now implements reals using 4-word cells
  251. This speeds up computation with reals. (They were earlier allocated
  252. with `malloc'.) There is still some room for optimizations, however.
  253. ** Some further steps toward POSIX thread support have been taken
  254. *** Guile's critical sections (SCM_DEFER/ALLOW_INTS)
  255. don't have much effect any longer, and many of them will be removed in
  256. next release.
  257. *** Signals
  258. are only handled at the top of the evaluator loop, immediately after
  259. I/O, and in scm_equalp.
  260. *** The GC can allocate thread private pools of pairs.
  261. * Changes to Scheme functions and syntax
  262. ** close-input-port and close-output-port are now R5RS
  263. These procedures have been turned into primitives and have R5RS behaviour.
  264. ** New procedure: simple-format PORT MESSAGE ARG1 ...
  265. (ice-9 boot) makes `format' an alias for `simple-format' until possibly
  266. extended by the more sophisticated version in (ice-9 format)
  267. (simple-format port message . args)
  268. Write MESSAGE to DESTINATION, defaulting to `current-output-port'.
  269. MESSAGE can contain ~A (was %s) and ~S (was %S) escapes. When printed,
  270. the escapes are replaced with corresponding members of ARGS:
  271. ~A formats using `display' and ~S formats using `write'.
  272. If DESTINATION is #t, then use the `current-output-port',
  273. if DESTINATION is #f, then return a string containing the formatted text.
  274. Does not add a trailing newline."
  275. ** string-ref: the second argument is no longer optional.
  276. ** string, list->string: no longer accept strings in their arguments,
  277. only characters, for compatibility with R5RS.
  278. ** New procedure: port-closed? PORT
  279. Returns #t if PORT is closed or #f if it is open.
  280. ** Deprecated: list*
  281. The list* functionality is now provided by cons* (SRFI-1 compliant)
  282. ** New procedure: cons* ARG1 ARG2 ... ARGn
  283. Like `list', but the last arg provides the tail of the constructed list,
  284. returning (cons ARG1 (cons ARG2 (cons ... ARGn))).
  285. Requires at least one argument. If given one argument, that argument
  286. is returned as result.
  287. This function is called `list*' in some other Schemes and in Common LISP.
  288. ** Removed deprecated: serial-map, serial-array-copy!, serial-array-map!
  289. ** New procedure: object-documentation OBJECT
  290. Returns the documentation string associated with OBJECT. The
  291. procedure uses a caching mechanism so that subsequent lookups are
  292. faster.
  293. Exported by (ice-9 documentation).
  294. ** module-name now returns full names of modules
  295. Previously, only the last part of the name was returned (`session' for
  296. `(ice-9 session)'). Ex: `(ice-9 session)'.
  297. * Changes to the gh_ interface
  298. ** Deprecated: gh_int2scmb
  299. Use gh_bool2scm instead.
  300. * Changes to the scm_ interface
  301. ** Guile primitives now carry docstrings!
  302. Thanks to Greg Badros!
  303. ** Guile primitives are defined in a new way: SCM_DEFINE/SCM_DEFINE1/SCM_PROC
  304. Now Guile primitives are defined using the SCM_DEFINE/SCM_DEFINE1/SCM_PROC
  305. macros and must contain a docstring that is extracted into foo.doc using a new
  306. guile-doc-snarf script (that uses guile-doc-snarf.awk).
  307. However, a major overhaul of these macros is scheduled for the next release of
  308. guile.
  309. ** Guile primitives use a new technique for validation of arguments
  310. SCM_VALIDATE_* macros are defined to ease the redundancy and improve
  311. the readability of argument checking.
  312. ** All (nearly?) K&R prototypes for functions replaced with ANSI C equivalents.
  313. ** New macros: SCM_PACK, SCM_UNPACK
  314. Compose/decompose an SCM value.
  315. The SCM type is now treated as an abstract data type and may be defined as a
  316. long, a void* or as a struct, depending on the architecture and compile time
  317. options. This makes it easier to find several types of bugs, for example when
  318. SCM values are treated as integers without conversion. Values of the SCM type
  319. should be treated as "atomic" values. These macros are used when
  320. composing/decomposing an SCM value, either because you want to access
  321. individual bits, or because you want to treat it as an integer value.
  322. E.g., in order to set bit 7 in an SCM value x, use the expression
  323. SCM_PACK (SCM_UNPACK (x) | 0x80)
  324. ** The name property of hooks is deprecated.
  325. Thus, the use of SCM_HOOK_NAME and scm_make_hook_with_name is deprecated.
  326. You can emulate this feature by using object properties.
  327. ** Deprecated macros: SCM_INPORTP, SCM_OUTPORTP, SCM_CRDY, SCM_ICHRP,
  328. SCM_ICHR, SCM_MAKICHR, SCM_SETJMPBUF, SCM_NSTRINGP, SCM_NRWSTRINGP,
  329. SCM_NVECTORP
  330. These macros will be removed in a future release of Guile.
  331. ** The following types, functions and macros from numbers.h are deprecated:
  332. scm_dblproc, SCM_UNEGFIXABLE, SCM_FLOBUFLEN, SCM_INEXP, SCM_CPLXP, SCM_REAL,
  333. SCM_IMAG, SCM_REALPART, scm_makdbl, SCM_SINGP, SCM_NUM2DBL, SCM_NO_BIGDIG
  334. Further, it is recommended not to rely on implementation details for guile's
  335. current implementation of bignums. It is planned to replace this
  336. implementation with gmp in the future.
  337. ** Port internals: the rw_random variable in the scm_port structure
  338. must be set to non-zero in any random access port. In recent Guile
  339. releases it was only set for bidirectional random-access ports.
  340. ** Port internals: the seek ptob procedure is now responsible for
  341. resetting the buffers if required. The change was made so that in the
  342. special case of reading the current position (i.e., seek p 0 SEEK_CUR)
  343. the fport and strport ptobs can avoid resetting the buffers,
  344. in particular to avoid discarding unread chars. An existing port
  345. type can be fixed by adding something like the following to the
  346. beginning of the ptob seek procedure:
  347. if (pt->rw_active == SCM_PORT_READ)
  348. scm_end_input (object);
  349. else if (pt->rw_active == SCM_PORT_WRITE)
  350. ptob->flush (object);
  351. although to actually avoid resetting the buffers and discard unread
  352. chars requires further hacking that depends on the characteristics
  353. of the ptob.
  354. ** Deprecated functions: scm_fseek, scm_tag
  355. These functions are no longer used and will be removed in a future version.
  356. ** The scm_sysmissing procedure is no longer used in libguile.
  357. Unless it turns out to be unexpectedly useful to somebody, it will be
  358. removed in a future version.
  359. ** The format of error message strings has changed
  360. The two C procedures: scm_display_error and scm_error, as well as the
  361. primitive `scm-error', now use scm_simple_format to do their work.
  362. This means that the message strings of all code must be updated to use
  363. ~A where %s was used before, and ~S where %S was used before.
  364. During the period when there still are a lot of old Guiles out there,
  365. you might want to support both old and new versions of Guile.
  366. There are basically two methods to achieve this. Both methods use
  367. autoconf. Put
  368. AC_CHECK_FUNCS(scm_simple_format)
  369. in your configure.in.
  370. Method 1: Use the string concatenation features of ANSI C's
  371. preprocessor.
  372. In C:
  373. #ifdef HAVE_SCM_SIMPLE_FORMAT
  374. #define FMT_S "~S"
  375. #else
  376. #define FMT_S "%S"
  377. #endif
  378. Then represent each of your error messages using a preprocessor macro:
  379. #define E_SPIDER_ERROR "There's a spider in your " ## FMT_S ## "!!!"
  380. In Scheme:
  381. (define fmt-s (if (defined? 'simple-format) "~S" "%S"))
  382. (define make-message string-append)
  383. (define e-spider-error (make-message "There's a spider in your " fmt-s "!!!"))
  384. Method 2: Use the oldfmt function found in doc/oldfmt.c.
  385. In C:
  386. scm_misc_error ("picnic", scm_c_oldfmt0 ("There's a spider in your ~S!!!"),
  387. ...);
  388. In Scheme:
  389. (scm-error 'misc-error "picnic" (oldfmt "There's a spider in your ~S!!!")
  390. ...)
  391. ** Deprecated: coop_mutex_init, coop_condition_variable_init
  392. Don't use the functions coop_mutex_init and
  393. coop_condition_variable_init. They will change.
  394. Use scm_mutex_init and scm_cond_init instead.
  395. ** New function: int scm_cond_timedwait (scm_cond_t *COND, scm_mutex_t *MUTEX, const struct timespec *ABSTIME)
  396. `scm_cond_timedwait' atomically unlocks MUTEX and waits on
  397. COND, as `scm_cond_wait' does, but it also bounds the duration
  398. of the wait. If COND has not been signaled before time ABSTIME,
  399. the mutex MUTEX is re-acquired and `scm_cond_timedwait'
  400. returns the error code `ETIMEDOUT'.
  401. The ABSTIME parameter specifies an absolute time, with the same
  402. origin as `time' and `gettimeofday': an ABSTIME of 0 corresponds
  403. to 00:00:00 GMT, January 1, 1970.
  404. ** New function: scm_cond_broadcast (scm_cond_t *COND)
  405. `scm_cond_broadcast' restarts all the threads that are waiting
  406. on the condition variable COND. Nothing happens if no threads are
  407. waiting on COND.
  408. ** New function: scm_key_create (scm_key_t *KEY, void (*destr_function) (void *))
  409. `scm_key_create' allocates a new TSD key. The key is stored in
  410. the location pointed to by KEY. There is no limit on the number
  411. of keys allocated at a given time. The value initially associated
  412. with the returned key is `NULL' in all currently executing threads.
  413. The DESTR_FUNCTION argument, if not `NULL', specifies a destructor
  414. function associated with the key. When a thread terminates,
  415. DESTR_FUNCTION is called on the value associated with the key in
  416. that thread. The DESTR_FUNCTION is not called if a key is deleted
  417. with `scm_key_delete' or a value is changed with
  418. `scm_setspecific'. The order in which destructor functions are
  419. called at thread termination time is unspecified.
  420. Destructors are not yet implemented.
  421. ** New function: scm_setspecific (scm_key_t KEY, const void *POINTER)
  422. `scm_setspecific' changes the value associated with KEY in the
  423. calling thread, storing the given POINTER instead.
  424. ** New function: scm_getspecific (scm_key_t KEY)
  425. `scm_getspecific' returns the value currently associated with
  426. KEY in the calling thread.
  427. ** New function: scm_key_delete (scm_key_t KEY)
  428. `scm_key_delete' deallocates a TSD key. It does not check
  429. whether non-`NULL' values are associated with that key in the
  430. currently executing threads, nor call the destructor function
  431. associated with the key.
  432. ** New function: scm_c_hook_init (scm_c_hook_t *HOOK, void *HOOK_DATA, scm_c_hook_type_t TYPE)
  433. Initialize a C level hook HOOK with associated HOOK_DATA and type
  434. TYPE. (See scm_c_hook_run ().)
  435. ** New function: scm_c_hook_add (scm_c_hook_t *HOOK, scm_c_hook_function_t FUNC, void *FUNC_DATA, int APPENDP)
  436. Add hook function FUNC with associated FUNC_DATA to HOOK. If APPENDP
  437. is true, add it last, otherwise first. The same FUNC can be added
  438. multiple times if FUNC_DATA differ and vice versa.
  439. ** New function: scm_c_hook_remove (scm_c_hook_t *HOOK, scm_c_hook_function_t FUNC, void *FUNC_DATA)
  440. Remove hook function FUNC with associated FUNC_DATA from HOOK. A
  441. function is only removed if both FUNC and FUNC_DATA matches.
  442. ** New function: void *scm_c_hook_run (scm_c_hook_t *HOOK, void *DATA)
  443. Run hook HOOK passing DATA to the hook functions.
  444. If TYPE is SCM_C_HOOK_NORMAL, all hook functions are run. The value
  445. returned is undefined.
  446. If TYPE is SCM_C_HOOK_OR, hook functions are run until a function
  447. returns a non-NULL value. This value is returned as the result of
  448. scm_c_hook_run. If all functions return NULL, NULL is returned.
  449. If TYPE is SCM_C_HOOK_AND, hook functions are run until a function
  450. returns a NULL value, and NULL is returned. If all functions returns
  451. a non-NULL value, the last value is returned.
  452. ** New C level GC hooks
  453. Five new C level hooks has been added to the garbage collector.
  454. scm_before_gc_c_hook
  455. scm_after_gc_c_hook
  456. are run before locking and after unlocking the heap. The system is
  457. thus in a mode where evaluation can take place. (Except that
  458. scm_before_gc_c_hook must not allocate new cells.)
  459. scm_before_mark_c_hook
  460. scm_before_sweep_c_hook
  461. scm_after_sweep_c_hook
  462. are run when the heap is locked. These are intended for extension of
  463. the GC in a modular fashion. Examples are the weaks and guardians
  464. modules.
  465. ** Way for application to customize GC parameters
  466. The application can set up other default values for the GC heap
  467. allocation parameters
  468. GUILE_INIT_HEAP_SIZE_1, GUILE_MIN_YIELD_1,
  469. GUILE_INIT_HEAP_SIZE_2, GUILE_MIN_YIELD_2,
  470. GUILE_MAX_SEGMENT_SIZE,
  471. by setting
  472. scm_default_init_heap_size_1, scm_default_min_yield_1,
  473. scm_default_init_heap_size_2, scm_default_min_yield_2,
  474. scm_default_max_segment_size
  475. respectively before callong scm_boot_guile.
  476. (See entry "New environment variables ..." in section
  477. "Changes to the stand-alone interpreter" above.)
  478. ** scm_protect_object/scm_unprotect_object now nest
  479. This means that you can call scm_protect_object multiple times on an
  480. object and count on the object being protected until
  481. scm_unprotect_object has been call the same number of times.
  482. The functions also have better time complexity.
  483. Still, it is usually possible to structure the application in a way
  484. that you don't need to use these functions. For example, if you use a
  485. protected standard Guile list to keep track of live objects rather
  486. than some custom data type, objects will die a natural death when they
  487. are no longer needed.
  488. ** Deprecated type tags: scm_tc16_flo, scm_tc_flo, scm_tc_dblr, scm_tc_dblc
  489. Guile does not provide the float representation for inexact real numbers any
  490. more. Now, only doubles are used to represent inexact real numbers. Further,
  491. the tag names scm_tc_dblr and scm_tc_dblc have been changed to scm_tc16_real
  492. and scm_tc16_complex, respectively.
  493. ** Removed deprecated type scm_smobfuns
  494. ** Removed deprecated function scm_newsmob
  495. ** Warning: scm_make_smob_type_mfpe might become deprecated in a future release
  496. There is an ongoing discussion among the developers whether to
  497. deprecate `scm_make_smob_type_mfpe' or not. Please use the current
  498. standard interface (scm_make_smob_type, scm_set_smob_XXX) in new code
  499. until this issue has been settled.
  500. ** Removed deprecated type tag scm_tc16_kw
  501. ** Added type tag scm_tc16_keyword
  502. (This was introduced already in release 1.3.4 but was not documented
  503. until now.)
  504. ** gdb_print now prints "*** Guile not initialized ***" until Guile initialized
  505. * Changes to system call interfaces:
  506. ** The "select" procedure now tests port buffers for the ability to
  507. provide input or accept output. Previously only the underlying file
  508. descriptors were checked.
  509. ** New variable PIPE_BUF: the maximum number of bytes that can be
  510. atomically written to a pipe.
  511. ** If a facility is not available on the system when Guile is
  512. compiled, the corresponding primitive procedure will not be defined.
  513. Previously it would have been defined but would throw a system-error
  514. exception if called. Exception handlers which catch this case may
  515. need minor modification: an error will be thrown with key
  516. 'unbound-variable instead of 'system-error. Alternatively it's
  517. now possible to use `defined?' to check whether the facility is
  518. available.
  519. ** Procedures which depend on the timezone should now give the correct
  520. result on systems which cache the TZ environment variable, even if TZ
  521. is changed without calling tzset.
  522. * Changes to the networking interfaces:
  523. ** New functions: htons, ntohs, htonl, ntohl: for converting short and
  524. long integers between network and host format. For now, it's not
  525. particularly convenient to do this kind of thing, but consider:
  526. (define write-network-long
  527. (lambda (value port)
  528. (let ((v (make-uniform-vector 1 1 0)))
  529. (uniform-vector-set! v 0 (htonl value))
  530. (uniform-vector-write v port))))
  531. (define read-network-long
  532. (lambda (port)
  533. (let ((v (make-uniform-vector 1 1 0)))
  534. (uniform-vector-read! v port)
  535. (ntohl (uniform-vector-ref v 0)))))
  536. ** If inet-aton fails, it now throws an error with key 'misc-error
  537. instead of 'system-error, since errno is not relevant.
  538. ** Certain gethostbyname/gethostbyaddr failures now throw errors with
  539. specific keys instead of 'system-error. The latter is inappropriate
  540. since errno will not have been set. The keys are:
  541. 'host-not-found, 'try-again, 'no-recovery and 'no-data.
  542. ** sethostent, setnetent, setprotoent, setservent: now take an
  543. optional argument STAYOPEN, which specifies whether the database
  544. remains open after a database entry is accessed randomly (e.g., using
  545. gethostbyname for the hosts database.) The default is #f. Previously
  546. #t was always used.
  547. Changes since Guile 1.3.2:
  548. * Changes to the stand-alone interpreter
  549. ** Debugger
  550. An initial version of the Guile debugger written by Chris Hanson has
  551. been added. The debugger is still under development but is included
  552. in the distribution anyway since it is already quite useful.
  553. Type
  554. (debug)
  555. after an error to enter the debugger. Type `help' inside the debugger
  556. for a description of available commands.
  557. If you prefer to have stack frames numbered and printed in
  558. anti-chronological order and prefer up in the stack to be down on the
  559. screen as is the case in gdb, you can put
  560. (debug-enable 'backwards)
  561. in your .guile startup file. (However, this means that Guile can't
  562. use indentation to indicate stack level.)
  563. The debugger is autoloaded into Guile at the first use.
  564. ** Further enhancements to backtraces
  565. There is a new debug option `width' which controls the maximum width
  566. on the screen of printed stack frames. Fancy printing parameters
  567. ("level" and "length" as in Common LISP) are adaptively adjusted for
  568. each stack frame to give maximum information while still fitting
  569. within the bounds. If the stack frame can't be made to fit by
  570. adjusting parameters, it is simply cut off at the end. This is marked
  571. with a `$'.
  572. ** Some modules are now only loaded when the repl is started
  573. The modules (ice-9 debug), (ice-9 session), (ice-9 threads) and (ice-9
  574. regex) are now loaded into (guile-user) only if the repl has been
  575. started. The effect is that the startup time for scripts has been
  576. reduced to 30% of what it was previously.
  577. Correctly written scripts load the modules they require at the top of
  578. the file and should not be affected by this change.
  579. ** Hooks are now represented as smobs
  580. * Changes to Scheme functions and syntax
  581. ** Readline support has changed again.
  582. The old (readline-activator) module is gone. Use (ice-9 readline)
  583. instead, which now contains all readline functionality. So the code
  584. to activate readline is now
  585. (use-modules (ice-9 readline))
  586. (activate-readline)
  587. This should work at any time, including from the guile prompt.
  588. To avoid confusion about the terms of Guile's license, please only
  589. enable readline for your personal use; please don't make it the
  590. default for others. Here is why we make this rather odd-sounding
  591. request:
  592. Guile is normally licensed under a weakened form of the GNU General
  593. Public License, which allows you to link code with Guile without
  594. placing that code under the GPL. This exception is important to some
  595. people.
  596. However, since readline is distributed under the GNU General Public
  597. License, when you link Guile with readline, either statically or
  598. dynamically, you effectively change Guile's license to the strict GPL.
  599. Whenever you link any strictly GPL'd code into Guile, uses of Guile
  600. which are normally permitted become forbidden. This is a rather
  601. non-obvious consequence of the licensing terms.
  602. So, to make sure things remain clear, please let people choose for
  603. themselves whether to link GPL'd libraries like readline with Guile.
  604. ** regexp-substitute/global has changed slightly, but incompatibly.
  605. If you include a function in the item list, the string of the match
  606. object it receives is the same string passed to
  607. regexp-substitute/global, not some suffix of that string.
  608. Correspondingly, the match's positions are relative to the entire
  609. string, not the suffix.
  610. If the regexp can match the empty string, the way matches are chosen
  611. from the string has changed. regexp-substitute/global recognizes the
  612. same set of matches that list-matches does; see below.
  613. ** New function: list-matches REGEXP STRING [FLAGS]
  614. Return a list of match objects, one for every non-overlapping, maximal
  615. match of REGEXP in STRING. The matches appear in left-to-right order.
  616. list-matches only reports matches of the empty string if there are no
  617. other matches which begin on, end at, or include the empty match's
  618. position.
  619. If present, FLAGS is passed as the FLAGS argument to regexp-exec.
  620. ** New function: fold-matches REGEXP STRING INIT PROC [FLAGS]
  621. For each match of REGEXP in STRING, apply PROC to the match object,
  622. and the last value PROC returned, or INIT for the first call. Return
  623. the last value returned by PROC. We apply PROC to the matches as they
  624. appear from left to right.
  625. This function recognizes matches according to the same criteria as
  626. list-matches.
  627. Thus, you could define list-matches like this:
  628. (define (list-matches regexp string . flags)
  629. (reverse! (apply fold-matches regexp string '() cons flags)))
  630. If present, FLAGS is passed as the FLAGS argument to regexp-exec.
  631. ** Hooks
  632. *** New function: hook? OBJ
  633. Return #t if OBJ is a hook, otherwise #f.
  634. *** New function: make-hook-with-name NAME [ARITY]
  635. Return a hook with name NAME and arity ARITY. The default value for
  636. ARITY is 0. The only effect of NAME is that it will appear when the
  637. hook object is printed to ease debugging.
  638. *** New function: hook-empty? HOOK
  639. Return #t if HOOK doesn't contain any procedures, otherwise #f.
  640. *** New function: hook->list HOOK
  641. Return a list of the procedures that are called when run-hook is
  642. applied to HOOK.
  643. ** `map' signals an error if its argument lists are not all the same length.
  644. This is the behavior required by R5RS, so this change is really a bug
  645. fix. But it seems to affect a lot of people's code, so we're
  646. mentioning it here anyway.
  647. ** Print-state handling has been made more transparent
  648. Under certain circumstances, ports are represented as a port with an
  649. associated print state. Earlier, this pair was represented as a pair
  650. (see "Some magic has been added to the printer" below). It is now
  651. indistinguishable (almost; see `get-print-state') from a port on the
  652. user level.
  653. *** New function: port-with-print-state OUTPUT-PORT PRINT-STATE
  654. Return a new port with the associated print state PRINT-STATE.
  655. *** New function: get-print-state OUTPUT-PORT
  656. Return the print state associated with this port if it exists,
  657. otherwise return #f.
  658. *** New function: directory-stream? OBJECT
  659. Returns true iff OBJECT is a directory stream --- the sort of object
  660. returned by `opendir'.
  661. ** New function: using-readline?
  662. Return #t if readline is in use in the current repl.
  663. ** structs will be removed in 1.4
  664. Structs will be replaced in Guile 1.4. We will merge GOOPS into Guile
  665. and use GOOPS objects as the fundamental record type.
  666. * Changes to the scm_ interface
  667. ** structs will be removed in 1.4
  668. The entire current struct interface (struct.c, struct.h) will be
  669. replaced in Guile 1.4. We will merge GOOPS into libguile and use
  670. GOOPS objects as the fundamental record type.
  671. ** The internal representation of subr's has changed
  672. Instead of giving a hint to the subr name, the CAR field of the subr
  673. now contains an index to a subr entry in scm_subr_table.
  674. *** New variable: scm_subr_table
  675. An array of subr entries. A subr entry contains the name, properties
  676. and documentation associated with the subr. The properties and
  677. documentation slots are not yet used.
  678. ** A new scheme for "forwarding" calls to a builtin to a generic function
  679. It is now possible to extend the functionality of some Guile
  680. primitives by letting them defer a call to a GOOPS generic function on
  681. argument mismatch. This means that there is no loss of efficiency in
  682. normal evaluation.
  683. Example:
  684. (use-modules (oop goops)) ; Must be GOOPS version 0.2.
  685. (define-method + ((x <string>) (y <string>))
  686. (string-append x y))
  687. + will still be as efficient as usual in numerical calculations, but
  688. can also be used for concatenating strings.
  689. Who will be the first one to extend Guile's numerical tower to
  690. rationals? :) [OK, there a few other things to fix before this can
  691. be made in a clean way.]
  692. *** New snarf macros for defining primitives: SCM_GPROC, SCM_GPROC1
  693. New macro: SCM_GPROC (CNAME, SNAME, REQ, OPT, VAR, CFUNC, GENERIC)
  694. New macro: SCM_GPROC1 (CNAME, SNAME, TYPE, CFUNC, GENERIC)
  695. These do the same job as SCM_PROC and SCM_PROC1, but they also define
  696. a variable GENERIC which can be used by the dispatch macros below.
  697. [This is experimental code which may change soon.]
  698. *** New macros for forwarding control to a generic on arg type error
  699. New macro: SCM_WTA_DISPATCH_1 (GENERIC, ARG1, POS, SUBR)
  700. New macro: SCM_WTA_DISPATCH_2 (GENERIC, ARG1, ARG2, POS, SUBR)
  701. These correspond to the scm_wta function call, and have the same
  702. behaviour until the user has called the GOOPS primitive
  703. `enable-primitive-generic!'. After that, these macros will apply the
  704. generic function GENERIC to the argument(s) instead of calling
  705. scm_wta.
  706. [This is experimental code which may change soon.]
  707. *** New macros for argument testing with generic dispatch
  708. New macro: SCM_GASSERT1 (COND, GENERIC, ARG1, POS, SUBR)
  709. New macro: SCM_GASSERT2 (COND, GENERIC, ARG1, ARG2, POS, SUBR)
  710. These correspond to the SCM_ASSERT macro, but will defer control to
  711. GENERIC on error after `enable-primitive-generic!' has been called.
  712. [This is experimental code which may change soon.]
  713. ** New function: SCM scm_eval_body (SCM body, SCM env)
  714. Evaluates the body of a special form.
  715. ** The internal representation of struct's has changed
  716. Previously, four slots were allocated for the procedure(s) of entities
  717. and operators. The motivation for this representation had to do with
  718. the structure of the evaluator, the wish to support tail-recursive
  719. generic functions, and efficiency. Since the generic function
  720. dispatch mechanism has changed, there is no longer a need for such an
  721. expensive representation, and the representation has been simplified.
  722. This should not make any difference for most users.
  723. ** GOOPS support has been cleaned up.
  724. Some code has been moved from eval.c to objects.c and code in both of
  725. these compilation units has been cleaned up and better structured.
  726. *** New functions for applying generic functions
  727. New function: SCM scm_apply_generic (GENERIC, ARGS)
  728. New function: SCM scm_call_generic_0 (GENERIC)
  729. New function: SCM scm_call_generic_1 (GENERIC, ARG1)
  730. New function: SCM scm_call_generic_2 (GENERIC, ARG1, ARG2)
  731. New function: SCM scm_call_generic_3 (GENERIC, ARG1, ARG2, ARG3)
  732. ** Deprecated function: scm_make_named_hook
  733. It is now replaced by:
  734. ** New function: SCM scm_create_hook (const char *name, int arity)
  735. Creates a hook in the same way as make-hook above but also
  736. binds a variable named NAME to it.
  737. This is the typical way of creating a hook from C code.
  738. Currently, the variable is created in the "current" module.
  739. This might change when we get the new module system.
  740. [The behaviour is identical to scm_make_named_hook.]
  741. Changes since Guile 1.3:
  742. * Changes to mailing lists
  743. ** Some of the Guile mailing lists have moved to sourceware.cygnus.com.
  744. See the README file to find current addresses for all the Guile
  745. mailing lists.
  746. * Changes to the distribution
  747. ** Readline support is no longer included with Guile by default.
  748. Based on the different license terms of Guile and Readline, we
  749. concluded that Guile should not *by default* cause the linking of
  750. Readline into an application program. Readline support is now offered
  751. as a separate module, which is linked into an application only when
  752. you explicitly specify it.
  753. Although Guile is GNU software, its distribution terms add a special
  754. exception to the usual GNU General Public License (GPL). Guile's
  755. license includes a clause that allows you to link Guile with non-free
  756. programs. We add this exception so as not to put Guile at a
  757. disadvantage vis-a-vis other extensibility packages that support other
  758. languages.
  759. In contrast, the GNU Readline library is distributed under the GNU
  760. General Public License pure and simple. This means that you may not
  761. link Readline, even dynamically, into an application unless it is
  762. distributed under a free software license that is compatible the GPL.
  763. Because of this difference in distribution terms, an application that
  764. can use Guile may not be able to use Readline. Now users will be
  765. explicitly offered two independent decisions about the use of these
  766. two packages.
  767. You can activate the readline support by issuing
  768. (use-modules (readline-activator))
  769. (activate-readline)
  770. from your ".guile" file, for example.
  771. * Changes to the stand-alone interpreter
  772. ** All builtins now print as primitives.
  773. Previously builtin procedures not belonging to the fundamental subr
  774. types printed as #<compiled closure #<primitive-procedure gsubr-apply>>.
  775. Now, they print as #<primitive-procedure NAME>.
  776. ** Backtraces slightly more intelligible.
  777. gsubr-apply and macro transformer application frames no longer appear
  778. in backtraces.
  779. * Changes to Scheme functions and syntax
  780. ** Guile now correctly handles internal defines by rewriting them into
  781. their equivalent letrec. Previously, internal defines would
  782. incrementally add to the innermost environment, without checking
  783. whether the restrictions specified in RnRS were met. This lead to the
  784. correct behaviour when these restriction actually were met, but didn't
  785. catch all illegal uses. Such an illegal use could lead to crashes of
  786. the Guile interpreter or or other unwanted results. An example of
  787. incorrect internal defines that made Guile behave erratically:
  788. (let ()
  789. (define a 1)
  790. (define (b) a)
  791. (define c (1+ (b)))
  792. (define d 3)
  793. (b))
  794. => 2
  795. The problem with this example is that the definition of `c' uses the
  796. value of `b' directly. This confuses the meoization machine of Guile
  797. so that the second call of `b' (this time in a larger environment that
  798. also contains bindings for `c' and `d') refers to the binding of `c'
  799. instead of `a'. You could also make Guile crash with a variation on
  800. this theme:
  801. (define (foo flag)
  802. (define a 1)
  803. (define (b flag) (if flag a 1))
  804. (define c (1+ (b flag)))
  805. (define d 3)
  806. (b #t))
  807. (foo #f)
  808. (foo #t)
  809. From now on, Guile will issue an `Unbound variable: b' error message
  810. for both examples.
  811. ** Hooks
  812. A hook contains a list of functions which should be called on
  813. particular occasions in an existing program. Hooks are used for
  814. customization.
  815. A window manager might have a hook before-window-map-hook. The window
  816. manager uses the function run-hooks to call all functions stored in
  817. before-window-map-hook each time a window is mapped. The user can
  818. store functions in the hook using add-hook!.
  819. In Guile, hooks are first class objects.
  820. *** New function: make-hook [N_ARGS]
  821. Return a hook for hook functions which can take N_ARGS arguments.
  822. The default value for N_ARGS is 0.
  823. (See also scm_make_named_hook below.)
  824. *** New function: add-hook! HOOK PROC [APPEND_P]
  825. Put PROC at the beginning of the list of functions stored in HOOK.
  826. If APPEND_P is supplied, and non-false, put PROC at the end instead.
  827. PROC must be able to take the number of arguments specified when the
  828. hook was created.
  829. If PROC already exists in HOOK, then remove it first.
  830. *** New function: remove-hook! HOOK PROC
  831. Remove PROC from the list of functions in HOOK.
  832. *** New function: reset-hook! HOOK
  833. Clear the list of hook functions stored in HOOK.
  834. *** New function: run-hook HOOK ARG1 ...
  835. Run all hook functions stored in HOOK with arguments ARG1 ... .
  836. The number of arguments supplied must correspond to the number given
  837. when the hook was created.
  838. ** The function `dynamic-link' now takes optional keyword arguments.
  839. The only keyword argument that is currently defined is `:global
  840. BOOL'. With it, you can control whether the shared library will be
  841. linked in global mode or not. In global mode, the symbols from the
  842. linked library can be used to resolve references from other
  843. dynamically linked libraries. In non-global mode, the linked
  844. library is essentially invisible and can only be accessed via
  845. `dynamic-func', etc. The default is now to link in global mode.
  846. Previously, the default has been non-global mode.
  847. The `#:global' keyword is only effective on platforms that support
  848. the dlopen family of functions.
  849. ** New function `provided?'
  850. - Function: provided? FEATURE
  851. Return true iff FEATURE is supported by this installation of
  852. Guile. FEATURE must be a symbol naming a feature; the global
  853. variable `*features*' is a list of available features.
  854. ** Changes to the module (ice-9 expect):
  855. *** The expect-strings macro now matches `$' in a regular expression
  856. only at a line-break or end-of-file by default. Previously it would
  857. match the end of the string accumulated so far. The old behaviour
  858. can be obtained by setting the variable `expect-strings-exec-flags'
  859. to 0.
  860. *** The expect-strings macro now uses a variable `expect-strings-exec-flags'
  861. for the regexp-exec flags. If `regexp/noteol' is included, then `$'
  862. in a regular expression will still match before a line-break or
  863. end-of-file. The default is `regexp/noteol'.
  864. *** The expect-strings macro now uses a variable
  865. `expect-strings-compile-flags' for the flags to be supplied to
  866. `make-regexp'. The default is `regexp/newline', which was previously
  867. hard-coded.
  868. *** The expect macro now supplies two arguments to a match procedure:
  869. the current accumulated string and a flag to indicate whether
  870. end-of-file has been reached. Previously only the string was supplied.
  871. If end-of-file is reached, the match procedure will be called an
  872. additional time with the same accumulated string as the previous call
  873. but with the flag set.
  874. ** New module (ice-9 format), implementing the Common Lisp `format' function.
  875. This code, and the documentation for it that appears here, was
  876. borrowed from SLIB, with minor adaptations for Guile.
  877. - Function: format DESTINATION FORMAT-STRING . ARGUMENTS
  878. An almost complete implementation of Common LISP format description
  879. according to the CL reference book `Common LISP' from Guy L.
  880. Steele, Digital Press. Backward compatible to most of the
  881. available Scheme format implementations.
  882. Returns `#t', `#f' or a string; has side effect of printing
  883. according to FORMAT-STRING. If DESTINATION is `#t', the output is
  884. to the current output port and `#t' is returned. If DESTINATION
  885. is `#f', a formatted string is returned as the result of the call.
  886. NEW: If DESTINATION is a string, DESTINATION is regarded as the
  887. format string; FORMAT-STRING is then the first argument and the
  888. output is returned as a string. If DESTINATION is a number, the
  889. output is to the current error port if available by the
  890. implementation. Otherwise DESTINATION must be an output port and
  891. `#t' is returned.
  892. FORMAT-STRING must be a string. In case of a formatting error
  893. format returns `#f' and prints a message on the current output or
  894. error port. Characters are output as if the string were output by
  895. the `display' function with the exception of those prefixed by a
  896. tilde (~). For a detailed description of the FORMAT-STRING syntax
  897. please consult a Common LISP format reference manual. For a test
  898. suite to verify this format implementation load `formatst.scm'.
  899. Please send bug reports to `lutzeb@cs.tu-berlin.de'.
  900. Note: `format' is not reentrant, i.e. only one `format'-call may
  901. be executed at a time.
  902. *** Format Specification (Format version 3.0)
  903. Please consult a Common LISP format reference manual for a detailed
  904. description of the format string syntax. For a demonstration of the
  905. implemented directives see `formatst.scm'.
  906. This implementation supports directive parameters and modifiers (`:'
  907. and `@' characters). Multiple parameters must be separated by a comma
  908. (`,'). Parameters can be numerical parameters (positive or negative),
  909. character parameters (prefixed by a quote character (`''), variable
  910. parameters (`v'), number of rest arguments parameter (`#'), empty and
  911. default parameters. Directive characters are case independent. The
  912. general form of a directive is:
  913. DIRECTIVE ::= ~{DIRECTIVE-PARAMETER,}[:][@]DIRECTIVE-CHARACTER
  914. DIRECTIVE-PARAMETER ::= [ [-|+]{0-9}+ | 'CHARACTER | v | # ]
  915. *** Implemented CL Format Control Directives
  916. Documentation syntax: Uppercase characters represent the
  917. corresponding control directive characters. Lowercase characters
  918. represent control directive parameter descriptions.
  919. `~A'
  920. Any (print as `display' does).
  921. `~@A'
  922. left pad.
  923. `~MINCOL,COLINC,MINPAD,PADCHARA'
  924. full padding.
  925. `~S'
  926. S-expression (print as `write' does).
  927. `~@S'
  928. left pad.
  929. `~MINCOL,COLINC,MINPAD,PADCHARS'
  930. full padding.
  931. `~D'
  932. Decimal.
  933. `~@D'
  934. print number sign always.
  935. `~:D'
  936. print comma separated.
  937. `~MINCOL,PADCHAR,COMMACHARD'
  938. padding.
  939. `~X'
  940. Hexadecimal.
  941. `~@X'
  942. print number sign always.
  943. `~:X'
  944. print comma separated.
  945. `~MINCOL,PADCHAR,COMMACHARX'
  946. padding.
  947. `~O'
  948. Octal.
  949. `~@O'
  950. print number sign always.
  951. `~:O'
  952. print comma separated.
  953. `~MINCOL,PADCHAR,COMMACHARO'
  954. padding.
  955. `~B'
  956. Binary.
  957. `~@B'
  958. print number sign always.
  959. `~:B'
  960. print comma separated.
  961. `~MINCOL,PADCHAR,COMMACHARB'
  962. padding.
  963. `~NR'
  964. Radix N.
  965. `~N,MINCOL,PADCHAR,COMMACHARR'
  966. padding.
  967. `~@R'
  968. print a number as a Roman numeral.
  969. `~:@R'
  970. print a number as an "old fashioned" Roman numeral.
  971. `~:R'
  972. print a number as an ordinal English number.
  973. `~:@R'
  974. print a number as a cardinal English number.
  975. `~P'
  976. Plural.
  977. `~@P'
  978. prints `y' and `ies'.
  979. `~:P'
  980. as `~P but jumps 1 argument backward.'
  981. `~:@P'
  982. as `~@P but jumps 1 argument backward.'
  983. `~C'
  984. Character.
  985. `~@C'
  986. prints a character as the reader can understand it (i.e. `#\'
  987. prefixing).
  988. `~:C'
  989. prints a character as emacs does (eg. `^C' for ASCII 03).
  990. `~F'
  991. Fixed-format floating-point (prints a flonum like MMM.NNN).
  992. `~WIDTH,DIGITS,SCALE,OVERFLOWCHAR,PADCHARF'
  993. `~@F'
  994. If the number is positive a plus sign is printed.
  995. `~E'
  996. Exponential floating-point (prints a flonum like MMM.NNN`E'EE).
  997. `~WIDTH,DIGITS,EXPONENTDIGITS,SCALE,OVERFLOWCHAR,PADCHAR,EXPONENTCHARE'
  998. `~@E'
  999. If the number is positive a plus sign is printed.
  1000. `~G'
  1001. General floating-point (prints a flonum either fixed or
  1002. exponential).
  1003. `~WIDTH,DIGITS,EXPONENTDIGITS,SCALE,OVERFLOWCHAR,PADCHAR,EXPONENTCHARG'
  1004. `~@G'
  1005. If the number is positive a plus sign is printed.
  1006. `~$'
  1007. Dollars floating-point (prints a flonum in fixed with signs
  1008. separated).
  1009. `~DIGITS,SCALE,WIDTH,PADCHAR$'
  1010. `~@$'
  1011. If the number is positive a plus sign is printed.
  1012. `~:@$'
  1013. A sign is always printed and appears before the padding.
  1014. `~:$'
  1015. The sign appears before the padding.
  1016. `~%'
  1017. Newline.
  1018. `~N%'
  1019. print N newlines.
  1020. `~&'
  1021. print newline if not at the beginning of the output line.
  1022. `~N&'
  1023. prints `~&' and then N-1 newlines.
  1024. `~|'
  1025. Page Separator.
  1026. `~N|'
  1027. print N page separators.
  1028. `~~'
  1029. Tilde.
  1030. `~N~'
  1031. print N tildes.
  1032. `~'<newline>
  1033. Continuation Line.
  1034. `~:'<newline>
  1035. newline is ignored, white space left.
  1036. `~@'<newline>
  1037. newline is left, white space ignored.
  1038. `~T'
  1039. Tabulation.
  1040. `~@T'
  1041. relative tabulation.
  1042. `~COLNUM,COLINCT'
  1043. full tabulation.
  1044. `~?'
  1045. Indirection (expects indirect arguments as a list).
  1046. `~@?'
  1047. extracts indirect arguments from format arguments.
  1048. `~(STR~)'
  1049. Case conversion (converts by `string-downcase').
  1050. `~:(STR~)'
  1051. converts by `string-capitalize'.
  1052. `~@(STR~)'
  1053. converts by `string-capitalize-first'.
  1054. `~:@(STR~)'
  1055. converts by `string-upcase'.
  1056. `~*'
  1057. Argument Jumping (jumps 1 argument forward).
  1058. `~N*'
  1059. jumps N arguments forward.
  1060. `~:*'
  1061. jumps 1 argument backward.
  1062. `~N:*'
  1063. jumps N arguments backward.
  1064. `~@*'
  1065. jumps to the 0th argument.
  1066. `~N@*'
  1067. jumps to the Nth argument (beginning from 0)
  1068. `~[STR0~;STR1~;...~;STRN~]'
  1069. Conditional Expression (numerical clause conditional).
  1070. `~N['
  1071. take argument from N.
  1072. `~@['
  1073. true test conditional.
  1074. `~:['
  1075. if-else-then conditional.
  1076. `~;'
  1077. clause separator.
  1078. `~:;'
  1079. default clause follows.
  1080. `~{STR~}'
  1081. Iteration (args come from the next argument (a list)).
  1082. `~N{'
  1083. at most N iterations.
  1084. `~:{'
  1085. args from next arg (a list of lists).
  1086. `~@{'
  1087. args from the rest of arguments.
  1088. `~:@{'
  1089. args from the rest args (lists).
  1090. `~^'
  1091. Up and out.
  1092. `~N^'
  1093. aborts if N = 0
  1094. `~N,M^'
  1095. aborts if N = M
  1096. `~N,M,K^'
  1097. aborts if N <= M <= K
  1098. *** Not Implemented CL Format Control Directives
  1099. `~:A'
  1100. print `#f' as an empty list (see below).
  1101. `~:S'
  1102. print `#f' as an empty list (see below).
  1103. `~<~>'
  1104. Justification.
  1105. `~:^'
  1106. (sorry I don't understand its semantics completely)
  1107. *** Extended, Replaced and Additional Control Directives
  1108. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHD'
  1109. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHX'
  1110. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHO'
  1111. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHB'
  1112. `~N,MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHR'
  1113. COMMAWIDTH is the number of characters between two comma
  1114. characters.
  1115. `~I'
  1116. print a R4RS complex number as `~F~@Fi' with passed parameters for
  1117. `~F'.
  1118. `~Y'
  1119. Pretty print formatting of an argument for scheme code lists.
  1120. `~K'
  1121. Same as `~?.'
  1122. `~!'
  1123. Flushes the output if format DESTINATION is a port.
  1124. `~_'
  1125. Print a `#\space' character
  1126. `~N_'
  1127. print N `#\space' characters.
  1128. `~/'
  1129. Print a `#\tab' character
  1130. `~N/'
  1131. print N `#\tab' characters.
  1132. `~NC'
  1133. Takes N as an integer representation for a character. No arguments
  1134. are consumed. N is converted to a character by `integer->char'. N
  1135. must be a positive decimal number.
  1136. `~:S'
  1137. Print out readproof. Prints out internal objects represented as
  1138. `#<...>' as strings `"#<...>"' so that the format output can always
  1139. be processed by `read'.
  1140. `~:A'
  1141. Print out readproof. Prints out internal objects represented as
  1142. `#<...>' as strings `"#<...>"' so that the format output can always
  1143. be processed by `read'.
  1144. `~Q'
  1145. Prints information and a copyright notice on the format
  1146. implementation.
  1147. `~:Q'
  1148. prints format version.
  1149. `~F, ~E, ~G, ~$'
  1150. may also print number strings, i.e. passing a number as a string
  1151. and format it accordingly.
  1152. *** Configuration Variables
  1153. The format module exports some configuration variables to suit the
  1154. systems and users needs. There should be no modification necessary for
  1155. the configuration that comes with Guile. Format detects automatically
  1156. if the running scheme system implements floating point numbers and
  1157. complex numbers.
  1158. format:symbol-case-conv
  1159. Symbols are converted by `symbol->string' so the case type of the
  1160. printed symbols is implementation dependent.
  1161. `format:symbol-case-conv' is a one arg closure which is either
  1162. `#f' (no conversion), `string-upcase', `string-downcase' or
  1163. `string-capitalize'. (default `#f')
  1164. format:iobj-case-conv
  1165. As FORMAT:SYMBOL-CASE-CONV but applies for the representation of
  1166. implementation internal objects. (default `#f')
  1167. format:expch
  1168. The character prefixing the exponent value in `~E' printing.
  1169. (default `#\E')
  1170. *** Compatibility With Other Format Implementations
  1171. SLIB format 2.x:
  1172. See `format.doc'.
  1173. SLIB format 1.4:
  1174. Downward compatible except for padding support and `~A', `~S',
  1175. `~P', `~X' uppercase printing. SLIB format 1.4 uses C-style
  1176. `printf' padding support which is completely replaced by the CL
  1177. `format' padding style.
  1178. MIT C-Scheme 7.1:
  1179. Downward compatible except for `~', which is not documented
  1180. (ignores all characters inside the format string up to a newline
  1181. character). (7.1 implements `~a', `~s', ~NEWLINE, `~~', `~%',
  1182. numerical and variable parameters and `:/@' modifiers in the CL
  1183. sense).
  1184. Elk 1.5/2.0:
  1185. Downward compatible except for `~A' and `~S' which print in
  1186. uppercase. (Elk implements `~a', `~s', `~~', and `~%' (no
  1187. directive parameters or modifiers)).
  1188. Scheme->C 01nov91:
  1189. Downward compatible except for an optional destination parameter:
  1190. S2C accepts a format call without a destination which returns a
  1191. formatted string. This is equivalent to a #f destination in S2C.
  1192. (S2C implements `~a', `~s', `~c', `~%', and `~~' (no directive
  1193. parameters or modifiers)).
  1194. ** Changes to string-handling functions.
  1195. These functions were added to support the (ice-9 format) module, above.
  1196. *** New function: string-upcase STRING
  1197. *** New function: string-downcase STRING
  1198. These are non-destructive versions of the existing string-upcase! and
  1199. string-downcase! functions.
  1200. *** New function: string-capitalize! STRING
  1201. *** New function: string-capitalize STRING
  1202. These functions convert the first letter of each word in the string to
  1203. upper case. Thus:
  1204. (string-capitalize "howdy there")
  1205. => "Howdy There"
  1206. As with the other functions, string-capitalize! modifies the string in
  1207. place, while string-capitalize returns a modified copy of its argument.
  1208. *** New function: string-ci->symbol STRING
  1209. Return a symbol whose name is STRING, but having the same case as if
  1210. the symbol had be read by `read'.
  1211. Guile can be configured to be sensitive or insensitive to case
  1212. differences in Scheme identifiers. If Guile is case-insensitive, all
  1213. symbols are converted to lower case on input. The `string-ci->symbol'
  1214. function returns a symbol whose name in STRING, transformed as Guile
  1215. would if STRING were input.
  1216. *** New function: substring-move! STRING1 START END STRING2 START
  1217. Copy the substring of STRING1 from START (inclusive) to END
  1218. (exclusive) to STRING2 at START. STRING1 and STRING2 may be the same
  1219. string, and the source and destination areas may overlap; in all
  1220. cases, the function behaves as if all the characters were copied
  1221. simultanously.
  1222. *** Extended functions: substring-move-left! substring-move-right!
  1223. These functions now correctly copy arbitrarily overlapping substrings;
  1224. they are both synonyms for substring-move!.
  1225. ** New module (ice-9 getopt-long), with the function `getopt-long'.
  1226. getopt-long is a function for parsing command-line arguments in a
  1227. manner consistent with other GNU programs.
  1228. (getopt-long ARGS GRAMMAR)
  1229. Parse the arguments ARGS according to the argument list grammar GRAMMAR.
  1230. ARGS should be a list of strings. Its first element should be the
  1231. name of the program; subsequent elements should be the arguments
  1232. that were passed to the program on the command line. The
  1233. `program-arguments' procedure returns a list of this form.
  1234. GRAMMAR is a list of the form:
  1235. ((OPTION (PROPERTY VALUE) ...) ...)
  1236. Each OPTION should be a symbol. `getopt-long' will accept a
  1237. command-line option named `--OPTION'.
  1238. Each option can have the following (PROPERTY VALUE) pairs:
  1239. (single-char CHAR) --- Accept `-CHAR' as a single-character
  1240. equivalent to `--OPTION'. This is how to specify traditional
  1241. Unix-style flags.
  1242. (required? BOOL) --- If BOOL is true, the option is required.
  1243. getopt-long will raise an error if it is not found in ARGS.
  1244. (value BOOL) --- If BOOL is #t, the option accepts a value; if
  1245. it is #f, it does not; and if it is the symbol
  1246. `optional', the option may appear in ARGS with or
  1247. without a value.
  1248. (predicate FUNC) --- If the option accepts a value (i.e. you
  1249. specified `(value #t)' for this option), then getopt
  1250. will apply FUNC to the value, and throw an exception
  1251. if it returns #f. FUNC should be a procedure which
  1252. accepts a string and returns a boolean value; you may
  1253. need to use quasiquotes to get it into GRAMMAR.
  1254. The (PROPERTY VALUE) pairs may occur in any order, but each
  1255. property may occur only once. By default, options do not have
  1256. single-character equivalents, are not required, and do not take
  1257. values.
  1258. In ARGS, single-character options may be combined, in the usual
  1259. Unix fashion: ("-x" "-y") is equivalent to ("-xy"). If an option
  1260. accepts values, then it must be the last option in the
  1261. combination; the value is the next argument. So, for example, using
  1262. the following grammar:
  1263. ((apples (single-char #\a))
  1264. (blimps (single-char #\b) (value #t))
  1265. (catalexis (single-char #\c) (value #t)))
  1266. the following argument lists would be acceptable:
  1267. ("-a" "-b" "bang" "-c" "couth") ("bang" and "couth" are the values
  1268. for "blimps" and "catalexis")
  1269. ("-ab" "bang" "-c" "couth") (same)
  1270. ("-ac" "couth" "-b" "bang") (same)
  1271. ("-abc" "couth" "bang") (an error, since `-b' is not the
  1272. last option in its combination)
  1273. If an option's value is optional, then `getopt-long' decides
  1274. whether it has a value by looking at what follows it in ARGS. If
  1275. the next element is a string, and it does not appear to be an
  1276. option itself, then that string is the option's value.
  1277. The value of a long option can appear as the next element in ARGS,
  1278. or it can follow the option name, separated by an `=' character.
  1279. Thus, using the same grammar as above, the following argument lists
  1280. are equivalent:
  1281. ("--apples" "Braeburn" "--blimps" "Goodyear")
  1282. ("--apples=Braeburn" "--blimps" "Goodyear")
  1283. ("--blimps" "Goodyear" "--apples=Braeburn")
  1284. If the option "--" appears in ARGS, argument parsing stops there;
  1285. subsequent arguments are returned as ordinary arguments, even if
  1286. they resemble options. So, in the argument list:
  1287. ("--apples" "Granny Smith" "--" "--blimp" "Goodyear")
  1288. `getopt-long' will recognize the `apples' option as having the
  1289. value "Granny Smith", but it will not recognize the `blimp'
  1290. option; it will return the strings "--blimp" and "Goodyear" as
  1291. ordinary argument strings.
  1292. The `getopt-long' function returns the parsed argument list as an
  1293. assocation list, mapping option names --- the symbols from GRAMMAR
  1294. --- onto their values, or #t if the option does not accept a value.
  1295. Unused options do not appear in the alist.
  1296. All arguments that are not the value of any option are returned
  1297. as a list, associated with the empty list.
  1298. `getopt-long' throws an exception if:
  1299. - it finds an unrecognized option in ARGS
  1300. - a required option is omitted
  1301. - an option that requires an argument doesn't get one
  1302. - an option that doesn't accept an argument does get one (this can
  1303. only happen using the long option `--opt=value' syntax)
  1304. - an option predicate fails
  1305. So, for example:
  1306. (define grammar
  1307. `((lockfile-dir (required? #t)
  1308. (value #t)
  1309. (single-char #\k)
  1310. (predicate ,file-is-directory?))
  1311. (verbose (required? #f)
  1312. (single-char #\v)
  1313. (value #f))
  1314. (x-includes (single-char #\x))
  1315. (rnet-server (single-char #\y)
  1316. (predicate ,string?))))
  1317. (getopt-long '("my-prog" "-vk" "/tmp" "foo1" "--x-includes=/usr/include"
  1318. "--rnet-server=lamprod" "--" "-fred" "foo2" "foo3")
  1319. grammar)
  1320. => ((() "foo1" "-fred" "foo2" "foo3")
  1321. (rnet-server . "lamprod")
  1322. (x-includes . "/usr/include")
  1323. (lockfile-dir . "/tmp")
  1324. (verbose . #t))
  1325. ** The (ice-9 getopt-gnu-style) module is obsolete; use (ice-9 getopt-long).
  1326. It will be removed in a few releases.
  1327. ** New syntax: lambda*
  1328. ** New syntax: define*
  1329. ** New syntax: define*-public
  1330. ** New syntax: defmacro*
  1331. ** New syntax: defmacro*-public
  1332. Guile now supports optional arguments.
  1333. `lambda*', `define*', `define*-public', `defmacro*' and
  1334. `defmacro*-public' are identical to the non-* versions except that
  1335. they use an extended type of parameter list that has the following BNF
  1336. syntax (parentheses are literal, square brackets indicate grouping,
  1337. and `*', `+' and `?' have the usual meaning):
  1338. ext-param-list ::= ( [identifier]* [#&optional [ext-var-decl]+]?
  1339. [#&key [ext-var-decl]+ [#&allow-other-keys]?]?
  1340. [[#&rest identifier]|[. identifier]]? ) | [identifier]
  1341. ext-var-decl ::= identifier | ( identifier expression )
  1342. The semantics are best illustrated with the following documentation
  1343. and examples for `lambda*':
  1344. lambda* args . body
  1345. lambda extended for optional and keyword arguments
  1346. lambda* creates a procedure that takes optional arguments. These
  1347. are specified by putting them inside brackets at the end of the
  1348. paramater list, but before any dotted rest argument. For example,
  1349. (lambda* (a b #&optional c d . e) '())
  1350. creates a procedure with fixed arguments a and b, optional arguments c
  1351. and d, and rest argument e. If the optional arguments are omitted
  1352. in a call, the variables for them are unbound in the procedure. This
  1353. can be checked with the bound? macro.
  1354. lambda* can also take keyword arguments. For example, a procedure
  1355. defined like this:
  1356. (lambda* (#&key xyzzy larch) '())
  1357. can be called with any of the argument lists (#:xyzzy 11)
  1358. (#:larch 13) (#:larch 42 #:xyzzy 19) (). Whichever arguments
  1359. are given as keywords are bound to values.
  1360. Optional and keyword arguments can also be given default values
  1361. which they take on when they are not present in a call, by giving a
  1362. two-item list in place of an optional argument, for example in:
  1363. (lambda* (foo #&optional (bar 42) #&key (baz 73)) (list foo bar baz))
  1364. foo is a fixed argument, bar is an optional argument with default
  1365. value 42, and baz is a keyword argument with default value 73.
  1366. Default value expressions are not evaluated unless they are needed
  1367. and until the procedure is called.
  1368. lambda* now supports two more special parameter list keywords.
  1369. lambda*-defined procedures now throw an error by default if a
  1370. keyword other than one of those specified is found in the actual
  1371. passed arguments. However, specifying #&allow-other-keys
  1372. immediately after the kyword argument declarations restores the
  1373. previous behavior of ignoring unknown keywords. lambda* also now
  1374. guarantees that if the same keyword is passed more than once, the
  1375. last one passed is the one that takes effect. For example,
  1376. ((lambda* (#&key (heads 0) (tails 0)) (display (list heads tails)))
  1377. #:heads 37 #:tails 42 #:heads 99)
  1378. would result in (99 47) being displayed.
  1379. #&rest is also now provided as a synonym for the dotted syntax rest
  1380. argument. The argument lists (a . b) and (a #&rest b) are equivalent in
  1381. all respects to lambda*. This is provided for more similarity to DSSSL,
  1382. MIT-Scheme and Kawa among others, as well as for refugees from other
  1383. Lisp dialects.
  1384. Further documentation may be found in the optargs.scm file itself.
  1385. The optional argument module also exports the macros `let-optional',
  1386. `let-optional*', `let-keywords', `let-keywords*' and `bound?'. These
  1387. are not documented here because they may be removed in the future, but
  1388. full documentation is still available in optargs.scm.
  1389. ** New syntax: and-let*
  1390. Guile now supports the `and-let*' form, described in the draft SRFI-2.
  1391. Syntax: (land* (<clause> ...) <body> ...)
  1392. Each <clause> should have one of the following forms:
  1393. (<variable> <expression>)
  1394. (<expression>)
  1395. <bound-variable>
  1396. Each <variable> or <bound-variable> should be an identifier. Each
  1397. <expression> should be a valid expression. The <body> should be a
  1398. possibly empty sequence of expressions, like the <body> of a
  1399. lambda form.
  1400. Semantics: A LAND* expression is evaluated by evaluating the
  1401. <expression> or <bound-variable> of each of the <clause>s from
  1402. left to right. The value of the first <expression> or
  1403. <bound-variable> that evaluates to a false value is returned; the
  1404. remaining <expression>s and <bound-variable>s are not evaluated.
  1405. The <body> forms are evaluated iff all the <expression>s and
  1406. <bound-variable>s evaluate to true values.
  1407. The <expression>s and the <body> are evaluated in an environment
  1408. binding each <variable> of the preceding (<variable> <expression>)
  1409. clauses to the value of the <expression>. Later bindings
  1410. shadow earlier bindings.
  1411. Guile's and-let* macro was contributed by Michael Livshin.
  1412. ** New sorting functions
  1413. *** New function: sorted? SEQUENCE LESS?
  1414. Returns `#t' when the sequence argument is in non-decreasing order
  1415. according to LESS? (that is, there is no adjacent pair `... x y
  1416. ...' for which `(less? y x)').
  1417. Returns `#f' when the sequence contains at least one out-of-order
  1418. pair. It is an error if the sequence is neither a list nor a
  1419. vector.
  1420. *** New function: merge LIST1 LIST2 LESS?
  1421. LIST1 and LIST2 are sorted lists.
  1422. Returns the sorted list of all elements in LIST1 and LIST2.
  1423. Assume that the elements a and b1 in LIST1 and b2 in LIST2 are "equal"
  1424. in the sense that (LESS? x y) --> #f for x, y in {a, b1, b2},
  1425. and that a < b1 in LIST1. Then a < b1 < b2 in the result.
  1426. (Here "<" should read "comes before".)
  1427. *** New procedure: merge! LIST1 LIST2 LESS?
  1428. Merges two lists, re-using the pairs of LIST1 and LIST2 to build
  1429. the result. If the code is compiled, and LESS? constructs no new
  1430. pairs, no pairs at all will be allocated. The first pair of the
  1431. result will be either the first pair of LIST1 or the first pair of
  1432. LIST2.
  1433. *** New function: sort SEQUENCE LESS?
  1434. Accepts either a list or a vector, and returns a new sequence
  1435. which is sorted. The new sequence is the same type as the input.
  1436. Always `(sorted? (sort sequence less?) less?)'. The original
  1437. sequence is not altered in any way. The new sequence shares its
  1438. elements with the old one; no elements are copied.
  1439. *** New procedure: sort! SEQUENCE LESS
  1440. Returns its sorted result in the original boxes. No new storage is
  1441. allocated at all. Proper usage: (set! slist (sort! slist <))
  1442. *** New function: stable-sort SEQUENCE LESS?
  1443. Similar to `sort' but stable. That is, if "equal" elements are
  1444. ordered a < b in the original sequence, they will have the same order
  1445. in the result.
  1446. *** New function: stable-sort! SEQUENCE LESS?
  1447. Similar to `sort!' but stable.
  1448. Uses temporary storage when sorting vectors.
  1449. *** New functions: sort-list, sort-list!
  1450. Added for compatibility with scsh.
  1451. ** New built-in random number support
  1452. *** New function: random N [STATE]
  1453. Accepts a positive integer or real N and returns a number of the
  1454. same type between zero (inclusive) and N (exclusive). The values
  1455. returned have a uniform distribution.
  1456. The optional argument STATE must be of the type produced by
  1457. `copy-random-state' or `seed->random-state'. It defaults to the value
  1458. of the variable `*random-state*'. This object is used to maintain the
  1459. state of the pseudo-random-number generator and is altered as a side
  1460. effect of the `random' operation.
  1461. *** New variable: *random-state*
  1462. Holds a data structure that encodes the internal state of the
  1463. random-number generator that `random' uses by default. The nature
  1464. of this data structure is implementation-dependent. It may be
  1465. printed out and successfully read back in, but may or may not
  1466. function correctly as a random-number state object in another
  1467. implementation.
  1468. *** New function: copy-random-state [STATE]
  1469. Returns a new object of type suitable for use as the value of the
  1470. variable `*random-state*' and as a second argument to `random'.
  1471. If argument STATE is given, a copy of it is returned. Otherwise a
  1472. copy of `*random-state*' is returned.
  1473. *** New function: seed->random-state SEED
  1474. Returns a new object of type suitable for use as the value of the
  1475. variable `*random-state*' and as a second argument to `random'.
  1476. SEED is a string or a number. A new state is generated and
  1477. initialized using SEED.
  1478. *** New function: random:uniform [STATE]
  1479. Returns an uniformly distributed inexact real random number in the
  1480. range between 0 and 1.
  1481. *** New procedure: random:solid-sphere! VECT [STATE]
  1482. Fills VECT with inexact real random numbers the sum of whose
  1483. squares is less than 1.0. Thinking of VECT as coordinates in
  1484. space of dimension N = `(vector-length VECT)', the coordinates are
  1485. uniformly distributed within the unit N-shere. The sum of the
  1486. squares of the numbers is returned. VECT can be either a vector
  1487. or a uniform vector of doubles.
  1488. *** New procedure: random:hollow-sphere! VECT [STATE]
  1489. Fills VECT with inexact real random numbers the sum of whose squares
  1490. is equal to 1.0. Thinking of VECT as coordinates in space of
  1491. dimension n = `(vector-length VECT)', the coordinates are uniformly
  1492. distributed over the surface of the unit n-shere. VECT can be either
  1493. a vector or a uniform vector of doubles.
  1494. *** New function: random:normal [STATE]
  1495. Returns an inexact real in a normal distribution with mean 0 and
  1496. standard deviation 1. For a normal distribution with mean M and
  1497. standard deviation D use `(+ M (* D (random:normal)))'.
  1498. *** New procedure: random:normal-vector! VECT [STATE]
  1499. Fills VECT with inexact real random numbers which are independent and
  1500. standard normally distributed (i.e., with mean 0 and variance 1).
  1501. VECT can be either a vector or a uniform vector of doubles.
  1502. *** New function: random:exp STATE
  1503. Returns an inexact real in an exponential distribution with mean 1.
  1504. For an exponential distribution with mean U use (* U (random:exp)).
  1505. ** The range of logand, logior, logxor, logtest, and logbit? have changed.
  1506. These functions now operate on numbers in the range of a C unsigned
  1507. long.
  1508. These functions used to operate on numbers in the range of a C signed
  1509. long; however, this seems inappropriate, because Guile integers don't
  1510. overflow.
  1511. ** New function: make-guardian
  1512. This is an implementation of guardians as described in
  1513. R. Kent Dybvig, Carl Bruggeman, and David Eby (1993) "Guardians in a
  1514. Generation-Based Garbage Collector" ACM SIGPLAN Conference on
  1515. Programming Language Design and Implementation, June 1993
  1516. ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/pubs/guardians.ps.gz
  1517. ** New functions: delq1!, delv1!, delete1!
  1518. These procedures behave similar to delq! and friends but delete only
  1519. one object if at all.
  1520. ** New function: unread-string STRING PORT
  1521. Unread STRING to PORT, that is, push it back onto the port so that
  1522. next read operation will work on the pushed back characters.
  1523. ** unread-char can now be called multiple times
  1524. If unread-char is called multiple times, the unread characters will be
  1525. read again in last-in first-out order.
  1526. ** the procedures uniform-array-read! and uniform-array-write! now
  1527. work on any kind of port, not just ports which are open on a file.
  1528. ** Now 'l' in a port mode requests line buffering.
  1529. ** The procedure truncate-file now works on string ports as well
  1530. as file ports. If the size argument is omitted, the current
  1531. file position is used.
  1532. ** new procedure: seek PORT/FDES OFFSET WHENCE
  1533. The arguments are the same as for the old fseek procedure, but it
  1534. works on string ports as well as random-access file ports.
  1535. ** the fseek procedure now works on string ports, since it has been
  1536. redefined using seek.
  1537. ** the setvbuf procedure now uses a default size if mode is _IOFBF and
  1538. size is not supplied.
  1539. ** the newline procedure no longer flushes the port if it's not
  1540. line-buffered: previously it did if it was the current output port.
  1541. ** open-pipe and close-pipe are no longer primitive procedures, but
  1542. an emulation can be obtained using `(use-modules (ice-9 popen))'.
  1543. ** the freopen procedure has been removed.
  1544. ** new procedure: drain-input PORT
  1545. Drains PORT's read buffers (including any pushed-back characters)
  1546. and returns the contents as a single string.
  1547. ** New function: map-in-order PROC LIST1 LIST2 ...
  1548. Version of `map' which guarantees that the procedure is applied to the
  1549. lists in serial order.
  1550. ** Renamed `serial-array-copy!' and `serial-array-map!' to
  1551. `array-copy-in-order!' and `array-map-in-order!'. The old names are
  1552. now obsolete and will go away in release 1.5.
  1553. ** New syntax: collect BODY1 ...
  1554. Version of `begin' which returns a list of the results of the body
  1555. forms instead of the result of the last body form. In contrast to
  1556. `begin', `collect' allows an empty body.
  1557. ** New functions: read-history FILENAME, write-history FILENAME
  1558. Read/write command line history from/to file. Returns #t on success
  1559. and #f if an error occured.
  1560. ** `ls' and `lls' in module (ice-9 ls) now handle no arguments.
  1561. These procedures return a list of definitions available in the specified
  1562. argument, a relative module reference. In the case of no argument,
  1563. `(current-module)' is now consulted for definitions to return, instead
  1564. of simply returning #f, the former behavior.
  1565. ** The #/ syntax for lists is no longer supported.
  1566. Earlier versions of Scheme accepted this syntax, but printed a
  1567. warning.
  1568. ** Guile no longer consults the SCHEME_LOAD_PATH environment variable.
  1569. Instead, you should set GUILE_LOAD_PATH to tell Guile where to find
  1570. modules.
  1571. * Changes to the gh_ interface
  1572. ** gh_scm2doubles
  1573. Now takes a second argument which is the result array. If this
  1574. pointer is NULL, a new array is malloced (the old behaviour).
  1575. ** gh_chars2byvect, gh_shorts2svect, gh_floats2fvect, gh_scm2chars,
  1576. gh_scm2shorts, gh_scm2longs, gh_scm2floats
  1577. New functions.
  1578. * Changes to the scm_ interface
  1579. ** Function: scm_make_named_hook (char* name, int n_args)
  1580. Creates a hook in the same way as make-hook above but also
  1581. binds a variable named NAME to it.
  1582. This is the typical way of creating a hook from C code.
  1583. Currently, the variable is created in the "current" module. This
  1584. might change when we get the new module system.
  1585. ** The smob interface
  1586. The interface for creating smobs has changed. For documentation, see
  1587. data-rep.info (made from guile-core/doc/data-rep.texi).
  1588. *** Deprecated function: SCM scm_newsmob (scm_smobfuns *)
  1589. >>> This function will be removed in 1.3.4. <<<
  1590. It is replaced by:
  1591. *** Function: SCM scm_make_smob_type (const char *name, scm_sizet size)
  1592. This function adds a new smob type, named NAME, with instance size
  1593. SIZE to the system. The return value is a tag that is used in
  1594. creating instances of the type. If SIZE is 0, then no memory will
  1595. be allocated when instances of the smob are created, and nothing
  1596. will be freed by the default free function.
  1597. *** Function: void scm_set_smob_mark (long tc, SCM (*mark) (SCM))
  1598. This function sets the smob marking procedure for the smob type
  1599. specified by the tag TC. TC is the tag returned by
  1600. `scm_make_smob_type'.
  1601. *** Function: void scm_set_smob_free (long tc, SCM (*mark) (SCM))
  1602. This function sets the smob freeing procedure for the smob type
  1603. specified by the tag TC. TC is the tag returned by
  1604. `scm_make_smob_type'.
  1605. *** Function: void scm_set_smob_print (tc, print)
  1606. - Function: void scm_set_smob_print (long tc,
  1607. scm_sizet (*print) (SCM,
  1608. SCM,
  1609. scm_print_state *))
  1610. This function sets the smob printing procedure for the smob type
  1611. specified by the tag TC. TC is the tag returned by
  1612. `scm_make_smob_type'.
  1613. *** Function: void scm_set_smob_equalp (long tc, SCM (*equalp) (SCM, SCM))
  1614. This function sets the smob equality-testing predicate for the
  1615. smob type specified by the tag TC. TC is the tag returned by
  1616. `scm_make_smob_type'.
  1617. *** Macro: void SCM_NEWSMOB (SCM var, long tc, void *data)
  1618. Make VALUE contain a smob instance of the type with type code TC and
  1619. smob data DATA. VALUE must be previously declared as C type `SCM'.
  1620. *** Macro: fn_returns SCM_RETURN_NEWSMOB (long tc, void *data)
  1621. This macro expands to a block of code that creates a smob instance
  1622. of the type with type code TC and smob data DATA, and returns that
  1623. `SCM' value. It should be the last piece of code in a block.
  1624. ** The interfaces for using I/O ports and implementing port types
  1625. (ptobs) have changed significantly. The new interface is based on
  1626. shared access to buffers and a new set of ptob procedures.
  1627. *** scm_newptob has been removed
  1628. It is replaced by:
  1629. *** Function: SCM scm_make_port_type (type_name, fill_buffer, write_flush)
  1630. - Function: SCM scm_make_port_type (char *type_name,
  1631. int (*fill_buffer) (SCM port),
  1632. void (*write_flush) (SCM port));
  1633. Similarly to the new smob interface, there is a set of function
  1634. setters by which the user can customize the behaviour of his port
  1635. type. See ports.h (scm_set_port_XXX).
  1636. ** scm_strport_to_string: New function: creates a new string from
  1637. a string port's buffer.
  1638. ** Plug in interface for random number generators
  1639. The variable `scm_the_rng' in random.c contains a value and three
  1640. function pointers which together define the current random number
  1641. generator being used by the Scheme level interface and the random
  1642. number library functions.
  1643. The user is free to replace the default generator with the generator
  1644. of his own choice.
  1645. *** Variable: size_t scm_the_rng.rstate_size
  1646. The size of the random state type used by the current RNG
  1647. measured in chars.
  1648. *** Function: unsigned long scm_the_rng.random_bits (scm_rstate *STATE)
  1649. Given the random STATE, return 32 random bits.
  1650. *** Function: void scm_the_rng.init_rstate (scm_rstate *STATE, chars *S, int N)
  1651. Seed random state STATE using string S of length N.
  1652. *** Function: scm_rstate *scm_the_rng.copy_rstate (scm_rstate *STATE)
  1653. Given random state STATE, return a malloced copy.
  1654. ** Default RNG
  1655. The default RNG is the MWC (Multiply With Carry) random number
  1656. generator described by George Marsaglia at the Department of
  1657. Statistics and Supercomputer Computations Research Institute, The
  1658. Florida State University (http://stat.fsu.edu/~geo).
  1659. It uses 64 bits, has a period of 4578426017172946943 (4.6e18), and
  1660. passes all tests in the DIEHARD test suite
  1661. (http://stat.fsu.edu/~geo/diehard.html). The generation of 32 bits
  1662. costs one multiply and one add on platforms which either supports long
  1663. longs (gcc does this on most systems) or have 64 bit longs. The cost
  1664. is four multiply on other systems but this can be optimized by writing
  1665. scm_i_uniform32 in assembler.
  1666. These functions are provided through the scm_the_rng interface for use
  1667. by libguile and the application.
  1668. *** Function: unsigned long scm_i_uniform32 (scm_i_rstate *STATE)
  1669. Given the random STATE, return 32 random bits.
  1670. Don't use this function directly. Instead go through the plugin
  1671. interface (see "Plug in interface" above).
  1672. *** Function: void scm_i_init_rstate (scm_i_rstate *STATE, char *SEED, int N)
  1673. Initialize STATE using SEED of length N.
  1674. *** Function: scm_i_rstate *scm_i_copy_rstate (scm_i_rstate *STATE)
  1675. Return a malloc:ed copy of STATE. This function can easily be re-used
  1676. in the interfaces to other RNGs.
  1677. ** Random number library functions
  1678. These functions use the current RNG through the scm_the_rng interface.
  1679. It might be a good idea to use these functions from your C code so
  1680. that only one random generator is used by all code in your program.
  1681. The default random state is stored in:
  1682. *** Variable: SCM scm_var_random_state
  1683. Contains the vcell of the Scheme variable "*random-state*" which is
  1684. used as default state by all random number functions in the Scheme
  1685. level interface.
  1686. Example:
  1687. double x = scm_c_uniform01 (SCM_RSTATE (SCM_CDR (scm_var_random_state)));
  1688. *** Function: scm_rstate *scm_c_default_rstate (void)
  1689. This is a convenience function which returns the value of
  1690. scm_var_random_state. An error message is generated if this value
  1691. isn't a random state.
  1692. *** Function: scm_rstate *scm_c_make_rstate (char *SEED, int LENGTH)
  1693. Make a new random state from the string SEED of length LENGTH.
  1694. It is generally not a good idea to use multiple random states in a
  1695. program. While subsequent random numbers generated from one random
  1696. state are guaranteed to be reasonably independent, there is no such
  1697. guarantee for numbers generated from different random states.
  1698. *** Macro: unsigned long scm_c_uniform32 (scm_rstate *STATE)
  1699. Return 32 random bits.
  1700. *** Function: double scm_c_uniform01 (scm_rstate *STATE)
  1701. Return a sample from the uniform(0,1) distribution.
  1702. *** Function: double scm_c_normal01 (scm_rstate *STATE)
  1703. Return a sample from the normal(0,1) distribution.
  1704. *** Function: double scm_c_exp1 (scm_rstate *STATE)
  1705. Return a sample from the exp(1) distribution.
  1706. *** Function: unsigned long scm_c_random (scm_rstate *STATE, unsigned long M)
  1707. Return a sample from the discrete uniform(0,M) distribution.
  1708. *** Function: SCM scm_c_random_bignum (scm_rstate *STATE, SCM M)
  1709. Return a sample from the discrete uniform(0,M) distribution.
  1710. M must be a bignum object. The returned value may be an INUM.
  1711. Changes in Guile 1.3 (released Monday, October 19, 1998):
  1712. * Changes to the distribution
  1713. ** We renamed the SCHEME_LOAD_PATH environment variable to GUILE_LOAD_PATH.
  1714. To avoid conflicts, programs should name environment variables after
  1715. themselves, except when there's a common practice establishing some
  1716. other convention.
  1717. For now, Guile supports both GUILE_LOAD_PATH and SCHEME_LOAD_PATH,
  1718. giving the former precedence, and printing a warning message if the
  1719. latter is set. Guile 1.4 will not recognize SCHEME_LOAD_PATH at all.
  1720. ** The header files related to multi-byte characters have been removed.
  1721. They were: libguile/extchrs.h and libguile/mbstrings.h. Any C code
  1722. which referred to these explicitly will probably need to be rewritten,
  1723. since the support for the variant string types has been removed; see
  1724. below.
  1725. ** The header files append.h and sequences.h have been removed. These
  1726. files implemented non-R4RS operations which would encourage
  1727. non-portable programming style and less easy-to-read code.
  1728. * Changes to the stand-alone interpreter
  1729. ** New procedures have been added to implement a "batch mode":
  1730. *** Function: batch-mode?
  1731. Returns a boolean indicating whether the interpreter is in batch
  1732. mode.
  1733. *** Function: set-batch-mode?! ARG
  1734. If ARG is true, switches the interpreter to batch mode. The `#f'
  1735. case has not been implemented.
  1736. ** Guile now provides full command-line editing, when run interactively.
  1737. To use this feature, you must have the readline library installed.
  1738. The Guile build process will notice it, and automatically include
  1739. support for it.
  1740. The readline library is available via anonymous FTP from any GNU
  1741. mirror site; the canonical location is "ftp://prep.ai.mit.edu/pub/gnu".
  1742. ** the-last-stack is now a fluid.
  1743. * Changes to the procedure for linking libguile with your programs
  1744. ** You can now use the `guile-config' utility to build programs that use Guile.
  1745. Guile now includes a command-line utility called `guile-config', which
  1746. can provide information about how to compile and link programs that
  1747. use Guile.
  1748. *** `guile-config compile' prints any C compiler flags needed to use Guile.
  1749. You should include this command's output on the command line you use
  1750. to compile C or C++ code that #includes the Guile header files. It's
  1751. usually just a `-I' flag to help the compiler find the Guile headers.
  1752. *** `guile-config link' prints any linker flags necessary to link with Guile.
  1753. This command writes to its standard output a list of flags which you
  1754. must pass to the linker to link your code against the Guile library.
  1755. The flags include '-lguile' itself, any other libraries the Guile
  1756. library depends upon, and any `-L' flags needed to help the linker
  1757. find those libraries.
  1758. For example, here is a Makefile rule that builds a program named 'foo'
  1759. from the object files ${FOO_OBJECTS}, and links them against Guile:
  1760. foo: ${FOO_OBJECTS}
  1761. ${CC} ${CFLAGS} ${FOO_OBJECTS} `guile-config link` -o foo
  1762. Previous Guile releases recommended that you use autoconf to detect
  1763. which of a predefined set of libraries were present on your system.
  1764. It is more robust to use `guile-config', since it records exactly which
  1765. libraries the installed Guile library requires.
  1766. This was originally called `build-guile', but was renamed to
  1767. `guile-config' before Guile 1.3 was released, to be consistent with
  1768. the analogous script for the GTK+ GUI toolkit, which is called
  1769. `gtk-config'.
  1770. ** Use the GUILE_FLAGS macro in your configure.in file to find Guile.
  1771. If you are using the GNU autoconf package to configure your program,
  1772. you can use the GUILE_FLAGS autoconf macro to call `guile-config'
  1773. (described above) and gather the necessary values for use in your
  1774. Makefiles.
  1775. The GUILE_FLAGS macro expands to configure script code which runs the
  1776. `guile-config' script, to find out where Guile's header files and
  1777. libraries are installed. It sets two variables, marked for
  1778. substitution, as by AC_SUBST.
  1779. GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
  1780. code that uses Guile header files. This is almost always just a
  1781. -I flag.
  1782. GUILE_LDFLAGS --- flags to pass to the linker to link a
  1783. program against Guile. This includes `-lguile' for the Guile
  1784. library itself, any libraries that Guile itself requires (like
  1785. -lqthreads), and so on. It may also include a -L flag to tell the
  1786. compiler where to find the libraries.
  1787. GUILE_FLAGS is defined in the file guile.m4, in the top-level
  1788. directory of the Guile distribution. You can copy it into your
  1789. package's aclocal.m4 file, and then use it in your configure.in file.
  1790. If you are using the `aclocal' program, distributed with GNU automake,
  1791. to maintain your aclocal.m4 file, the Guile installation process
  1792. installs guile.m4 where aclocal will find it. All you need to do is
  1793. use GUILE_FLAGS in your configure.in file, and then run `aclocal';
  1794. this will copy the definition of GUILE_FLAGS into your aclocal.m4
  1795. file.
  1796. * Changes to Scheme functions and syntax
  1797. ** Multi-byte strings have been removed, as have multi-byte and wide
  1798. ports. We felt that these were the wrong approach to
  1799. internationalization support.
  1800. ** New function: readline [PROMPT]
  1801. Read a line from the terminal, and allow the user to edit it,
  1802. prompting with PROMPT. READLINE provides a large set of Emacs-like
  1803. editing commands, lets the user recall previously typed lines, and
  1804. works on almost every kind of terminal, including dumb terminals.
  1805. READLINE assumes that the cursor is at the beginning of the line when
  1806. it is invoked. Thus, you can't print a prompt yourself, and then call
  1807. READLINE; you need to package up your prompt as a string, pass it to
  1808. the function, and let READLINE print the prompt itself. This is
  1809. because READLINE needs to know the prompt's screen width.
  1810. For Guile to provide this function, you must have the readline
  1811. library, version 2.1 or later, installed on your system. Readline is
  1812. available via anonymous FTP from prep.ai.mit.edu in pub/gnu, or from
  1813. any GNU mirror site.
  1814. See also ADD-HISTORY function.
  1815. ** New function: add-history STRING
  1816. Add STRING as the most recent line in the history used by the READLINE
  1817. command. READLINE does not add lines to the history itself; you must
  1818. call ADD-HISTORY to make previous input available to the user.
  1819. ** The behavior of the read-line function has changed.
  1820. This function now uses standard C library functions to read the line,
  1821. for speed. This means that it doesn not respect the value of
  1822. scm-line-incrementors; it assumes that lines are delimited with
  1823. #\newline.
  1824. (Note that this is read-line, the function that reads a line of text
  1825. from a port, not readline, the function that reads a line from a
  1826. terminal, providing full editing capabilities.)
  1827. ** New module (ice-9 getopt-gnu-style): Parse command-line arguments.
  1828. This module provides some simple argument parsing. It exports one
  1829. function:
  1830. Function: getopt-gnu-style ARG-LS
  1831. Parse a list of program arguments into an alist of option
  1832. descriptions.
  1833. Each item in the list of program arguments is examined to see if
  1834. it meets the syntax of a GNU long-named option. An argument like
  1835. `--MUMBLE' produces an element of the form (MUMBLE . #t) in the
  1836. returned alist, where MUMBLE is a keyword object with the same
  1837. name as the argument. An argument like `--MUMBLE=FROB' produces
  1838. an element of the form (MUMBLE . FROB), where FROB is a string.
  1839. As a special case, the returned alist also contains a pair whose
  1840. car is the symbol `rest'. The cdr of this pair is a list
  1841. containing all the items in the argument list that are not options
  1842. of the form mentioned above.
  1843. The argument `--' is treated specially: all items in the argument
  1844. list appearing after such an argument are not examined, and are
  1845. returned in the special `rest' list.
  1846. This function does not parse normal single-character switches.
  1847. You will need to parse them out of the `rest' list yourself.
  1848. ** The read syntax for byte vectors and short vectors has changed.
  1849. Instead of #bytes(...), write #y(...).
  1850. Instead of #short(...), write #h(...).
  1851. This may seem nutty, but, like the other uniform vectors, byte vectors
  1852. and short vectors want to have the same print and read syntax (and,
  1853. more basic, want to have read syntax!). Changing the read syntax to
  1854. use multiple characters after the hash sign breaks with the
  1855. conventions used in R5RS and the conventions used for the other
  1856. uniform vectors. It also introduces complexity in the current reader,
  1857. both on the C and Scheme levels. (The Right solution is probably to
  1858. change the syntax and prototypes for uniform vectors entirely.)
  1859. ** The new module (ice-9 session) provides useful interactive functions.
  1860. *** New procedure: (apropos REGEXP OPTION ...)
  1861. Display a list of top-level variables whose names match REGEXP, and
  1862. the modules they are imported from. Each OPTION should be one of the
  1863. following symbols:
  1864. value --- Show the value of each matching variable.
  1865. shadow --- Show bindings shadowed by subsequently imported modules.
  1866. full --- Same as both `shadow' and `value'.
  1867. For example:
  1868. guile> (apropos "trace" 'full)
  1869. debug: trace #<procedure trace args>
  1870. debug: untrace #<procedure untrace args>
  1871. the-scm-module: display-backtrace #<compiled-closure #<primitive-procedure gsubr-apply>>
  1872. the-scm-module: before-backtrace-hook ()
  1873. the-scm-module: backtrace #<primitive-procedure backtrace>
  1874. the-scm-module: after-backtrace-hook ()
  1875. the-scm-module: has-shown-backtrace-hint? #f
  1876. guile>
  1877. ** There are new functions and syntax for working with macros.
  1878. Guile implements macros as a special object type. Any variable whose
  1879. top-level binding is a macro object acts as a macro. The macro object
  1880. specifies how the expression should be transformed before evaluation.
  1881. *** Macro objects now print in a reasonable way, resembling procedures.
  1882. *** New function: (macro? OBJ)
  1883. True iff OBJ is a macro object.
  1884. *** New function: (primitive-macro? OBJ)
  1885. Like (macro? OBJ), but true only if OBJ is one of the Guile primitive
  1886. macro transformers, implemented in eval.c rather than Scheme code.
  1887. Why do we have this function?
  1888. - For symmetry with procedure? and primitive-procedure?,
  1889. - to allow custom print procedures to tell whether a macro is
  1890. primitive, and display it differently, and
  1891. - to allow compilers and user-written evaluators to distinguish
  1892. builtin special forms from user-defined ones, which could be
  1893. compiled.
  1894. *** New function: (macro-type OBJ)
  1895. Return a value indicating what kind of macro OBJ is. Possible return
  1896. values are:
  1897. The symbol `syntax' --- a macro created by procedure->syntax.
  1898. The symbol `macro' --- a macro created by procedure->macro.
  1899. The symbol `macro!' --- a macro created by procedure->memoizing-macro.
  1900. The boolean #f --- if OBJ is not a macro object.
  1901. *** New function: (macro-name MACRO)
  1902. Return the name of the macro object MACRO's procedure, as returned by
  1903. procedure-name.
  1904. *** New function: (macro-transformer MACRO)
  1905. Return the transformer procedure for MACRO.
  1906. *** New syntax: (use-syntax MODULE ... TRANSFORMER)
  1907. Specify a new macro expander to use in the current module. Each
  1908. MODULE is a module name, with the same meaning as in the `use-modules'
  1909. form; each named module's exported bindings are added to the current
  1910. top-level environment. TRANSFORMER is an expression evaluated in the
  1911. resulting environment which must yield a procedure to use as the
  1912. module's eval transformer: every expression evaluated in this module
  1913. is passed to this function, and the result passed to the Guile
  1914. interpreter.
  1915. *** macro-eval! is removed. Use local-eval instead.
  1916. ** Some magic has been added to the printer to better handle user
  1917. written printing routines (like record printers, closure printers).
  1918. The problem is that these user written routines must have access to
  1919. the current `print-state' to be able to handle fancy things like
  1920. detection of circular references. These print-states have to be
  1921. passed to the builtin printing routines (display, write, etc) to
  1922. properly continue the print chain.
  1923. We didn't want to change all existing print code so that it
  1924. explicitly passes thru a print state in addition to a port. Instead,
  1925. we extented the possible values that the builtin printing routines
  1926. accept as a `port'. In addition to a normal port, they now also take
  1927. a pair of a normal port and a print-state. Printing will go to the
  1928. port and the print-state will be used to control the detection of
  1929. circular references, etc. If the builtin function does not care for a
  1930. print-state, it is simply ignored.
  1931. User written callbacks are now called with such a pair as their
  1932. `port', but because every function now accepts this pair as a PORT
  1933. argument, you don't have to worry about that. In fact, it is probably
  1934. safest to not check for these pairs.
  1935. However, it is sometimes necessary to continue a print chain on a
  1936. different port, for example to get a intermediate string
  1937. representation of the printed value, mangle that string somehow, and
  1938. then to finally print the mangled string. Use the new function
  1939. inherit-print-state OLD-PORT NEW-PORT
  1940. for this. It constructs a new `port' that prints to NEW-PORT but
  1941. inherits the print-state of OLD-PORT.
  1942. ** struct-vtable-offset renamed to vtable-offset-user
  1943. ** New constants: vtable-index-layout, vtable-index-vtable, vtable-index-printer
  1944. ** There is now a fourth (optional) argument to make-vtable-vtable and
  1945. make-struct when constructing new types (vtables). This argument
  1946. initializes field vtable-index-printer of the vtable.
  1947. ** The detection of circular references has been extended to structs.
  1948. That is, a structure that -- in the process of being printed -- prints
  1949. itself does not lead to infinite recursion.
  1950. ** There is now some basic support for fluids. Please read
  1951. "libguile/fluid.h" to find out more. It is accessible from Scheme with
  1952. the following functions and macros:
  1953. Function: make-fluid
  1954. Create a new fluid object. Fluids are not special variables or
  1955. some other extension to the semantics of Scheme, but rather
  1956. ordinary Scheme objects. You can store them into variables (that
  1957. are still lexically scoped, of course) or into any other place you
  1958. like. Every fluid has a initial value of `#f'.
  1959. Function: fluid? OBJ
  1960. Test whether OBJ is a fluid.
  1961. Function: fluid-ref FLUID
  1962. Function: fluid-set! FLUID VAL
  1963. Access/modify the fluid FLUID. Modifications are only visible
  1964. within the current dynamic root (that includes threads).
  1965. Function: with-fluids* FLUIDS VALUES THUNK
  1966. FLUIDS is a list of fluids and VALUES a corresponding list of
  1967. values for these fluids. Before THUNK gets called the values are
  1968. installed in the fluids and the old values of the fluids are
  1969. saved in the VALUES list. When the flow of control leaves THUNK
  1970. or reenters it, the values get swapped again. You might think of
  1971. this as a `safe-fluid-excursion'. Note that the VALUES list is
  1972. modified by `with-fluids*'.
  1973. Macro: with-fluids ((FLUID VALUE) ...) FORM ...
  1974. The same as `with-fluids*' but with a different syntax. It looks
  1975. just like `let', but both FLUID and VALUE are evaluated. Remember,
  1976. fluids are not special variables but ordinary objects. FLUID
  1977. should evaluate to a fluid.
  1978. ** Changes to system call interfaces:
  1979. *** close-port, close-input-port and close-output-port now return a
  1980. boolean instead of an `unspecified' object. #t means that the port
  1981. was successfully closed, while #f means it was already closed. It is
  1982. also now possible for these procedures to raise an exception if an
  1983. error occurs (some errors from write can be delayed until close.)
  1984. *** the first argument to chmod, fcntl, ftell and fseek can now be a
  1985. file descriptor.
  1986. *** the third argument to fcntl is now optional.
  1987. *** the first argument to chown can now be a file descriptor or a port.
  1988. *** the argument to stat can now be a port.
  1989. *** The following new procedures have been added (most use scsh
  1990. interfaces):
  1991. *** procedure: close PORT/FD
  1992. Similar to close-port (*note close-port: Closing Ports.), but also
  1993. works on file descriptors. A side effect of closing a file
  1994. descriptor is that any ports using that file descriptor are moved
  1995. to a different file descriptor and have their revealed counts set
  1996. to zero.
  1997. *** procedure: port->fdes PORT
  1998. Returns the integer file descriptor underlying PORT. As a side
  1999. effect the revealed count of PORT is incremented.
  2000. *** procedure: fdes->ports FDES
  2001. Returns a list of existing ports which have FDES as an underlying
  2002. file descriptor, without changing their revealed counts.
  2003. *** procedure: fdes->inport FDES
  2004. Returns an existing input port which has FDES as its underlying
  2005. file descriptor, if one exists, and increments its revealed count.
  2006. Otherwise, returns a new input port with a revealed count of 1.
  2007. *** procedure: fdes->outport FDES
  2008. Returns an existing output port which has FDES as its underlying
  2009. file descriptor, if one exists, and increments its revealed count.
  2010. Otherwise, returns a new output port with a revealed count of 1.
  2011. The next group of procedures perform a `dup2' system call, if NEWFD
  2012. (an integer) is supplied, otherwise a `dup'. The file descriptor to be
  2013. duplicated can be supplied as an integer or contained in a port. The
  2014. type of value returned varies depending on which procedure is used.
  2015. All procedures also have the side effect when performing `dup2' that
  2016. any ports using NEWFD are moved to a different file descriptor and have
  2017. their revealed counts set to zero.
  2018. *** procedure: dup->fdes PORT/FD [NEWFD]
  2019. Returns an integer file descriptor.
  2020. *** procedure: dup->inport PORT/FD [NEWFD]
  2021. Returns a new input port using the new file descriptor.
  2022. *** procedure: dup->outport PORT/FD [NEWFD]
  2023. Returns a new output port using the new file descriptor.
  2024. *** procedure: dup PORT/FD [NEWFD]
  2025. Returns a new port if PORT/FD is a port, with the same mode as the
  2026. supplied port, otherwise returns an integer file descriptor.
  2027. *** procedure: dup->port PORT/FD MODE [NEWFD]
  2028. Returns a new port using the new file descriptor. MODE supplies a
  2029. mode string for the port (*note open-file: File Ports.).
  2030. *** procedure: setenv NAME VALUE
  2031. Modifies the environment of the current process, which is also the
  2032. default environment inherited by child processes.
  2033. If VALUE is `#f', then NAME is removed from the environment.
  2034. Otherwise, the string NAME=VALUE is added to the environment,
  2035. replacing any existing string with name matching NAME.
  2036. The return value is unspecified.
  2037. *** procedure: truncate-file OBJ SIZE
  2038. Truncates the file referred to by OBJ to at most SIZE bytes. OBJ
  2039. can be a string containing a file name or an integer file
  2040. descriptor or port open for output on the file. The underlying
  2041. system calls are `truncate' and `ftruncate'.
  2042. The return value is unspecified.
  2043. *** procedure: setvbuf PORT MODE [SIZE]
  2044. Set the buffering mode for PORT. MODE can be:
  2045. `_IONBF'
  2046. non-buffered
  2047. `_IOLBF'
  2048. line buffered
  2049. `_IOFBF'
  2050. block buffered, using a newly allocated buffer of SIZE bytes.
  2051. However if SIZE is zero or unspecified, the port will be made
  2052. non-buffered.
  2053. This procedure should not be used after I/O has been performed with
  2054. the port.
  2055. Ports are usually block buffered by default, with a default buffer
  2056. size. Procedures e.g., *Note open-file: File Ports, which accept a
  2057. mode string allow `0' to be added to request an unbuffered port.
  2058. *** procedure: fsync PORT/FD
  2059. Copies any unwritten data for the specified output file descriptor
  2060. to disk. If PORT/FD is a port, its buffer is flushed before the
  2061. underlying file descriptor is fsync'd. The return value is
  2062. unspecified.
  2063. *** procedure: open-fdes PATH FLAGS [MODES]
  2064. Similar to `open' but returns a file descriptor instead of a port.
  2065. *** procedure: execle PATH ENV [ARG] ...
  2066. Similar to `execl', but the environment of the new process is
  2067. specified by ENV, which must be a list of strings as returned by
  2068. the `environ' procedure.
  2069. This procedure is currently implemented using the `execve' system
  2070. call, but we call it `execle' because of its Scheme calling
  2071. interface.
  2072. *** procedure: strerror ERRNO
  2073. Returns the Unix error message corresponding to ERRNO, an integer.
  2074. *** procedure: primitive-exit [STATUS]
  2075. Terminate the current process without unwinding the Scheme stack.
  2076. This is would typically be useful after a fork. The exit status
  2077. is STATUS if supplied, otherwise zero.
  2078. *** procedure: times
  2079. Returns an object with information about real and processor time.
  2080. The following procedures accept such an object as an argument and
  2081. return a selected component:
  2082. `tms:clock'
  2083. The current real time, expressed as time units relative to an
  2084. arbitrary base.
  2085. `tms:utime'
  2086. The CPU time units used by the calling process.
  2087. `tms:stime'
  2088. The CPU time units used by the system on behalf of the
  2089. calling process.
  2090. `tms:cutime'
  2091. The CPU time units used by terminated child processes of the
  2092. calling process, whose status has been collected (e.g., using
  2093. `waitpid').
  2094. `tms:cstime'
  2095. Similarly, the CPU times units used by the system on behalf of
  2096. terminated child processes.
  2097. ** Removed: list-length
  2098. ** Removed: list-append, list-append!
  2099. ** Removed: list-reverse, list-reverse!
  2100. ** array-map renamed to array-map!
  2101. ** serial-array-map renamed to serial-array-map!
  2102. ** catch doesn't take #f as first argument any longer
  2103. Previously, it was possible to pass #f instead of a key to `catch'.
  2104. That would cause `catch' to pass a jump buffer object to the procedure
  2105. passed as second argument. The procedure could then use this jump
  2106. buffer objekt as an argument to throw.
  2107. This mechanism has been removed since its utility doesn't motivate the
  2108. extra complexity it introduces.
  2109. ** The `#/' notation for lists now provokes a warning message from Guile.
  2110. This syntax will be removed from Guile in the near future.
  2111. To disable the warning message, set the GUILE_HUSH environment
  2112. variable to any non-empty value.
  2113. ** The newline character now prints as `#\newline', following the
  2114. normal Scheme notation, not `#\nl'.
  2115. * Changes to the gh_ interface
  2116. ** The gh_enter function now takes care of loading the Guile startup files.
  2117. gh_enter works by calling scm_boot_guile; see the remarks below.
  2118. ** Function: void gh_write (SCM x)
  2119. Write the printed representation of the scheme object x to the current
  2120. output port. Corresponds to the scheme level `write'.
  2121. ** gh_list_length renamed to gh_length.
  2122. ** vector handling routines
  2123. Several major changes. In particular, gh_vector() now resembles
  2124. (vector ...) (with a caveat -- see manual), and gh_make_vector() now
  2125. exists and behaves like (make-vector ...). gh_vset() and gh_vref()
  2126. have been renamed gh_vector_set_x() and gh_vector_ref(). Some missing
  2127. vector-related gh_ functions have been implemented.
  2128. ** pair and list routines
  2129. Implemented several of the R4RS pair and list functions that were
  2130. missing.
  2131. ** gh_scm2doubles, gh_doubles2scm, gh_doubles2dvect
  2132. New function. Converts double arrays back and forth between Scheme
  2133. and C.
  2134. * Changes to the scm_ interface
  2135. ** The function scm_boot_guile now takes care of loading the startup files.
  2136. Guile's primary initialization function, scm_boot_guile, now takes
  2137. care of loading `boot-9.scm', in the `ice-9' module, to initialize
  2138. Guile, define the module system, and put together some standard
  2139. bindings. It also loads `init.scm', which is intended to hold
  2140. site-specific initialization code.
  2141. Since Guile cannot operate properly until boot-9.scm is loaded, there
  2142. is no reason to separate loading boot-9.scm from Guile's other
  2143. initialization processes.
  2144. This job used to be done by scm_compile_shell_switches, which didn't
  2145. make much sense; in particular, it meant that people using Guile for
  2146. non-shell-like applications had to jump through hoops to get Guile
  2147. initialized properly.
  2148. ** The function scm_compile_shell_switches no longer loads the startup files.
  2149. Now, Guile always loads the startup files, whenever it is initialized;
  2150. see the notes above for scm_boot_guile and scm_load_startup_files.
  2151. ** Function: scm_load_startup_files
  2152. This new function takes care of loading Guile's initialization file
  2153. (`boot-9.scm'), and the site initialization file, `init.scm'. Since
  2154. this is always called by the Guile initialization process, it's
  2155. probably not too useful to call this yourself, but it's there anyway.
  2156. ** The semantics of smob marking have changed slightly.
  2157. The smob marking function (the `mark' member of the scm_smobfuns
  2158. structure) is no longer responsible for setting the mark bit on the
  2159. smob. The generic smob handling code in the garbage collector will
  2160. set this bit. The mark function need only ensure that any other
  2161. objects the smob refers to get marked.
  2162. Note that this change means that the smob's GC8MARK bit is typically
  2163. already set upon entry to the mark function. Thus, marking functions
  2164. which look like this:
  2165. {
  2166. if (SCM_GC8MARKP (ptr))
  2167. return SCM_BOOL_F;
  2168. SCM_SETGC8MARK (ptr);
  2169. ... mark objects to which the smob refers ...
  2170. }
  2171. are now incorrect, since they will return early, and fail to mark any
  2172. other objects the smob refers to. Some code in the Guile library used
  2173. to work this way.
  2174. ** The semantics of the I/O port functions in scm_ptobfuns have changed.
  2175. If you have implemented your own I/O port type, by writing the
  2176. functions required by the scm_ptobfuns and then calling scm_newptob,
  2177. you will need to change your functions slightly.
  2178. The functions in a scm_ptobfuns structure now expect the port itself
  2179. as their argument; they used to expect the `stream' member of the
  2180. port's scm_port_table structure. This allows functions in an
  2181. scm_ptobfuns structure to easily access the port's cell (and any flags
  2182. it its CAR), and the port's scm_port_table structure.
  2183. Guile now passes the I/O port itself as the `port' argument in the
  2184. following scm_ptobfuns functions:
  2185. int (*free) (SCM port);
  2186. int (*fputc) (int, SCM port);
  2187. int (*fputs) (char *, SCM port);
  2188. scm_sizet (*fwrite) SCM_P ((char *ptr,
  2189. scm_sizet size,
  2190. scm_sizet nitems,
  2191. SCM port));
  2192. int (*fflush) (SCM port);
  2193. int (*fgetc) (SCM port);
  2194. int (*fclose) (SCM port);
  2195. The interfaces to the `mark', `print', `equalp', and `fgets' methods
  2196. are unchanged.
  2197. If you have existing code which defines its own port types, it is easy
  2198. to convert your code to the new interface; simply apply SCM_STREAM to
  2199. the port argument to yield the value you code used to expect.
  2200. Note that since both the port and the stream have the same type in the
  2201. C code --- they are both SCM values --- the C compiler will not remind
  2202. you if you forget to update your scm_ptobfuns functions.
  2203. ** Function: int scm_internal_select (int fds,
  2204. SELECT_TYPE *rfds,
  2205. SELECT_TYPE *wfds,
  2206. SELECT_TYPE *efds,
  2207. struct timeval *timeout);
  2208. This is a replacement for the `select' function provided by the OS.
  2209. It enables I/O blocking and sleeping to happen for one cooperative
  2210. thread without blocking other threads. It also avoids busy-loops in
  2211. these situations. It is intended that all I/O blocking and sleeping
  2212. will finally go through this function. Currently, this function is
  2213. only available on systems providing `gettimeofday' and `select'.
  2214. ** Function: SCM scm_internal_stack_catch (SCM tag,
  2215. scm_catch_body_t body,
  2216. void *body_data,
  2217. scm_catch_handler_t handler,
  2218. void *handler_data)
  2219. A new sibling to the other two C level `catch' functions
  2220. scm_internal_catch and scm_internal_lazy_catch. Use it if you want
  2221. the stack to be saved automatically into the variable `the-last-stack'
  2222. (scm_the_last_stack_var) on error. This is necessary if you want to
  2223. use advanced error reporting, such as calling scm_display_error and
  2224. scm_display_backtrace. (They both take a stack object as argument.)
  2225. ** Function: SCM scm_spawn_thread (scm_catch_body_t body,
  2226. void *body_data,
  2227. scm_catch_handler_t handler,
  2228. void *handler_data)
  2229. Spawns a new thread. It does a job similar to
  2230. scm_call_with_new_thread but takes arguments more suitable when
  2231. spawning threads from application C code.
  2232. ** The hook scm_error_callback has been removed. It was originally
  2233. intended as a way for the user to install his own error handler. But
  2234. that method works badly since it intervenes between throw and catch,
  2235. thereby changing the semantics of expressions like (catch #t ...).
  2236. The correct way to do it is to use one of the C level catch functions
  2237. in throw.c: scm_internal_catch/lazy_catch/stack_catch.
  2238. ** Removed functions:
  2239. scm_obj_length, scm_list_length, scm_list_append, scm_list_append_x,
  2240. scm_list_reverse, scm_list_reverse_x
  2241. ** New macros: SCM_LISTn where n is one of the integers 0-9.
  2242. These can be used for pretty list creation from C. The idea is taken
  2243. from Erick Gallesio's STk.
  2244. ** scm_array_map renamed to scm_array_map_x
  2245. ** mbstrings are now removed
  2246. This means that the type codes scm_tc7_mb_string and
  2247. scm_tc7_mb_substring has been removed.
  2248. ** scm_gen_putc, scm_gen_puts, scm_gen_write, and scm_gen_getc have changed.
  2249. Since we no longer support multi-byte strings, these I/O functions
  2250. have been simplified, and renamed. Here are their old names, and
  2251. their new names and arguments:
  2252. scm_gen_putc -> void scm_putc (int c, SCM port);
  2253. scm_gen_puts -> void scm_puts (char *s, SCM port);
  2254. scm_gen_write -> void scm_lfwrite (char *ptr, scm_sizet size, SCM port);
  2255. scm_gen_getc -> void scm_getc (SCM port);
  2256. ** The macros SCM_TYP7D and SCM_TYP7SD has been removed.
  2257. ** The macro SCM_TYP7S has taken the role of the old SCM_TYP7D
  2258. SCM_TYP7S now masks away the bit which distinguishes substrings from
  2259. strings.
  2260. ** scm_catch_body_t: Backward incompatible change!
  2261. Body functions to scm_internal_catch and friends do not any longer
  2262. take a second argument. This is because it is no longer possible to
  2263. pass a #f arg to catch.
  2264. ** Calls to scm_protect_object and scm_unprotect now nest properly.
  2265. The function scm_protect_object protects its argument from being freed
  2266. by the garbage collector. scm_unprotect_object removes that
  2267. protection.
  2268. These functions now nest properly. That is, for every object O, there
  2269. is a counter which scm_protect_object(O) increments and
  2270. scm_unprotect_object(O) decrements, if the counter is greater than
  2271. zero. Every object's counter is zero when it is first created. If an
  2272. object's counter is greater than zero, the garbage collector will not
  2273. reclaim its storage.
  2274. This allows you to use scm_protect_object in your code without
  2275. worrying that some other function you call will call
  2276. scm_unprotect_object, and allow it to be freed. Assuming that the
  2277. functions you call are well-behaved, and unprotect only those objects
  2278. they protect, you can follow the same rule and have confidence that
  2279. objects will be freed only at appropriate times.
  2280. Changes in Guile 1.2 (released Tuesday, June 24 1997):
  2281. * Changes to the distribution
  2282. ** Nightly snapshots are now available from ftp.red-bean.com.
  2283. The old server, ftp.cyclic.com, has been relinquished to its rightful
  2284. owner.
  2285. Nightly snapshots of the Guile development sources are now available via
  2286. anonymous FTP from ftp.red-bean.com, as /pub/guile/guile-snap.tar.gz.
  2287. Via the web, that's: ftp://ftp.red-bean.com/pub/guile/guile-snap.tar.gz
  2288. For getit, that's: ftp.red-bean.com:/pub/guile/guile-snap.tar.gz
  2289. ** To run Guile without installing it, the procedure has changed a bit.
  2290. If you used a separate build directory to compile Guile, you'll need
  2291. to include the build directory in SCHEME_LOAD_PATH, as well as the
  2292. source directory. See the `INSTALL' file for examples.
  2293. * Changes to the procedure for linking libguile with your programs
  2294. ** The standard Guile load path for Scheme code now includes
  2295. $(datadir)/guile (usually /usr/local/share/guile). This means that
  2296. you can install your own Scheme files there, and Guile will find them.
  2297. (Previous versions of Guile only checked a directory whose name
  2298. contained the Guile version number, so you had to re-install or move
  2299. your Scheme sources each time you installed a fresh version of Guile.)
  2300. The load path also includes $(datadir)/guile/site; we recommend
  2301. putting individual Scheme files there. If you want to install a
  2302. package with multiple source files, create a directory for them under
  2303. $(datadir)/guile.
  2304. ** Guile 1.2 will now use the Rx regular expression library, if it is
  2305. installed on your system. When you are linking libguile into your own
  2306. programs, this means you will have to link against -lguile, -lqt (if
  2307. you configured Guile with thread support), and -lrx.
  2308. If you are using autoconf to generate configuration scripts for your
  2309. application, the following lines should suffice to add the appropriate
  2310. libraries to your link command:
  2311. ### Find Rx, quickthreads and libguile.
  2312. AC_CHECK_LIB(rx, main)
  2313. AC_CHECK_LIB(qt, main)
  2314. AC_CHECK_LIB(guile, scm_shell)
  2315. The Guile 1.2 distribution does not contain sources for the Rx
  2316. library, as Guile 1.0 did. If you want to use Rx, you'll need to
  2317. retrieve it from a GNU FTP site and install it separately.
  2318. * Changes to Scheme functions and syntax
  2319. ** The dynamic linking features of Guile are now enabled by default.
  2320. You can disable them by giving the `--disable-dynamic-linking' option
  2321. to configure.
  2322. (dynamic-link FILENAME)
  2323. Find the object file denoted by FILENAME (a string) and link it
  2324. into the running Guile application. When everything works out,
  2325. return a Scheme object suitable for representing the linked object
  2326. file. Otherwise an error is thrown. How object files are
  2327. searched is system dependent.
  2328. (dynamic-object? VAL)
  2329. Determine whether VAL represents a dynamically linked object file.
  2330. (dynamic-unlink DYNOBJ)
  2331. Unlink the indicated object file from the application. DYNOBJ
  2332. should be one of the values returned by `dynamic-link'.
  2333. (dynamic-func FUNCTION DYNOBJ)
  2334. Search the C function indicated by FUNCTION (a string or symbol)
  2335. in DYNOBJ and return some Scheme object that can later be used
  2336. with `dynamic-call' to actually call this function. Right now,
  2337. these Scheme objects are formed by casting the address of the
  2338. function to `long' and converting this number to its Scheme
  2339. representation.
  2340. (dynamic-call FUNCTION DYNOBJ)
  2341. Call the C function indicated by FUNCTION and DYNOBJ. The
  2342. function is passed no arguments and its return value is ignored.
  2343. When FUNCTION is something returned by `dynamic-func', call that
  2344. function and ignore DYNOBJ. When FUNCTION is a string (or symbol,
  2345. etc.), look it up in DYNOBJ; this is equivalent to
  2346. (dynamic-call (dynamic-func FUNCTION DYNOBJ) #f)
  2347. Interrupts are deferred while the C function is executing (with
  2348. SCM_DEFER_INTS/SCM_ALLOW_INTS).
  2349. (dynamic-args-call FUNCTION DYNOBJ ARGS)
  2350. Call the C function indicated by FUNCTION and DYNOBJ, but pass it
  2351. some arguments and return its return value. The C function is
  2352. expected to take two arguments and return an `int', just like
  2353. `main':
  2354. int c_func (int argc, char **argv);
  2355. ARGS must be a list of strings and is converted into an array of
  2356. `char *'. The array is passed in ARGV and its size in ARGC. The
  2357. return value is converted to a Scheme number and returned from the
  2358. call to `dynamic-args-call'.
  2359. When dynamic linking is disabled or not supported on your system,
  2360. the above functions throw errors, but they are still available.
  2361. Here is a small example that works on GNU/Linux:
  2362. (define libc-obj (dynamic-link "libc.so"))
  2363. (dynamic-args-call 'rand libc-obj '())
  2364. See the file `libguile/DYNAMIC-LINKING' for additional comments.
  2365. ** The #/ syntax for module names is depreciated, and will be removed
  2366. in a future version of Guile. Instead of
  2367. #/foo/bar/baz
  2368. instead write
  2369. (foo bar baz)
  2370. The latter syntax is more consistent with existing Lisp practice.
  2371. ** Guile now does fancier printing of structures. Structures are the
  2372. underlying implementation for records, which in turn are used to
  2373. implement modules, so all of these object now print differently and in
  2374. a more informative way.
  2375. The Scheme printer will examine the builtin variable *struct-printer*
  2376. whenever it needs to print a structure object. When this variable is
  2377. not `#f' it is deemed to be a procedure and will be applied to the
  2378. structure object and the output port. When *struct-printer* is `#f'
  2379. or the procedure return `#f' the structure object will be printed in
  2380. the boring #<struct 80458270> form.
  2381. This hook is used by some routines in ice-9/boot-9.scm to implement
  2382. type specific printing routines. Please read the comments there about
  2383. "printing structs".
  2384. One of the more specific uses of structs are records. The printing
  2385. procedure that could be passed to MAKE-RECORD-TYPE is now actually
  2386. called. It should behave like a *struct-printer* procedure (described
  2387. above).
  2388. ** Guile now supports a new R4RS-compliant syntax for keywords. A
  2389. token of the form #:NAME, where NAME has the same syntax as a Scheme
  2390. symbol, is the external representation of the keyword named NAME.
  2391. Keyword objects print using this syntax as well, so values containing
  2392. keyword objects can be read back into Guile. When used in an
  2393. expression, keywords are self-quoting objects.
  2394. Guile suports this read syntax, and uses this print syntax, regardless
  2395. of the current setting of the `keyword' read option. The `keyword'
  2396. read option only controls whether Guile recognizes the `:NAME' syntax,
  2397. which is incompatible with R4RS. (R4RS says such token represent
  2398. symbols.)
  2399. ** Guile has regular expression support again. Guile 1.0 included
  2400. functions for matching regular expressions, based on the Rx library.
  2401. In Guile 1.1, the Guile/Rx interface was removed to simplify the
  2402. distribution, and thus Guile had no regular expression support. Guile
  2403. 1.2 again supports the most commonly used functions, and supports all
  2404. of SCSH's regular expression functions.
  2405. If your system does not include a POSIX regular expression library,
  2406. and you have not linked Guile with a third-party regexp library such as
  2407. Rx, these functions will not be available. You can tell whether your
  2408. Guile installation includes regular expression support by checking
  2409. whether the `*features*' list includes the `regex' symbol.
  2410. *** regexp functions
  2411. By default, Guile supports POSIX extended regular expressions. That
  2412. means that the characters `(', `)', `+' and `?' are special, and must
  2413. be escaped if you wish to match the literal characters.
  2414. This regular expression interface was modeled after that implemented
  2415. by SCSH, the Scheme Shell. It is intended to be upwardly compatible
  2416. with SCSH regular expressions.
  2417. **** Function: string-match PATTERN STR [START]
  2418. Compile the string PATTERN into a regular expression and compare
  2419. it with STR. The optional numeric argument START specifies the
  2420. position of STR at which to begin matching.
  2421. `string-match' returns a "match structure" which describes what,
  2422. if anything, was matched by the regular expression. *Note Match
  2423. Structures::. If STR does not match PATTERN at all,
  2424. `string-match' returns `#f'.
  2425. Each time `string-match' is called, it must compile its PATTERN
  2426. argument into a regular expression structure. This operation is
  2427. expensive, which makes `string-match' inefficient if the same regular
  2428. expression is used several times (for example, in a loop). For better
  2429. performance, you can compile a regular expression in advance and then
  2430. match strings against the compiled regexp.
  2431. **** Function: make-regexp STR [FLAGS]
  2432. Compile the regular expression described by STR, and return the
  2433. compiled regexp structure. If STR does not describe a legal
  2434. regular expression, `make-regexp' throws a
  2435. `regular-expression-syntax' error.
  2436. FLAGS may be the bitwise-or of one or more of the following:
  2437. **** Constant: regexp/extended
  2438. Use POSIX Extended Regular Expression syntax when interpreting
  2439. STR. If not set, POSIX Basic Regular Expression syntax is used.
  2440. If the FLAGS argument is omitted, we assume regexp/extended.
  2441. **** Constant: regexp/icase
  2442. Do not differentiate case. Subsequent searches using the
  2443. returned regular expression will be case insensitive.
  2444. **** Constant: regexp/newline
  2445. Match-any-character operators don't match a newline.
  2446. A non-matching list ([^...]) not containing a newline matches a
  2447. newline.
  2448. Match-beginning-of-line operator (^) matches the empty string
  2449. immediately after a newline, regardless of whether the FLAGS
  2450. passed to regexp-exec contain regexp/notbol.
  2451. Match-end-of-line operator ($) matches the empty string
  2452. immediately before a newline, regardless of whether the FLAGS
  2453. passed to regexp-exec contain regexp/noteol.
  2454. **** Function: regexp-exec REGEXP STR [START [FLAGS]]
  2455. Match the compiled regular expression REGEXP against `str'. If
  2456. the optional integer START argument is provided, begin matching
  2457. from that position in the string. Return a match structure
  2458. describing the results of the match, or `#f' if no match could be
  2459. found.
  2460. FLAGS may be the bitwise-or of one or more of the following:
  2461. **** Constant: regexp/notbol
  2462. The match-beginning-of-line operator always fails to match (but
  2463. see the compilation flag regexp/newline above) This flag may be
  2464. used when different portions of a string are passed to
  2465. regexp-exec and the beginning of the string should not be
  2466. interpreted as the beginning of the line.
  2467. **** Constant: regexp/noteol
  2468. The match-end-of-line operator always fails to match (but see the
  2469. compilation flag regexp/newline above)
  2470. **** Function: regexp? OBJ
  2471. Return `#t' if OBJ is a compiled regular expression, or `#f'
  2472. otherwise.
  2473. Regular expressions are commonly used to find patterns in one string
  2474. and replace them with the contents of another string.
  2475. **** Function: regexp-substitute PORT MATCH [ITEM...]
  2476. Write to the output port PORT selected contents of the match
  2477. structure MATCH. Each ITEM specifies what should be written, and
  2478. may be one of the following arguments:
  2479. * A string. String arguments are written out verbatim.
  2480. * An integer. The submatch with that number is written.
  2481. * The symbol `pre'. The portion of the matched string preceding
  2482. the regexp match is written.
  2483. * The symbol `post'. The portion of the matched string
  2484. following the regexp match is written.
  2485. PORT may be `#f', in which case nothing is written; instead,
  2486. `regexp-substitute' constructs a string from the specified ITEMs
  2487. and returns that.
  2488. **** Function: regexp-substitute/global PORT REGEXP TARGET [ITEM...]
  2489. Similar to `regexp-substitute', but can be used to perform global
  2490. substitutions on STR. Instead of taking a match structure as an
  2491. argument, `regexp-substitute/global' takes two string arguments: a
  2492. REGEXP string describing a regular expression, and a TARGET string
  2493. which should be matched against this regular expression.
  2494. Each ITEM behaves as in REGEXP-SUBSTITUTE, with the following
  2495. exceptions:
  2496. * A function may be supplied. When this function is called, it
  2497. will be passed one argument: a match structure for a given
  2498. regular expression match. It should return a string to be
  2499. written out to PORT.
  2500. * The `post' symbol causes `regexp-substitute/global' to recurse
  2501. on the unmatched portion of STR. This *must* be supplied in
  2502. order to perform global search-and-replace on STR; if it is
  2503. not present among the ITEMs, then `regexp-substitute/global'
  2504. will return after processing a single match.
  2505. *** Match Structures
  2506. A "match structure" is the object returned by `string-match' and
  2507. `regexp-exec'. It describes which portion of a string, if any, matched
  2508. the given regular expression. Match structures include: a reference to
  2509. the string that was checked for matches; the starting and ending
  2510. positions of the regexp match; and, if the regexp included any
  2511. parenthesized subexpressions, the starting and ending positions of each
  2512. submatch.
  2513. In each of the regexp match functions described below, the `match'
  2514. argument must be a match structure returned by a previous call to
  2515. `string-match' or `regexp-exec'. Most of these functions return some
  2516. information about the original target string that was matched against a
  2517. regular expression; we will call that string TARGET for easy reference.
  2518. **** Function: regexp-match? OBJ
  2519. Return `#t' if OBJ is a match structure returned by a previous
  2520. call to `regexp-exec', or `#f' otherwise.
  2521. **** Function: match:substring MATCH [N]
  2522. Return the portion of TARGET matched by subexpression number N.
  2523. Submatch 0 (the default) represents the entire regexp match. If
  2524. the regular expression as a whole matched, but the subexpression
  2525. number N did not match, return `#f'.
  2526. **** Function: match:start MATCH [N]
  2527. Return the starting position of submatch number N.
  2528. **** Function: match:end MATCH [N]
  2529. Return the ending position of submatch number N.
  2530. **** Function: match:prefix MATCH
  2531. Return the unmatched portion of TARGET preceding the regexp match.
  2532. **** Function: match:suffix MATCH
  2533. Return the unmatched portion of TARGET following the regexp match.
  2534. **** Function: match:count MATCH
  2535. Return the number of parenthesized subexpressions from MATCH.
  2536. Note that the entire regular expression match itself counts as a
  2537. subexpression, and failed submatches are included in the count.
  2538. **** Function: match:string MATCH
  2539. Return the original TARGET string.
  2540. *** Backslash Escapes
  2541. Sometimes you will want a regexp to match characters like `*' or `$'
  2542. exactly. For example, to check whether a particular string represents
  2543. a menu entry from an Info node, it would be useful to match it against
  2544. a regexp like `^* [^:]*::'. However, this won't work; because the
  2545. asterisk is a metacharacter, it won't match the `*' at the beginning of
  2546. the string. In this case, we want to make the first asterisk un-magic.
  2547. You can do this by preceding the metacharacter with a backslash
  2548. character `\'. (This is also called "quoting" the metacharacter, and
  2549. is known as a "backslash escape".) When Guile sees a backslash in a
  2550. regular expression, it considers the following glyph to be an ordinary
  2551. character, no matter what special meaning it would ordinarily have.
  2552. Therefore, we can make the above example work by changing the regexp to
  2553. `^\* [^:]*::'. The `\*' sequence tells the regular expression engine
  2554. to match only a single asterisk in the target string.
  2555. Since the backslash is itself a metacharacter, you may force a
  2556. regexp to match a backslash in the target string by preceding the
  2557. backslash with itself. For example, to find variable references in a
  2558. TeX program, you might want to find occurrences of the string `\let\'
  2559. followed by any number of alphabetic characters. The regular expression
  2560. `\\let\\[A-Za-z]*' would do this: the double backslashes in the regexp
  2561. each match a single backslash in the target string.
  2562. **** Function: regexp-quote STR
  2563. Quote each special character found in STR with a backslash, and
  2564. return the resulting string.
  2565. *Very important:* Using backslash escapes in Guile source code (as
  2566. in Emacs Lisp or C) can be tricky, because the backslash character has
  2567. special meaning for the Guile reader. For example, if Guile encounters
  2568. the character sequence `\n' in the middle of a string while processing
  2569. Scheme code, it replaces those characters with a newline character.
  2570. Similarly, the character sequence `\t' is replaced by a horizontal tab.
  2571. Several of these "escape sequences" are processed by the Guile reader
  2572. before your code is executed. Unrecognized escape sequences are
  2573. ignored: if the characters `\*' appear in a string, they will be
  2574. translated to the single character `*'.
  2575. This translation is obviously undesirable for regular expressions,
  2576. since we want to be able to include backslashes in a string in order to
  2577. escape regexp metacharacters. Therefore, to make sure that a backslash
  2578. is preserved in a string in your Guile program, you must use *two*
  2579. consecutive backslashes:
  2580. (define Info-menu-entry-pattern (make-regexp "^\\* [^:]*"))
  2581. The string in this example is preprocessed by the Guile reader before
  2582. any code is executed. The resulting argument to `make-regexp' is the
  2583. string `^\* [^:]*', which is what we really want.
  2584. This also means that in order to write a regular expression that
  2585. matches a single backslash character, the regular expression string in
  2586. the source code must include *four* backslashes. Each consecutive pair
  2587. of backslashes gets translated by the Guile reader to a single
  2588. backslash, and the resulting double-backslash is interpreted by the
  2589. regexp engine as matching a single backslash character. Hence:
  2590. (define tex-variable-pattern (make-regexp "\\\\let\\\\=[A-Za-z]*"))
  2591. The reason for the unwieldiness of this syntax is historical. Both
  2592. regular expression pattern matchers and Unix string processing systems
  2593. have traditionally used backslashes with the special meanings described
  2594. above. The POSIX regular expression specification and ANSI C standard
  2595. both require these semantics. Attempting to abandon either convention
  2596. would cause other kinds of compatibility problems, possibly more severe
  2597. ones. Therefore, without extending the Scheme reader to support
  2598. strings with different quoting conventions (an ungainly and confusing
  2599. extension when implemented in other languages), we must adhere to this
  2600. cumbersome escape syntax.
  2601. * Changes to the gh_ interface
  2602. * Changes to the scm_ interface
  2603. * Changes to system call interfaces:
  2604. ** The value returned by `raise' is now unspecified. It throws an exception
  2605. if an error occurs.
  2606. *** A new procedure `sigaction' can be used to install signal handlers
  2607. (sigaction signum [action] [flags])
  2608. signum is the signal number, which can be specified using the value
  2609. of SIGINT etc.
  2610. If action is omitted, sigaction returns a pair: the CAR is the current
  2611. signal hander, which will be either an integer with the value SIG_DFL
  2612. (default action) or SIG_IGN (ignore), or the Scheme procedure which
  2613. handles the signal, or #f if a non-Scheme procedure handles the
  2614. signal. The CDR contains the current sigaction flags for the handler.
  2615. If action is provided, it is installed as the new handler for signum.
  2616. action can be a Scheme procedure taking one argument, or the value of
  2617. SIG_DFL (default action) or SIG_IGN (ignore), or #f to restore
  2618. whatever signal handler was installed before sigaction was first used.
  2619. Flags can optionally be specified for the new handler (SA_RESTART is
  2620. always used if the system provides it, so need not be specified.) The
  2621. return value is a pair with information about the old handler as
  2622. described above.
  2623. This interface does not provide access to the "signal blocking"
  2624. facility. Maybe this is not needed, since the thread support may
  2625. provide solutions to the problem of consistent access to data
  2626. structures.
  2627. *** A new procedure `flush-all-ports' is equivalent to running
  2628. `force-output' on every port open for output.
  2629. ** Guile now provides information on how it was built, via the new
  2630. global variable, %guile-build-info. This variable records the values
  2631. of the standard GNU makefile directory variables as an assocation
  2632. list, mapping variable names (symbols) onto directory paths (strings).
  2633. For example, to find out where the Guile link libraries were
  2634. installed, you can say:
  2635. guile -c "(display (assq-ref %guile-build-info 'libdir)) (newline)"
  2636. * Changes to the scm_ interface
  2637. ** The new function scm_handle_by_message_noexit is just like the
  2638. existing scm_handle_by_message function, except that it doesn't call
  2639. exit to terminate the process. Instead, it prints a message and just
  2640. returns #f. This might be a more appropriate catch-all handler for
  2641. new dynamic roots and threads.
  2642. Changes in Guile 1.1 (released Friday, May 16 1997):
  2643. * Changes to the distribution.
  2644. The Guile 1.0 distribution has been split up into several smaller
  2645. pieces:
  2646. guile-core --- the Guile interpreter itself.
  2647. guile-tcltk --- the interface between the Guile interpreter and
  2648. Tcl/Tk; Tcl is an interpreter for a stringy language, and Tk
  2649. is a toolkit for building graphical user interfaces.
  2650. guile-rgx-ctax --- the interface between Guile and the Rx regular
  2651. expression matcher, and the translator for the Ctax
  2652. programming language. These are packaged together because the
  2653. Ctax translator uses Rx to parse Ctax source code.
  2654. This NEWS file describes the changes made to guile-core since the 1.0
  2655. release.
  2656. We no longer distribute the documentation, since it was either out of
  2657. date, or incomplete. As soon as we have current documentation, we
  2658. will distribute it.
  2659. * Changes to the stand-alone interpreter
  2660. ** guile now accepts command-line arguments compatible with SCSH, Olin
  2661. Shivers' Scheme Shell.
  2662. In general, arguments are evaluated from left to right, but there are
  2663. exceptions. The following switches stop argument processing, and
  2664. stash all remaining command-line arguments as the value returned by
  2665. the (command-line) function.
  2666. -s SCRIPT load Scheme source code from FILE, and exit
  2667. -c EXPR evalute Scheme expression EXPR, and exit
  2668. -- stop scanning arguments; run interactively
  2669. The switches below are processed as they are encountered.
  2670. -l FILE load Scheme source code from FILE
  2671. -e FUNCTION after reading script, apply FUNCTION to
  2672. command line arguments
  2673. -ds do -s script at this point
  2674. --emacs enable Emacs protocol (experimental)
  2675. -h, --help display this help and exit
  2676. -v, --version display version information and exit
  2677. \ read arguments from following script lines
  2678. So, for example, here is a Guile script named `ekko' (thanks, Olin)
  2679. which re-implements the traditional "echo" command:
  2680. #!/usr/local/bin/guile -s
  2681. !#
  2682. (define (main args)
  2683. (map (lambda (arg) (display arg) (display " "))
  2684. (cdr args))
  2685. (newline))
  2686. (main (command-line))
  2687. Suppose we invoke this script as follows:
  2688. ekko a speckled gecko
  2689. Through the magic of Unix script processing (triggered by the `#!'
  2690. token at the top of the file), /usr/local/bin/guile receives the
  2691. following list of command-line arguments:
  2692. ("-s" "./ekko" "a" "speckled" "gecko")
  2693. Unix inserts the name of the script after the argument specified on
  2694. the first line of the file (in this case, "-s"), and then follows that
  2695. with the arguments given to the script. Guile loads the script, which
  2696. defines the `main' function, and then applies it to the list of
  2697. remaining command-line arguments, ("a" "speckled" "gecko").
  2698. In Unix, the first line of a script file must take the following form:
  2699. #!INTERPRETER ARGUMENT
  2700. where INTERPRETER is the absolute filename of the interpreter
  2701. executable, and ARGUMENT is a single command-line argument to pass to
  2702. the interpreter.
  2703. You may only pass one argument to the interpreter, and its length is
  2704. limited. These restrictions can be annoying to work around, so Guile
  2705. provides a general mechanism (borrowed from, and compatible with,
  2706. SCSH) for circumventing them.
  2707. If the ARGUMENT in a Guile script is a single backslash character,
  2708. `\', Guile will open the script file, parse arguments from its second
  2709. and subsequent lines, and replace the `\' with them. So, for example,
  2710. here is another implementation of the `ekko' script:
  2711. #!/usr/local/bin/guile \
  2712. -e main -s
  2713. !#
  2714. (define (main args)
  2715. (for-each (lambda (arg) (display arg) (display " "))
  2716. (cdr args))
  2717. (newline))
  2718. If the user invokes this script as follows:
  2719. ekko a speckled gecko
  2720. Unix expands this into
  2721. /usr/local/bin/guile \ ekko a speckled gecko
  2722. When Guile sees the `\' argument, it replaces it with the arguments
  2723. read from the second line of the script, producing:
  2724. /usr/local/bin/guile -e main -s ekko a speckled gecko
  2725. This tells Guile to load the `ekko' script, and apply the function
  2726. `main' to the argument list ("a" "speckled" "gecko").
  2727. Here is how Guile parses the command-line arguments:
  2728. - Each space character terminates an argument. This means that two
  2729. spaces in a row introduce an empty-string argument.
  2730. - The tab character is not permitted (unless you quote it with the
  2731. backslash character, as described below), to avoid confusion.
  2732. - The newline character terminates the sequence of arguments, and will
  2733. also terminate a final non-empty argument. (However, a newline
  2734. following a space will not introduce a final empty-string argument;
  2735. it only terminates the argument list.)
  2736. - The backslash character is the escape character. It escapes
  2737. backslash, space, tab, and newline. The ANSI C escape sequences
  2738. like \n and \t are also supported. These produce argument
  2739. constituents; the two-character combination \n doesn't act like a
  2740. terminating newline. The escape sequence \NNN for exactly three
  2741. octal digits reads as the character whose ASCII code is NNN. As
  2742. above, characters produced this way are argument constituents.
  2743. Backslash followed by other characters is not allowed.
  2744. * Changes to the procedure for linking libguile with your programs
  2745. ** Guile now builds and installs a shared guile library, if your
  2746. system support shared libraries. (It still builds a static library on
  2747. all systems.) Guile automatically detects whether your system
  2748. supports shared libraries. To prevent Guile from buildisg shared
  2749. libraries, pass the `--disable-shared' flag to the configure script.
  2750. Guile takes longer to compile when it builds shared libraries, because
  2751. it must compile every file twice --- once to produce position-
  2752. independent object code, and once to produce normal object code.
  2753. ** The libthreads library has been merged into libguile.
  2754. To link a program against Guile, you now need only link against
  2755. -lguile and -lqt; -lthreads is no longer needed. If you are using
  2756. autoconf to generate configuration scripts for your application, the
  2757. following lines should suffice to add the appropriate libraries to
  2758. your link command:
  2759. ### Find quickthreads and libguile.
  2760. AC_CHECK_LIB(qt, main)
  2761. AC_CHECK_LIB(guile, scm_shell)
  2762. * Changes to Scheme functions
  2763. ** Guile Scheme's special syntax for keyword objects is now optional,
  2764. and disabled by default.
  2765. The syntax variation from R4RS made it difficult to port some
  2766. interesting packages to Guile. The routines which accepted keyword
  2767. arguments (mostly in the module system) have been modified to also
  2768. accept symbols whose names begin with `:'.
  2769. To change the keyword syntax, you must first import the (ice-9 debug)
  2770. module:
  2771. (use-modules (ice-9 debug))
  2772. Then you can enable the keyword syntax as follows:
  2773. (read-set! keywords 'prefix)
  2774. To disable keyword syntax, do this:
  2775. (read-set! keywords #f)
  2776. ** Many more primitive functions accept shared substrings as
  2777. arguments. In the past, these functions required normal, mutable
  2778. strings as arguments, although they never made use of this
  2779. restriction.
  2780. ** The uniform array functions now operate on byte vectors. These
  2781. functions are `array-fill!', `serial-array-copy!', `array-copy!',
  2782. `serial-array-map', `array-map', `array-for-each', and
  2783. `array-index-map!'.
  2784. ** The new functions `trace' and `untrace' implement simple debugging
  2785. support for Scheme functions.
  2786. The `trace' function accepts any number of procedures as arguments,
  2787. and tells the Guile interpreter to display each procedure's name and
  2788. arguments each time the procedure is invoked. When invoked with no
  2789. arguments, `trace' returns the list of procedures currently being
  2790. traced.
  2791. The `untrace' function accepts any number of procedures as arguments,
  2792. and tells the Guile interpreter not to trace them any more. When
  2793. invoked with no arguments, `untrace' untraces all curretly traced
  2794. procedures.
  2795. The tracing in Guile has an advantage over most other systems: we
  2796. don't create new procedure objects, but mark the procedure objects
  2797. themselves. This means that anonymous and internal procedures can be
  2798. traced.
  2799. ** The function `assert-repl-prompt' has been renamed to
  2800. `set-repl-prompt!'. It takes one argument, PROMPT.
  2801. - If PROMPT is #f, the Guile read-eval-print loop will not prompt.
  2802. - If PROMPT is a string, we use it as a prompt.
  2803. - If PROMPT is a procedure accepting no arguments, we call it, and
  2804. display the result as a prompt.
  2805. - Otherwise, we display "> ".
  2806. ** The new function `eval-string' reads Scheme expressions from a
  2807. string and evaluates them, returning the value of the last expression
  2808. in the string. If the string contains no expressions, it returns an
  2809. unspecified value.
  2810. ** The new function `thunk?' returns true iff its argument is a
  2811. procedure of zero arguments.
  2812. ** `defined?' is now a builtin function, instead of syntax. This
  2813. means that its argument should be quoted. It returns #t iff its
  2814. argument is bound in the current module.
  2815. ** The new syntax `use-modules' allows you to add new modules to your
  2816. environment without re-typing a complete `define-module' form. It
  2817. accepts any number of module names as arguments, and imports their
  2818. public bindings into the current module.
  2819. ** The new function (module-defined? NAME MODULE) returns true iff
  2820. NAME, a symbol, is defined in MODULE, a module object.
  2821. ** The new function `builtin-bindings' creates and returns a hash
  2822. table containing copies of all the root module's bindings.
  2823. ** The new function `builtin-weak-bindings' does the same as
  2824. `builtin-bindings', but creates a doubly-weak hash table.
  2825. ** The `equal?' function now considers variable objects to be
  2826. equivalent if they have the same name and the same value.
  2827. ** The new function `command-line' returns the command-line arguments
  2828. given to Guile, as a list of strings.
  2829. When using guile as a script interpreter, `command-line' returns the
  2830. script's arguments; those processed by the interpreter (like `-s' or
  2831. `-c') are omitted. (In other words, you get the normal, expected
  2832. behavior.) Any application that uses scm_shell to process its
  2833. command-line arguments gets this behavior as well.
  2834. ** The new function `load-user-init' looks for a file called `.guile'
  2835. in the user's home directory, and loads it if it exists. This is
  2836. mostly for use by the code generated by scm_compile_shell_switches,
  2837. but we thought it might also be useful in other circumstances.
  2838. ** The new function `log10' returns the base-10 logarithm of its
  2839. argument.
  2840. ** Changes to I/O functions
  2841. *** The functions `read', `primitive-load', `read-and-eval!', and
  2842. `primitive-load-path' no longer take optional arguments controlling
  2843. case insensitivity and a `#' parser.
  2844. Case sensitivity is now controlled by a read option called
  2845. `case-insensitive'. The user can add new `#' syntaxes with the
  2846. `read-hash-extend' function (see below).
  2847. *** The new function `read-hash-extend' allows the user to change the
  2848. syntax of Guile Scheme in a somewhat controlled way.
  2849. (read-hash-extend CHAR PROC)
  2850. When parsing S-expressions, if we read a `#' character followed by
  2851. the character CHAR, use PROC to parse an object from the stream.
  2852. If PROC is #f, remove any parsing procedure registered for CHAR.
  2853. The reader applies PROC to two arguments: CHAR and an input port.
  2854. *** The new functions read-delimited and read-delimited! provide a
  2855. general mechanism for doing delimited input on streams.
  2856. (read-delimited DELIMS [PORT HANDLE-DELIM])
  2857. Read until we encounter one of the characters in DELIMS (a string),
  2858. or end-of-file. PORT is the input port to read from; it defaults to
  2859. the current input port. The HANDLE-DELIM parameter determines how
  2860. the terminating character is handled; it should be one of the
  2861. following symbols:
  2862. 'trim omit delimiter from result
  2863. 'peek leave delimiter character in input stream
  2864. 'concat append delimiter character to returned value
  2865. 'split return a pair: (RESULT . TERMINATOR)
  2866. HANDLE-DELIM defaults to 'peek.
  2867. (read-delimited! DELIMS BUF [PORT HANDLE-DELIM START END])
  2868. A side-effecting variant of `read-delimited'.
  2869. The data is written into the string BUF at the indices in the
  2870. half-open interval [START, END); the default interval is the whole
  2871. string: START = 0 and END = (string-length BUF). The values of
  2872. START and END must specify a well-defined interval in BUF, i.e.
  2873. 0 <= START <= END <= (string-length BUF).
  2874. It returns NBYTES, the number of bytes read. If the buffer filled
  2875. up without a delimiter character being found, it returns #f. If the
  2876. port is at EOF when the read starts, it returns the EOF object.
  2877. If an integer is returned (i.e., the read is successfully terminated
  2878. by reading a delimiter character), then the HANDLE-DELIM parameter
  2879. determines how to handle the terminating character. It is described
  2880. above, and defaults to 'peek.
  2881. (The descriptions of these functions were borrowed from the SCSH
  2882. manual, by Olin Shivers and Brian Carlstrom.)
  2883. *** The `%read-delimited!' function is the primitive used to implement
  2884. `read-delimited' and `read-delimited!'.
  2885. (%read-delimited! DELIMS BUF GOBBLE? [PORT START END])
  2886. This returns a pair of values: (TERMINATOR . NUM-READ).
  2887. - TERMINATOR describes why the read was terminated. If it is a
  2888. character or the eof object, then that is the value that terminated
  2889. the read. If it is #f, the function filled the buffer without finding
  2890. a delimiting character.
  2891. - NUM-READ is the number of characters read into BUF.
  2892. If the read is successfully terminated by reading a delimiter
  2893. character, then the gobble? parameter determines what to do with the
  2894. terminating character. If true, the character is removed from the
  2895. input stream; if false, the character is left in the input stream
  2896. where a subsequent read operation will retrieve it. In either case,
  2897. the character is also the first value returned by the procedure call.
  2898. (The descriptions of this function was borrowed from the SCSH manual,
  2899. by Olin Shivers and Brian Carlstrom.)
  2900. *** The `read-line' and `read-line!' functions have changed; they now
  2901. trim the terminator by default; previously they appended it to the
  2902. returned string. For the old behavior, use (read-line PORT 'concat).
  2903. *** The functions `uniform-array-read!' and `uniform-array-write!' now
  2904. take new optional START and END arguments, specifying the region of
  2905. the array to read and write.
  2906. *** The `ungetc-char-ready?' function has been removed. We feel it's
  2907. inappropriate for an interface to expose implementation details this
  2908. way.
  2909. ** Changes to the Unix library and system call interface
  2910. *** The new fcntl function provides access to the Unix `fcntl' system
  2911. call.
  2912. (fcntl PORT COMMAND VALUE)
  2913. Apply COMMAND to PORT's file descriptor, with VALUE as an argument.
  2914. Values for COMMAND are:
  2915. F_DUPFD duplicate a file descriptor
  2916. F_GETFD read the descriptor's close-on-exec flag
  2917. F_SETFD set the descriptor's close-on-exec flag to VALUE
  2918. F_GETFL read the descriptor's flags, as set on open
  2919. F_SETFL set the descriptor's flags, as set on open to VALUE
  2920. F_GETOWN return the process ID of a socket's owner, for SIGIO
  2921. F_SETOWN set the process that owns a socket to VALUE, for SIGIO
  2922. FD_CLOEXEC not sure what this is
  2923. For details, see the documentation for the fcntl system call.
  2924. *** The arguments to `select' have changed, for compatibility with
  2925. SCSH. The TIMEOUT parameter may now be non-integral, yielding the
  2926. expected behavior. The MILLISECONDS parameter has been changed to
  2927. MICROSECONDS, to more closely resemble the underlying system call.
  2928. The RVEC, WVEC, and EVEC arguments can now be vectors; the type of the
  2929. corresponding return set will be the same.
  2930. *** The arguments to the `mknod' system call have changed. They are
  2931. now:
  2932. (mknod PATH TYPE PERMS DEV)
  2933. Create a new file (`node') in the file system. PATH is the name of
  2934. the file to create. TYPE is the kind of file to create; it should
  2935. be 'fifo, 'block-special, or 'char-special. PERMS specifies the
  2936. permission bits to give the newly created file. If TYPE is
  2937. 'block-special or 'char-special, DEV specifies which device the
  2938. special file refers to; its interpretation depends on the kind of
  2939. special file being created.
  2940. *** The `fork' function has been renamed to `primitive-fork', to avoid
  2941. clashing with various SCSH forks.
  2942. *** The `recv' and `recvfrom' functions have been renamed to `recv!'
  2943. and `recvfrom!'. They no longer accept a size for a second argument;
  2944. you must pass a string to hold the received value. They no longer
  2945. return the buffer. Instead, `recv' returns the length of the message
  2946. received, and `recvfrom' returns a pair containing the packet's length
  2947. and originating address.
  2948. *** The file descriptor datatype has been removed, as have the
  2949. `read-fd', `write-fd', `close', `lseek', and `dup' functions.
  2950. We plan to replace these functions with a SCSH-compatible interface.
  2951. *** The `create' function has been removed; it's just a special case
  2952. of `open'.
  2953. *** There are new functions to break down process termination status
  2954. values. In the descriptions below, STATUS is a value returned by
  2955. `waitpid'.
  2956. (status:exit-val STATUS)
  2957. If the child process exited normally, this function returns the exit
  2958. code for the child process (i.e., the value passed to exit, or
  2959. returned from main). If the child process did not exit normally,
  2960. this function returns #f.
  2961. (status:stop-sig STATUS)
  2962. If the child process was suspended by a signal, this function
  2963. returns the signal that suspended the child. Otherwise, it returns
  2964. #f.
  2965. (status:term-sig STATUS)
  2966. If the child process terminated abnormally, this function returns
  2967. the signal that terminated the child. Otherwise, this function
  2968. returns false.
  2969. POSIX promises that exactly one of these functions will return true on
  2970. a valid STATUS value.
  2971. These functions are compatible with SCSH.
  2972. *** There are new accessors and setters for the broken-out time vectors
  2973. returned by `localtime', `gmtime', and that ilk. They are:
  2974. Component Accessor Setter
  2975. ========================= ============ ============
  2976. seconds tm:sec set-tm:sec
  2977. minutes tm:min set-tm:min
  2978. hours tm:hour set-tm:hour
  2979. day of the month tm:mday set-tm:mday
  2980. month tm:mon set-tm:mon
  2981. year tm:year set-tm:year
  2982. day of the week tm:wday set-tm:wday
  2983. day in the year tm:yday set-tm:yday
  2984. daylight saving time tm:isdst set-tm:isdst
  2985. GMT offset, seconds tm:gmtoff set-tm:gmtoff
  2986. name of time zone tm:zone set-tm:zone
  2987. *** There are new accessors for the vectors returned by `uname',
  2988. describing the host system:
  2989. Component Accessor
  2990. ============================================== ================
  2991. name of the operating system implementation utsname:sysname
  2992. network name of this machine utsname:nodename
  2993. release level of the operating system utsname:release
  2994. version level of the operating system utsname:version
  2995. machine hardware platform utsname:machine
  2996. *** There are new accessors for the vectors returned by `getpw',
  2997. `getpwnam', `getpwuid', and `getpwent', describing entries from the
  2998. system's user database:
  2999. Component Accessor
  3000. ====================== =================
  3001. user name passwd:name
  3002. user password passwd:passwd
  3003. user id passwd:uid
  3004. group id passwd:gid
  3005. real name passwd:gecos
  3006. home directory passwd:dir
  3007. shell program passwd:shell
  3008. *** There are new accessors for the vectors returned by `getgr',
  3009. `getgrnam', `getgrgid', and `getgrent', describing entries from the
  3010. system's group database:
  3011. Component Accessor
  3012. ======================= ============
  3013. group name group:name
  3014. group password group:passwd
  3015. group id group:gid
  3016. group members group:mem
  3017. *** There are new accessors for the vectors returned by `gethost',
  3018. `gethostbyaddr', `gethostbyname', and `gethostent', describing
  3019. internet hosts:
  3020. Component Accessor
  3021. ========================= ===============
  3022. official name of host hostent:name
  3023. alias list hostent:aliases
  3024. host address type hostent:addrtype
  3025. length of address hostent:length
  3026. list of addresses hostent:addr-list
  3027. *** There are new accessors for the vectors returned by `getnet',
  3028. `getnetbyaddr', `getnetbyname', and `getnetent', describing internet
  3029. networks:
  3030. Component Accessor
  3031. ========================= ===============
  3032. official name of net netent:name
  3033. alias list netent:aliases
  3034. net number type netent:addrtype
  3035. net number netent:net
  3036. *** There are new accessors for the vectors returned by `getproto',
  3037. `getprotobyname', `getprotobynumber', and `getprotoent', describing
  3038. internet protocols:
  3039. Component Accessor
  3040. ========================= ===============
  3041. official protocol name protoent:name
  3042. alias list protoent:aliases
  3043. protocol number protoent:proto
  3044. *** There are new accessors for the vectors returned by `getserv',
  3045. `getservbyname', `getservbyport', and `getservent', describing
  3046. internet protocols:
  3047. Component Accessor
  3048. ========================= ===============
  3049. official service name servent:name
  3050. alias list servent:aliases
  3051. port number servent:port
  3052. protocol to use servent:proto
  3053. *** There are new accessors for the sockaddr structures returned by
  3054. `accept', `getsockname', `getpeername', `recvfrom!':
  3055. Component Accessor
  3056. ======================================== ===============
  3057. address format (`family') sockaddr:fam
  3058. path, for file domain addresses sockaddr:path
  3059. address, for internet domain addresses sockaddr:addr
  3060. TCP or UDP port, for internet sockaddr:port
  3061. *** The `getpwent', `getgrent', `gethostent', `getnetent',
  3062. `getprotoent', and `getservent' functions now return #f at the end of
  3063. the user database. (They used to throw an exception.)
  3064. Note that calling MUMBLEent function is equivalent to calling the
  3065. corresponding MUMBLE function with no arguments.
  3066. *** The `setpwent', `setgrent', `sethostent', `setnetent',
  3067. `setprotoent', and `setservent' routines now take no arguments.
  3068. *** The `gethost', `getproto', `getnet', and `getserv' functions now
  3069. provide more useful information when they throw an exception.
  3070. *** The `lnaof' function has been renamed to `inet-lnaof'.
  3071. *** Guile now claims to have the `current-time' feature.
  3072. *** The `mktime' function now takes an optional second argument ZONE,
  3073. giving the time zone to use for the conversion. ZONE should be a
  3074. string, in the same format as expected for the "TZ" environment variable.
  3075. *** The `strptime' function now returns a pair (TIME . COUNT), where
  3076. TIME is the parsed time as a vector, and COUNT is the number of
  3077. characters from the string left unparsed. This function used to
  3078. return the remaining characters as a string.
  3079. *** The `gettimeofday' function has replaced the old `time+ticks' function.
  3080. The return value is now (SECONDS . MICROSECONDS); the fractional
  3081. component is no longer expressed in "ticks".
  3082. *** The `ticks/sec' constant has been removed, in light of the above change.
  3083. * Changes to the gh_ interface
  3084. ** gh_eval_str() now returns an SCM object which is the result of the
  3085. evaluation
  3086. ** gh_scm2str() now copies the Scheme data to a caller-provided C
  3087. array
  3088. ** gh_scm2newstr() now makes a C array, copies the Scheme data to it,
  3089. and returns the array
  3090. ** gh_scm2str0() is gone: there is no need to distinguish
  3091. null-terminated from non-null-terminated, since gh_scm2newstr() allows
  3092. the user to interpret the data both ways.
  3093. * Changes to the scm_ interface
  3094. ** The new function scm_symbol_value0 provides an easy way to get a
  3095. symbol's value from C code:
  3096. SCM scm_symbol_value0 (char *NAME)
  3097. Return the value of the symbol named by the null-terminated string
  3098. NAME in the current module. If the symbol named NAME is unbound in
  3099. the current module, return SCM_UNDEFINED.
  3100. ** The new function scm_sysintern0 creates new top-level variables,
  3101. without assigning them a value.
  3102. SCM scm_sysintern0 (char *NAME)
  3103. Create a new Scheme top-level variable named NAME. NAME is a
  3104. null-terminated string. Return the variable's value cell.
  3105. ** The function scm_internal_catch is the guts of catch. It handles
  3106. all the mechanics of setting up a catch target, invoking the catch
  3107. body, and perhaps invoking the handler if the body does a throw.
  3108. The function is designed to be usable from C code, but is general
  3109. enough to implement all the semantics Guile Scheme expects from throw.
  3110. TAG is the catch tag. Typically, this is a symbol, but this function
  3111. doesn't actually care about that.
  3112. BODY is a pointer to a C function which runs the body of the catch;
  3113. this is the code you can throw from. We call it like this:
  3114. BODY (BODY_DATA, JMPBUF)
  3115. where:
  3116. BODY_DATA is just the BODY_DATA argument we received; we pass it
  3117. through to BODY as its first argument. The caller can make
  3118. BODY_DATA point to anything useful that BODY might need.
  3119. JMPBUF is the Scheme jmpbuf object corresponding to this catch,
  3120. which we have just created and initialized.
  3121. HANDLER is a pointer to a C function to deal with a throw to TAG,
  3122. should one occur. We call it like this:
  3123. HANDLER (HANDLER_DATA, THROWN_TAG, THROW_ARGS)
  3124. where
  3125. HANDLER_DATA is the HANDLER_DATA argument we recevied; it's the
  3126. same idea as BODY_DATA above.
  3127. THROWN_TAG is the tag that the user threw to; usually this is
  3128. TAG, but it could be something else if TAG was #t (i.e., a
  3129. catch-all), or the user threw to a jmpbuf.
  3130. THROW_ARGS is the list of arguments the user passed to the THROW
  3131. function.
  3132. BODY_DATA is just a pointer we pass through to BODY. HANDLER_DATA
  3133. is just a pointer we pass through to HANDLER. We don't actually
  3134. use either of those pointers otherwise ourselves. The idea is
  3135. that, if our caller wants to communicate something to BODY or
  3136. HANDLER, it can pass a pointer to it as MUMBLE_DATA, which BODY and
  3137. HANDLER can then use. Think of it as a way to make BODY and
  3138. HANDLER closures, not just functions; MUMBLE_DATA points to the
  3139. enclosed variables.
  3140. Of course, it's up to the caller to make sure that any data a
  3141. MUMBLE_DATA needs is protected from GC. A common way to do this is
  3142. to make MUMBLE_DATA a pointer to data stored in an automatic
  3143. structure variable; since the collector must scan the stack for
  3144. references anyway, this assures that any references in MUMBLE_DATA
  3145. will be found.
  3146. ** The new function scm_internal_lazy_catch is exactly like
  3147. scm_internal_catch, except:
  3148. - It does not unwind the stack (this is the major difference).
  3149. - If handler returns, its value is returned from the throw.
  3150. - BODY always receives #f as its JMPBUF argument (since there's no
  3151. jmpbuf associated with a lazy catch, because we don't unwind the
  3152. stack.)
  3153. ** scm_body_thunk is a new body function you can pass to
  3154. scm_internal_catch if you want the body to be like Scheme's `catch'
  3155. --- a thunk, or a function of one argument if the tag is #f.
  3156. BODY_DATA is a pointer to a scm_body_thunk_data structure, which
  3157. contains the Scheme procedure to invoke as the body, and the tag
  3158. we're catching. If the tag is #f, then we pass JMPBUF (created by
  3159. scm_internal_catch) to the body procedure; otherwise, the body gets
  3160. no arguments.
  3161. ** scm_handle_by_proc is a new handler function you can pass to
  3162. scm_internal_catch if you want the handler to act like Scheme's catch
  3163. --- call a procedure with the tag and the throw arguments.
  3164. If the user does a throw to this catch, this function runs a handler
  3165. procedure written in Scheme. HANDLER_DATA is a pointer to an SCM
  3166. variable holding the Scheme procedure object to invoke. It ought to
  3167. be a pointer to an automatic variable (i.e., one living on the stack),
  3168. or the procedure object should be otherwise protected from GC.
  3169. ** scm_handle_by_message is a new handler function to use with
  3170. `scm_internal_catch' if you want Guile to print a message and die.
  3171. It's useful for dealing with throws to uncaught keys at the top level.
  3172. HANDLER_DATA, if non-zero, is assumed to be a char * pointing to a
  3173. message header to print; if zero, we use "guile" instead. That
  3174. text is followed by a colon, then the message described by ARGS.
  3175. ** The return type of scm_boot_guile is now void; the function does
  3176. not return a value, and indeed, never returns at all.
  3177. ** The new function scm_shell makes it easy for user applications to
  3178. process command-line arguments in a way that is compatible with the
  3179. stand-alone guile interpreter (which is in turn compatible with SCSH,
  3180. the Scheme shell).
  3181. To use the scm_shell function, first initialize any guile modules
  3182. linked into your application, and then call scm_shell with the values
  3183. of ARGC and ARGV your `main' function received. scm_shell will add
  3184. any SCSH-style meta-arguments from the top of the script file to the
  3185. argument vector, and then process the command-line arguments. This
  3186. generally means loading a script file or starting up an interactive
  3187. command interpreter. For details, see "Changes to the stand-alone
  3188. interpreter" above.
  3189. ** The new functions scm_get_meta_args and scm_count_argv help you
  3190. implement the SCSH-style meta-argument, `\'.
  3191. char **scm_get_meta_args (int ARGC, char **ARGV)
  3192. If the second element of ARGV is a string consisting of a single
  3193. backslash character (i.e. "\\" in Scheme notation), open the file
  3194. named by the following argument, parse arguments from it, and return
  3195. the spliced command line. The returned array is terminated by a
  3196. null pointer.
  3197. For details of argument parsing, see above, under "guile now accepts
  3198. command-line arguments compatible with SCSH..."
  3199. int scm_count_argv (char **ARGV)
  3200. Count the arguments in ARGV, assuming it is terminated by a null
  3201. pointer.
  3202. For an example of how these functions might be used, see the source
  3203. code for the function scm_shell in libguile/script.c.
  3204. You will usually want to use scm_shell instead of calling this
  3205. function yourself.
  3206. ** The new function scm_compile_shell_switches turns an array of
  3207. command-line arguments into Scheme code to carry out the actions they
  3208. describe. Given ARGC and ARGV, it returns a Scheme expression to
  3209. evaluate, and calls scm_set_program_arguments to make any remaining
  3210. command-line arguments available to the Scheme code. For example,
  3211. given the following arguments:
  3212. -e main -s ekko a speckled gecko
  3213. scm_set_program_arguments will return the following expression:
  3214. (begin (load "ekko") (main (command-line)) (quit))
  3215. You will usually want to use scm_shell instead of calling this
  3216. function yourself.
  3217. ** The function scm_shell_usage prints a usage message appropriate for
  3218. an interpreter that uses scm_compile_shell_switches to handle its
  3219. command-line arguments.
  3220. void scm_shell_usage (int FATAL, char *MESSAGE)
  3221. Print a usage message to the standard error output. If MESSAGE is
  3222. non-zero, write it before the usage message, followed by a newline.
  3223. If FATAL is non-zero, exit the process, using FATAL as the
  3224. termination status. (If you want to be compatible with Guile,
  3225. always use 1 as the exit status when terminating due to command-line
  3226. usage problems.)
  3227. You will usually want to use scm_shell instead of calling this
  3228. function yourself.
  3229. ** scm_eval_0str now returns SCM_UNSPECIFIED if the string contains no
  3230. expressions. It used to return SCM_EOL. Earth-shattering.
  3231. ** The macros for declaring scheme objects in C code have been
  3232. rearranged slightly. They are now:
  3233. SCM_SYMBOL (C_NAME, SCHEME_NAME)
  3234. Declare a static SCM variable named C_NAME, and initialize it to
  3235. point to the Scheme symbol whose name is SCHEME_NAME. C_NAME should
  3236. be a C identifier, and SCHEME_NAME should be a C string.
  3237. SCM_GLOBAL_SYMBOL (C_NAME, SCHEME_NAME)
  3238. Just like SCM_SYMBOL, but make C_NAME globally visible.
  3239. SCM_VCELL (C_NAME, SCHEME_NAME)
  3240. Create a global variable at the Scheme level named SCHEME_NAME.
  3241. Declare a static SCM variable named C_NAME, and initialize it to
  3242. point to the Scheme variable's value cell.
  3243. SCM_GLOBAL_VCELL (C_NAME, SCHEME_NAME)
  3244. Just like SCM_VCELL, but make C_NAME globally visible.
  3245. The `guile-snarf' script writes initialization code for these macros
  3246. to its standard output, given C source code as input.
  3247. The SCM_GLOBAL macro is gone.
  3248. ** The scm_read_line and scm_read_line_x functions have been replaced
  3249. by Scheme code based on the %read-delimited! procedure (known to C
  3250. code as scm_read_delimited_x). See its description above for more
  3251. information.
  3252. ** The function scm_sys_open has been renamed to scm_open. It now
  3253. returns a port instead of an FD object.
  3254. * The dynamic linking support has changed. For more information, see
  3255. libguile/DYNAMIC-LINKING.
  3256. Guile 1.0b3
  3257. User-visible changes from Thursday, September 5, 1996 until Guile 1.0
  3258. (Sun 5 Jan 1997):
  3259. * Changes to the 'guile' program:
  3260. ** Guile now loads some new files when it starts up. Guile first
  3261. searches the load path for init.scm, and loads it if found. Then, if
  3262. Guile is not being used to execute a script, and the user's home
  3263. directory contains a file named `.guile', Guile loads that.
  3264. ** You can now use Guile as a shell script interpreter.
  3265. To paraphrase the SCSH manual:
  3266. When Unix tries to execute an executable file whose first two
  3267. characters are the `#!', it treats the file not as machine code to
  3268. be directly executed by the native processor, but as source code
  3269. to be executed by some interpreter. The interpreter to use is
  3270. specified immediately after the #! sequence on the first line of
  3271. the source file. The kernel reads in the name of the interpreter,
  3272. and executes that instead. It passes the interpreter the source
  3273. filename as its first argument, with the original arguments
  3274. following. Consult the Unix man page for the `exec' system call
  3275. for more information.
  3276. Now you can use Guile as an interpreter, using a mechanism which is a
  3277. compatible subset of that provided by SCSH.
  3278. Guile now recognizes a '-s' command line switch, whose argument is the
  3279. name of a file of Scheme code to load. It also treats the two
  3280. characters `#!' as the start of a comment, terminated by `!#'. Thus,
  3281. to make a file of Scheme code directly executable by Unix, insert the
  3282. following two lines at the top of the file:
  3283. #!/usr/local/bin/guile -s
  3284. !#
  3285. Guile treats the argument of the `-s' command-line switch as the name
  3286. of a file of Scheme code to load, and treats the sequence `#!' as the
  3287. start of a block comment, terminated by `!#'.
  3288. For example, here's a version of 'echo' written in Scheme:
  3289. #!/usr/local/bin/guile -s
  3290. !#
  3291. (let loop ((args (cdr (program-arguments))))
  3292. (if (pair? args)
  3293. (begin
  3294. (display (car args))
  3295. (if (pair? (cdr args))
  3296. (display " "))
  3297. (loop (cdr args)))))
  3298. (newline)
  3299. Why does `#!' start a block comment terminated by `!#', instead of the
  3300. end of the line? That is the notation SCSH uses, and although we
  3301. don't yet support the other SCSH features that motivate that choice,
  3302. we would like to be backward-compatible with any existing Guile
  3303. scripts once we do. Furthermore, if the path to Guile on your system
  3304. is too long for your kernel, you can start the script with this
  3305. horrible hack:
  3306. #!/bin/sh
  3307. exec /really/long/path/to/guile -s "$0" ${1+"$@"}
  3308. !#
  3309. Note that some very old Unix systems don't support the `#!' syntax.
  3310. ** You can now run Guile without installing it.
  3311. Previous versions of the interactive Guile interpreter (`guile')
  3312. couldn't start up unless Guile's Scheme library had been installed;
  3313. they used the value of the environment variable `SCHEME_LOAD_PATH'
  3314. later on in the startup process, but not to find the startup code
  3315. itself. Now Guile uses `SCHEME_LOAD_PATH' in all searches for Scheme
  3316. code.
  3317. To run Guile without installing it, build it in the normal way, and
  3318. then set the environment variable `SCHEME_LOAD_PATH' to a
  3319. colon-separated list of directories, including the top-level directory
  3320. of the Guile sources. For example, if you unpacked Guile so that the
  3321. full filename of this NEWS file is /home/jimb/guile-1.0b3/NEWS, then
  3322. you might say
  3323. export SCHEME_LOAD_PATH=/home/jimb/my-scheme:/home/jimb/guile-1.0b3
  3324. ** Guile's read-eval-print loop no longer prints #<unspecified>
  3325. results. If the user wants to see this, she can evaluate the
  3326. expression (assert-repl-print-unspecified #t), perhaps in her startup
  3327. file.
  3328. ** Guile no longer shows backtraces by default when an error occurs;
  3329. however, it does display a message saying how to get one, and how to
  3330. request that they be displayed by default. After an error, evaluate
  3331. (backtrace)
  3332. to see a backtrace, and
  3333. (debug-enable 'backtrace)
  3334. to see them by default.
  3335. * Changes to Guile Scheme:
  3336. ** Guile now distinguishes between #f and the empty list.
  3337. This is for compatibility with the IEEE standard, the (possibly)
  3338. upcoming Revised^5 Report on Scheme, and many extant Scheme
  3339. implementations.
  3340. Guile used to have #f and '() denote the same object, to make Scheme's
  3341. type system more compatible with Emacs Lisp's. However, the change
  3342. caused too much trouble for Scheme programmers, and we found another
  3343. way to reconcile Emacs Lisp with Scheme that didn't require this.
  3344. ** Guile's delq, delv, delete functions, and their destructive
  3345. counterparts, delq!, delv!, and delete!, now remove all matching
  3346. elements from the list, not just the first. This matches the behavior
  3347. of the corresponding Emacs Lisp functions, and (I believe) the Maclisp
  3348. functions which inspired them.
  3349. I recognize that this change may break code in subtle ways, but it
  3350. seems best to make the change before the FSF's first Guile release,
  3351. rather than after.
  3352. ** The compiled-library-path function has been deleted from libguile.
  3353. ** The facilities for loading Scheme source files have changed.
  3354. *** The variable %load-path now tells Guile which directories to search
  3355. for Scheme code. Its value is a list of strings, each of which names
  3356. a directory.
  3357. *** The variable %load-extensions now tells Guile which extensions to
  3358. try appending to a filename when searching the load path. Its value
  3359. is a list of strings. Its default value is ("" ".scm").
  3360. *** (%search-load-path FILENAME) searches the directories listed in the
  3361. value of the %load-path variable for a Scheme file named FILENAME,
  3362. with all the extensions listed in %load-extensions. If it finds a
  3363. match, then it returns its full filename. If FILENAME is absolute, it
  3364. returns it unchanged. Otherwise, it returns #f.
  3365. %search-load-path will not return matches that refer to directories.
  3366. *** (primitive-load FILENAME :optional CASE-INSENSITIVE-P SHARP)
  3367. uses %seach-load-path to find a file named FILENAME, and loads it if
  3368. it finds it. If it can't read FILENAME for any reason, it throws an
  3369. error.
  3370. The arguments CASE-INSENSITIVE-P and SHARP are interpreted as by the
  3371. `read' function.
  3372. *** load uses the same searching semantics as primitive-load.
  3373. *** The functions %try-load, try-load-with-path, %load, load-with-path,
  3374. basic-try-load-with-path, basic-load-with-path, try-load-module-with-
  3375. path, and load-module-with-path have been deleted. The functions
  3376. above should serve their purposes.
  3377. *** If the value of the variable %load-hook is a procedure,
  3378. `primitive-load' applies its value to the name of the file being
  3379. loaded (without the load path directory name prepended). If its value
  3380. is #f, it is ignored. Otherwise, an error occurs.
  3381. This is mostly useful for printing load notification messages.
  3382. ** The function `eval!' is no longer accessible from the scheme level.
  3383. We can't allow operations which introduce glocs into the scheme level,
  3384. because Guile's type system can't handle these as data. Use `eval' or
  3385. `read-and-eval!' (see below) as replacement.
  3386. ** The new function read-and-eval! reads an expression from PORT,
  3387. evaluates it, and returns the result. This is more efficient than
  3388. simply calling `read' and `eval', since it is not necessary to make a
  3389. copy of the expression for the evaluator to munge.
  3390. Its optional arguments CASE_INSENSITIVE_P and SHARP are interpreted as
  3391. for the `read' function.
  3392. ** The function `int?' has been removed; its definition was identical
  3393. to that of `integer?'.
  3394. ** The functions `<?', `<?', `<=?', `=?', `>?', and `>=?'. Code should
  3395. use the R4RS names for these functions.
  3396. ** The function object-properties no longer returns the hash handle;
  3397. it simply returns the object's property list.
  3398. ** Many functions have been changed to throw errors, instead of
  3399. returning #f on failure. The point of providing exception handling in
  3400. the language is to simplify the logic of user code, but this is less
  3401. useful if Guile's primitives don't throw exceptions.
  3402. ** The function `fileno' has been renamed from `%fileno'.
  3403. ** The function primitive-mode->fdes returns #t or #f now, not 1 or 0.
  3404. * Changes to Guile's C interface:
  3405. ** The library's initialization procedure has been simplified.
  3406. scm_boot_guile now has the prototype:
  3407. void scm_boot_guile (int ARGC,
  3408. char **ARGV,
  3409. void (*main_func) (),
  3410. void *closure);
  3411. scm_boot_guile calls MAIN_FUNC, passing it CLOSURE, ARGC, and ARGV.
  3412. MAIN_FUNC should do all the work of the program (initializing other
  3413. packages, reading user input, etc.) before returning. When MAIN_FUNC
  3414. returns, call exit (0); this function never returns. If you want some
  3415. other exit value, MAIN_FUNC may call exit itself.
  3416. scm_boot_guile arranges for program-arguments to return the strings
  3417. given by ARGC and ARGV. If MAIN_FUNC modifies ARGC/ARGV, should call
  3418. scm_set_program_arguments with the final list, so Scheme code will
  3419. know which arguments have been processed.
  3420. scm_boot_guile establishes a catch-all catch handler which prints an
  3421. error message and exits the process. This means that Guile exits in a
  3422. coherent way when system errors occur and the user isn't prepared to
  3423. handle it. If the user doesn't like this behavior, they can establish
  3424. their own universal catcher in MAIN_FUNC to shadow this one.
  3425. Why must the caller do all the real work from MAIN_FUNC? The garbage
  3426. collector assumes that all local variables of type SCM will be above
  3427. scm_boot_guile's stack frame on the stack. If you try to manipulate
  3428. SCM values after this function returns, it's the luck of the draw
  3429. whether the GC will be able to find the objects you allocate. So,
  3430. scm_boot_guile function exits, rather than returning, to discourage
  3431. people from making that mistake.
  3432. The IN, OUT, and ERR arguments were removed; there are other
  3433. convenient ways to override these when desired.
  3434. The RESULT argument was deleted; this function should never return.
  3435. The BOOT_CMD argument was deleted; the MAIN_FUNC argument is more
  3436. general.
  3437. ** Guile's header files should no longer conflict with your system's
  3438. header files.
  3439. In order to compile code which #included <libguile.h>, previous
  3440. versions of Guile required you to add a directory containing all the
  3441. Guile header files to your #include path. This was a problem, since
  3442. Guile's header files have names which conflict with many systems'
  3443. header files.
  3444. Now only <libguile.h> need appear in your #include path; you must
  3445. refer to all Guile's other header files as <libguile/mumble.h>.
  3446. Guile's installation procedure puts libguile.h in $(includedir), and
  3447. the rest in $(includedir)/libguile.
  3448. ** Two new C functions, scm_protect_object and scm_unprotect_object,
  3449. have been added to the Guile library.
  3450. scm_protect_object (OBJ) protects OBJ from the garbage collector.
  3451. OBJ will not be freed, even if all other references are dropped,
  3452. until someone does scm_unprotect_object (OBJ). Both functions
  3453. return OBJ.
  3454. Note that calls to scm_protect_object do not nest. You can call
  3455. scm_protect_object any number of times on a given object, and the
  3456. next call to scm_unprotect_object will unprotect it completely.
  3457. Basically, scm_protect_object and scm_unprotect_object just
  3458. maintain a list of references to things. Since the GC knows about
  3459. this list, all objects it mentions stay alive. scm_protect_object
  3460. adds its argument to the list; scm_unprotect_object remove its
  3461. argument from the list.
  3462. ** scm_eval_0str now returns the value of the last expression
  3463. evaluated.
  3464. ** The new function scm_read_0str reads an s-expression from a
  3465. null-terminated string, and returns it.
  3466. ** The new function `scm_stdio_to_port' converts a STDIO file pointer
  3467. to a Scheme port object.
  3468. ** The new function `scm_set_program_arguments' allows C code to set
  3469. the value returned by the Scheme `program-arguments' function.
  3470. Older changes:
  3471. * Guile no longer includes sophisticated Tcl/Tk support.
  3472. The old Tcl/Tk support was unsatisfying to us, because it required the
  3473. user to link against the Tcl library, as well as Tk and Guile. The
  3474. interface was also un-lispy, in that it preserved Tcl/Tk's practice of
  3475. referring to widgets by names, rather than exporting widgets to Scheme
  3476. code as a special datatype.
  3477. In the Usenix Tk Developer's Workshop held in July 1996, the Tcl/Tk
  3478. maintainers described some very interesting changes in progress to the
  3479. Tcl/Tk internals, which would facilitate clean interfaces between lone
  3480. Tk and other interpreters --- even for garbage-collected languages
  3481. like Scheme. They expected the new Tk to be publicly available in the
  3482. fall of 1996.
  3483. Since it seems that Guile might soon have a new, cleaner interface to
  3484. lone Tk, and that the old Guile/Tk glue code would probably need to be
  3485. completely rewritten, we (Jim Blandy and Richard Stallman) have
  3486. decided not to support the old code. We'll spend the time instead on
  3487. a good interface to the newer Tk, as soon as it is available.
  3488. Until then, gtcltk-lib provides trivial, low-maintenance functionality.
  3489. Copyright information:
  3490. Copyright (C) 1996,1997 Free Software Foundation, Inc.
  3491. Permission is granted to anyone to make or distribute verbatim copies
  3492. of this document as received, in any medium, provided that the
  3493. copyright notice and this permission notice are preserved,
  3494. thus giving the recipient permission to redistribute in turn.
  3495. Permission is granted to distribute modified versions
  3496. of this document, or of portions of it,
  3497. under the above conditions, provided also that they
  3498. carry prominent notices stating who last changed them.
  3499. Local variables:
  3500. mode: outline
  3501. paragraph-separate: "[ ]*$"
  3502. end: