NEWS 412 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172
  1. Guile NEWS --- history of user-visible changes.
  2. Copyright (C) 1996-2014 Free Software Foundation, Inc.
  3. See the end for copying conditions.
  4. Please send Guile bug reports to bug-guile@gnu.org.
  5. Changes in 2.1.1 (changes since the 2.0.x series):
  6. * Notable changes
  7. ** Speed
  8. The biggest change in Guile 2.2 is a complete rewrite of its virtual
  9. machine and compiler internals. The result is faster startup time,
  10. better memory usage, and faster execution of user code. See the
  11. "Performance improvements" section below for more details.
  12. ** Better thread-safety
  13. This new release series takes the ABI-break opportunity to fix some
  14. interfaces that were difficult to use correctly from multiple threads.
  15. Notably, weak hash tables are now transparently thread-safe. Ports are
  16. also thread-safe; see "New interfaces" below for details on the changes
  17. to the C interface.
  18. ** Off-main-thread finalization
  19. Following Guile 2.0.6's change to invoke finalizers via asyncs, Guile
  20. 2.2 takes the additional step of invoking finalizers from a dedicated
  21. finalizer thread, if threads are enabled. This avoids concurrency
  22. issues between finalizers and application code, and also speeds up
  23. finalization.
  24. ** Better locale support in Guile scripts
  25. When Guile is invoked directly, either from the command line or via a
  26. hash-bang line (e.g. "#!/usr/bin/guile"), it now installs the current
  27. locale via a call to `(setlocale LC_ALL "")'. For users with a unicode
  28. locale, this makes all ports unicode-capable by default, without the
  29. need to call `setlocale' in your program. This behavior may be
  30. controlled via the GUILE_INSTALL_LOCALE environment variable; see the
  31. manual for more.
  32. ** Complete Emacs-compatible Elisp implementation
  33. Thanks to the work of BT Templeton, Guile's Elisp implementation is now
  34. fully Emacs-compatible, implementing all of Elisp's features and quirks
  35. in the same way as the editor we know and love.
  36. ** Dynamically expandable stacks
  37. Instead of allocating fixed stack sizes for running Scheme code, Guile
  38. now starts off each thread with only one or two pages of stack, and
  39. expands it dynamically as needed. Guile will throw an exception for
  40. stack overflows at some user-defined limit. See the manual for
  41. documentation on the GUILE_STACK_SIZE environment variable.
  42. This allows users to write programs that use the stack as a data
  43. structure for pending computations, as it was meant to be, without
  44. reifying that data out to the heap. Where you would previously make a
  45. loop that collect its results in reverse order only to re-reverse them
  46. at the end, now you can just recurse without worrying about stack
  47. overflows.
  48. * Performance improvements
  49. ** Faster programs via new virtual machine
  50. Guile's new virtual machine compiles programs to instructions for a new
  51. virtual machine. The new virtual machine's instructions can address
  52. their source and destination operands by "name" (slot). This makes
  53. access to named temporary values much faster, and removes a lot of
  54. value-shuffling that the old virtual machine had to do. The end result
  55. is that loop-heavy code can be two or three times as fast with Guile 2.2
  56. as in 2.0. Your mileage may vary, of course; see "A Virtual Machine for
  57. Guile" in the manual for the nitties and the gritties.
  58. ** Better startup time, memory usage with ELF object file format
  59. Guile now uses the standard ELF format for its compiled code. (Guile
  60. has its own loader and linker, so this does not imply a dependency on
  61. any particular platform's ELF toolchain.) The benefit is that Guile is
  62. now able to statically allocate more data in the object files. ELF also
  63. enables more sharing of data between processes, and decreases startup
  64. time (about 40% faster than the already fast startup of the Guile 2.0
  65. series). Guile also uses DWARF for some of its debugging information.
  66. Much of the debugging information can be stripped from the object files
  67. as well. See "Object File Format" in the manual, for full details.
  68. ** Better optimizations via compiler rewrite
  69. Guile's compiler now uses a Continuation-Passing Style (CPS)
  70. intermediate language, allowing it to reason easily about temporary
  71. values and control flow. Examples of optimizations that this permits
  72. are optimal contification, dead code elimination, parallel moves with at
  73. most one temporary, and allocation of stack slots using precise liveness
  74. information. For more, see "Continuation-Passing Style" in the manual.
  75. ** Faster interpreter
  76. Combined with a number of optimizations to the interpreter itself,
  77. simply compiling `eval.scm' with the new compiler yields an interpreter
  78. that is consistently two or three times faster than the one in Guile
  79. 2.0.
  80. ** Allocation-free dynamic stack
  81. Guile now implements the dynamic stack with an actual stack instead of a
  82. list of heap objects, avoiding most allocation. This speeds up prompts,
  83. the `scm_dynwind_*' family of functions, fluids, and `dynamic-wind'.
  84. ** Optimized UTF-8 and Latin-1 ports, symbols, and strings
  85. Guile 2.2 is faster at reading and writing UTF-8 and Latin-1 strings
  86. from ports, and at converting symbols and strings to and from these
  87. encodings.
  88. ** Optimized hash functions
  89. Guile 2.2 now uses Bob Jenkins' `hashword2' (from his `lookup3.c') for
  90. its string hash, and Thomas Wang's integer hash function for `hashq' and
  91. `hashv'. These functions produce much better hash values across all
  92. available fixnum bits.
  93. * New interfaces
  94. ** New `cond-expand' feature: `guile-2.2'
  95. Use this feature if you need to check for Guile 2.2 from Scheme code.
  96. ** New predicate: `nil?'
  97. See "Nil" in the manual.
  98. ** New compiler modules
  99. Since the compiler was rewritten, there are new modules for the back-end
  100. of the compiler and the low-level loader and introspection interfaces.
  101. See the "Guile Implementation" chapter in the manual for all details.
  102. ** New functions: `scm_to_intptr_t', `scm_from_intptr_t'
  103. ** New functions: `scm_to_uintptr_t', `scm_from_uintptr_t'
  104. See XXX in the manual.
  105. ** New thread-safe port API
  106. For details on `scm_c_make_port', `scm_c_make_port_with_encoding',
  107. `scm_c_lock_port', `scm_c_try_lock_port', `scm_c_unlock_port',
  108. `scm_c_port_type_ref', `scm_c_port_type_add_x', `SCM_PORT_DESCRIPTOR',
  109. and `scm_dynwind_lock_port', see XXX.
  110. There is now a routine to atomically adjust port "revealed counts". See
  111. XXX for more on `scm_adjust_port_revealed_x' and
  112. `adjust-port-revealed!',
  113. All other port API now takes the lock on the port if needed. There are
  114. some C interfaces if you know that you don't need to take a lock; see
  115. XXX for details on `scm_get_byte_or_eof_unlocked',
  116. `scm_peek_byte_or_eof_unlocked' `scm_c_read_unlocked',
  117. `scm_getc_unlocked' `scm_unget_byte_unlocked', `scm_ungetc_unlocked',
  118. `scm_ungets_unlocked', `scm_fill_input_unlocked' `scm_putc_unlocked',
  119. `scm_puts_unlocked', and `scm_lfwrite_unlocked'.
  120. ** New inline functions: `scm_new_smob', `scm_new_double_smob'
  121. These can replace many uses of SCM_NEWSMOB, SCM_RETURN_NEWSMOB2, and the
  122. like. See XXX in the manual, for more.
  123. ** New low-level type accessors
  124. For more on `SCM_HAS_TYP7', `SCM_HAS_TYP7S', `SCM_HAS_TYP16', see XXX.
  125. `SCM_HEAP_OBJECT_P' is now an alias for the inscrutable `SCM_NIMP'.
  126. `SCM_UNPACK_POINTER' and `SCM_PACK_POINTER' are better-named versions of
  127. the old `SCM2PTR' and `PTR2SCM'. Also, `SCM_UNPACK_POINTER' yields a
  128. void*.
  129. ** `scm_c_weak_vector_ref', `scm_c_weak_vector_set_x'
  130. Weak vectors can now be accessed from C using these accessors.
  131. ** <standard-vtable>, standard-vtable-fields
  132. See "Structures" in the manual for more on these
  133. ** Convenience utilities for ports and strings.
  134. See XXX for more on `scm_from_port_string', `scm_from_port_stringn',
  135. `scm_to_port_string', and `scm_to_port_stringn'.
  136. ** New expressive PEG parser
  137. See "PEG Parsing" in the manual for more. Thanks to Michael Lucy for
  138. originally writing these, and to Noah Lavine for integration work.
  139. * Incompatible changes
  140. ** ASCII is not ISO-8859-1
  141. In Guile 2.0, if a user set "ASCII" or "ANSI_X3.4-1968" as the encoding
  142. of a port, Guile would treat it as ISO-8859-1. While these encodings
  143. are the same for codepoints 0 to 127, ASCII does not extend past that
  144. range, whereas ISO-8859-1 goes up to 255. Guile 2.2 no longer treats
  145. ASCII as ISO-8859-1. This is likely to be a problem only if the user's
  146. locale is set to ASCII, and the user or a program writes non-ASCII
  147. codepoints to a port.
  148. ** String ports default to UTF-8
  149. Guile 2.0 would use the `%default-port-encoding' when creating string
  150. ports. This resulted in ports that could only accept a subset of valid
  151. characters, which was surprising to users. Now string ports default to
  152. the UTF-8 encoding. Sneaky users can still play encoding conversion
  153. games with string ports by explicitly setting the encoding of a port
  154. after it is open. See "Ports" in the manual for more.
  155. ** `scm_from_stringn' and `scm_to_stringn' encoding arguments are never NULL
  156. These functions now require a valid `encoding' argument, and will abort
  157. if given `NULL'.
  158. ** All r6rs ports are both textual and binary
  159. Because R6RS ports are a thin layer on top of Guile's ports, and Guile's
  160. ports are both textual and binary, Guile's R6RS ports are also both
  161. textual and binary, and thus both kinds have port transcoders. This is
  162. an incompatibility with respect to R6RS.
  163. ** Vtable hierarchy changes
  164. In an attempt to make Guile's structure and record types integrate
  165. better with GOOPS by unifying the vtable hierarchy, `make-vtable-vtable'
  166. is now deprecated. Instead, users should just use `make-vtable' with
  167. appropriate arguments. See "Structures" in the manual for all of the
  168. details. As such, `record-type-vtable' and `%condition-type-vtable' now
  169. have a parent vtable and are no longer roots of the vtable hierarchy.
  170. ** Syntax parameters are a distinct type
  171. Guile 2.0's transitional implementation of `syntax-parameterize' was
  172. based on the `fluid-let-syntax' interface inherited from the psyntax
  173. expander. This interface allowed any binding to be dynamically rebound
  174. -- even bindings like `lambda'. This is no longer the case in Guile
  175. 2.2. Syntax parameters must be defined via `define-syntax-parameter',
  176. and only such bindings may be parameterized. See "Syntax Parameters" in
  177. the manual for more.
  178. ** Defined identifiers scoped in the current module
  179. Sometimes Guile's expander would attach incorrect module scoping
  180. information for top-level bindings made by an expansion. For example,
  181. given the following R6RS library:
  182. (library (defconst)
  183. (export defconst)
  184. (import (guile))
  185. (define-syntax-rule (defconst name val)
  186. (begin
  187. (define t val)
  188. (define-syntax-rule (name) t))))
  189. Attempting to use it would produce an error:
  190. (import (defconst))
  191. (defconst foo 42)
  192. (foo)
  193. =| Unbound variable: t
  194. It wasn't clear that we could fix this in Guile 2.0 without breaking
  195. someone's delicate macros, so the fix is only coming out now.
  196. ** Pseudo-hygienically rename macro-introduced bindings
  197. Bindings introduced by macros, like `t' in the `defconst' example above,
  198. are now given pseudo-fresh names. This allows
  199. (defconst foo 42)
  200. (defconst bar 37)
  201. to introduce different bindings for `t'. These pseudo-fresh names are
  202. made in such a way that if the macro is expanded again, for example as
  203. part of a simple recompilation, the introduced identifiers get the same
  204. pseudo-fresh names. See "Hygiene and the Top-Level" in the manual, for
  205. details.
  206. ** Fix literal matching for module-bound literals
  207. `syntax-rules' and `syntax-case' macros can take a set of "literals":
  208. bound or unbound keywords that the syntax matcher treats specially.
  209. Before, literals were always matched symbolically (by name). Now they
  210. are matched by binding. This allows literals to be reliably bound to
  211. values, renamed by imports or exports, et cetera. See "Syntax-rules
  212. Macros" in the manual for more on literals.
  213. ** `dynamic-wind' doesn't check that guards are thunks
  214. Checking that the dynamic-wind out-guard procedure was actually a thunk
  215. before doing the wind was slow, unreliable, and not strictly needed.
  216. ** All deprecated code removed
  217. All code deprecated in Guile 2.0 has been removed. See older NEWS, and
  218. check that your programs can compile without linker warnings and run
  219. without runtime warnings. See "Deprecation" in the manual.
  220. ** Remove miscellaneous unused interfaces
  221. We have removed accidentally public, undocumented interfaces that we
  222. think are not used, and not useful. This includes `scm_markstream',
  223. `SCM_FLUSH_REGISTER_WINDOWS', `SCM_THREAD_SWITCHING_CODE', `SCM_FENCE',
  224. `scm_call_generic_0', `scm_call_generic_1', `scm_call_generic_2'
  225. `scm_call_generic_3', `scm_apply_generic', and `scm_program_source'.
  226. `scm_async_click' was renamed to `scm_async_tick', and `SCM_ASYNC_TICK'
  227. was made private (use `SCM_TICK' instead).
  228. ** Many internal compiler / VM changes
  229. As the compiler and virtual machine were re-written, there are many
  230. changes in the back-end of Guile to interfaces that were introduced in
  231. Guile 2.0. These changes are only only of interest if you wrote a
  232. language on Guile 2.0 or a tool using Guile 2.0 internals. If this is
  233. the case, drop by the IRC channel to discuss the changes.
  234. ** Defining a SMOB or port type no longer mucks exports of `(oop goops)'
  235. It used to be that defining a SMOB or port type added an export to
  236. GOOPS, for the wrapper class of the smob type. This violated
  237. modularity, though, so we have removed this behavior.
  238. ** Bytecode replaces objcode as a target language
  239. One way in which people may have used details of Guile's runtime in
  240. Guile 2.0 is in compiling code to thunks for later invocation. Instead
  241. of compiling to objcode and then calling `make-program', now the way to
  242. do it is to compile to `bytecode' and then call `load-thunk-from-memory'
  243. from `(system vm loader)'.
  244. ** Remove weak pairs.
  245. Weak pairs were not safe to access with `car' and `cdr', and so were
  246. removed.
  247. ** Remove weak alist vectors.
  248. Use weak hash tables instead.
  249. * New deprecations
  250. ** SCM_WTA_DISPATCH_0, SCM_WTA_DISPATCH_1, SCM_WTA_DISPATCH_2, SCM_WTA_DISPATCH_N
  251. ** SCM_GASSERT0, SCM_GASSERT1, SCM_GASSERT2, SCM_GASSERTn
  252. ** SCM_WTA_DISPATCH_1_SUBR
  253. These macros were used in dispatching primitive generics. They can be
  254. replaced by using C functions (the same name but in lower case), if
  255. needed, but this is a hairy part of Guile that perhaps you shouldn't be
  256. using.
  257. * Changes to the distribution
  258. ** New minor version
  259. The "effective version" of Guile is now 2.2, which allows parallel
  260. installation with other effective versions (for example, the older Guile
  261. 2.0). See "Parallel Installations" in the manual for full details.
  262. Notably, the `pkg-config' file is now `guile-2.2'.
  263. ** Bump required libgc version to 7.2, released March 2012.
  264. ** The readline extension is now installed in the extensionsdir
  265. The shared library that implements Guile's readline extension is no
  266. longer installed to the libdir. This change should be transparent to
  267. users, but packagers may be interested.
  268. Changes in 2.0.9 (since 2.0.7):
  269. Note: 2.0.8 was a brown paper bag release that was never announced, but
  270. some mirrors may have picked it up. Please do not use it.
  271. * Notable changes
  272. ** New keyword arguments for procedures that open files
  273. The following procedures that open files now support keyword arguments
  274. to request binary I/O or to specify the character encoding for text
  275. files: `open-file', `open-input-file', `open-output-file',
  276. `call-with-input-file', `call-with-output-file', `with-input-from-file',
  277. `with-output-to-file', and `with-error-to-file'.
  278. It is also now possible to specify whether Guile should scan files for
  279. Emacs-style coding declarations. This scan was done by default in
  280. versions 2.0.0 through 2.0.7, but now must be explicitly requested.
  281. See "File Ports" in the manual for details.
  282. ** Rewritten guile.m4
  283. The `guile.m4' autoconf macros have been rewritten to use `guild' and
  284. `pkg-config' instead of the deprecated `guile-config' (which itself
  285. calls pkg-config).
  286. There is also a new macro, `GUILE_PKG', which allows packages to select
  287. the version of Guile that they want to compile against. See "Autoconf
  288. Macros" in the manual, for more information.
  289. ** Better Windows support
  290. Guile now correctly identifies absolute paths on Windows (MinGW), and
  291. creates files on that platform according to its path conventions. See
  292. "File System" in the manual, for all details.
  293. In addition, the new Gnulib imports provide `select' and `poll' on
  294. Windows builds.
  295. As an incompatible change, systems that are missing <sys/select.h> were
  296. previously provided a public `scm_std_select' C function that defined a
  297. version of `select', but unhappily it also provided its own incompatible
  298. definitions for FD_SET, FD_ZERO, and other system interfaces. Guile
  299. should not be setting these macros in public API, so this interface was
  300. removed on those plaforms (basically only MinGW).
  301. ** Numerics improvements
  302. `number->string' now reliably outputs enough digits to produce the same
  303. number when read back in. Previously, it mishandled subnormal numbers
  304. (printing them as "#.#"), and failed to distinguish between some
  305. distinct inexact numbers, e.g. 1.0 and (+ 1.0 (expt 2.0 -52)). These
  306. problems had far-reaching implications, since the compiler uses
  307. `number->string' to serialize numeric constants into .go files.
  308. `sqrt' now produces exact rational results when possible, and handles
  309. very large or very small numbers more robustly.
  310. A number (ahem) of operations involving exact rationals have been
  311. optimized, most notably `integer-expt' and `expt'.
  312. `exact->inexact' now performs correct IEEE rounding.
  313. ** New optimizations
  314. There were a number of improvements to the partial evaluator, allowing
  315. complete reduction of forms such as:
  316. ((let ((_ 10)) (lambda () _)))
  317. ((lambda _ _))
  318. (apply (lambda _ _) 1 2 3 '(4))
  319. (call-with-values (lambda () (values 1 2)) (lambda _ _))
  320. `string-join' now handles huge lists efficiently.
  321. `get-bytevector-some' now uses buffered input, which is much faster.
  322. Finally, `array-ref', `array-set!' on arrays of rank 1 or 2 is now
  323. faster, because it avoids building a rest list. Similarly, the
  324. one-argument case of `array-for-each' and `array-map!' has been
  325. optimized, and `array-copy!' and `array-fill!' are faster.
  326. ** `peek-char' no longer consumes EOF
  327. As required by the R5RS, if `peek-char' returns EOF, then the next read
  328. will also return EOF. Previously `peek-char' would consume the EOF.
  329. This makes a difference for terminal devices where it is possible to
  330. read past an EOF.
  331. ** Gnulib update
  332. Guile's copy of Gnulib was updated to v0.0-7865-ga828bb2. The following
  333. modules were imported from Gnulib: select, times, pipe-posix, fstat,
  334. getlogin, poll, and c-strcase.
  335. ** `include' resolves relative file names relative to including file
  336. Given a relative file name, `include' will look for it relative to the
  337. directory of the including file. This harmonizes the behavior of
  338. `include' with that of `load'.
  339. ** SLIB compatibility restored
  340. Guile 2.0.8 is now compatible with SLIB. You will have to use a
  341. development version of SLIB, however, until a new version of SLIB is
  342. released.
  343. ** Better ,trace REPL command
  344. Sometimes the ,trace output for nested function calls could overflow the
  345. terminal width, which wasn't useful. Now there is a limit to the amount
  346. of space the prefix will take. See the documentation for ",trace" for
  347. more information.
  348. ** Better docstring syntax supported for `case-lambda'
  349. Docstrings can now be placed immediately after the `case-lambda' or
  350. `case-lambda*' keyword. See "Case-lambda" in the manual.
  351. ** Improved handling of Unicode byte order marks
  352. See "BOM Handling" in the manual for details.
  353. ** Update predefined character sets to Unicode 6.2
  354. ** GMP 4.2 or later required
  355. Guile used to require GMP at least version 4.1 (released in May 2002),
  356. and now requires at least version 4.2 (released in March 2006).
  357. * Manual updates
  358. ** Better SXML documentation
  359. The documentation for SXML modules was much improved, though there is
  360. still far to go. See "SXML" in manual.
  361. ** Style updates
  362. Use of "iff" was replaced with standard English. Keyword arguments are
  363. now documented consistently, along with their default values.
  364. ** An end to the generated-documentation experiment
  365. When Guile 2.0 imported some modules from Guile-Lib, they came with a
  366. system that generated documentation from docstrings and module
  367. commentaries. This produced terrible documentation. We finally bit the
  368. bullet and incorporated these modules into the main text, and will be
  369. improving them manually over time, as is the case with SXML. Help is
  370. appreciated.
  371. ** New documentation
  372. There is now documentation for `scm_array_type', and `scm_array_ref', as
  373. well as for the new `array-length' / 'scm_c_array_length' /
  374. `scm_array_length' functions. `array-in-bounds?' has better
  375. documentation as well. The `program-arguments-alist' and
  376. `program-lambda-list' functions are now documented, as well as `and=>',
  377. `exit', and `quit'. The (system repl server) module is now documented
  378. (see REPL Servers). Finally, the GOOPS class hierarchy diagram has been
  379. regenerated for the web and print output formats.
  380. * New deprecations
  381. ** Deprecate generalized vector interface
  382. The generalized vector interface, introduced in 1.8.0, is simply a
  383. redundant, verbose interface to arrays of rank 1. `array-ref' and
  384. similar functions are entirely sufficient. Thus,
  385. `scm_generalized_vector_p', `scm_generalized_vector_length',
  386. `scm_generalized_vector_ref', `scm_generalized_vector_set_x', and
  387. `scm_generalized_vector_to_list' are now deprecated.
  388. ** Deprecate SCM_CHAR_CODE_LIMIT and char-code-limit
  389. These constants were defined to 256, which is not the highest codepoint
  390. supported by Guile. Given that they were useless and incorrect, they
  391. have been deprecated.
  392. ** Deprecate `http-get*'
  393. The new `#:streaming?' argument to `http-get' subsumes the functionality
  394. of `http-get*' (introduced in 2.0.7). Also, the `#:extra-headers'
  395. argument is deprecated in favor of `#:headers'.
  396. ** Deprecate (ice-9 mapping)
  397. This module, present in Guile since 1996 but never used or documented,
  398. has never worked in Guile 2.0. It has now been deprecated and will be
  399. removed in Guile 2.2.
  400. ** Deprecate undocumented array-related C functions
  401. These are `scm_array_fill_int', `scm_ra_eqp', `scm_ra_lessp',
  402. `scm_ra_leqp', `scm_ra_grp', `scm_ra_greqp', `scm_ra_sum',
  403. `scm_ra_product', `scm_ra_difference', `scm_ra_divide', and
  404. `scm_array_identity'.
  405. * New interfaces
  406. ** SRFI-41 Streams
  407. See "SRFI-41" in the manual.
  408. ** SRFI-45 exports `promise?'
  409. SRFI-45 now exports a `promise?' procedure that works with its promises.
  410. Also, its promises now print more nicely.
  411. ** New HTTP client procedures
  412. See "Web Client" for documentation on the new `http-head', `http-post',
  413. `http-put', `http-delete', `http-trace', and `http-options' procedures,
  414. and also for more options to `http-get'.
  415. ** Much more capable `xml->sxml'
  416. See "Reading and Writing XML" for information on how the `xml->sxml'
  417. parser deals with namespaces, processed entities, doctypes, and literal
  418. strings. Incidentally, `current-ssax-error-port' is now a parameter
  419. object.
  420. ** New procedures for converting strings to and from bytevectors
  421. See "Representing Strings as Bytes" for documention on the new `(ice-9
  422. iconv)' module and its `bytevector->string' and `string->bytevector'
  423. procedures.
  424. ** Escape continuations with `call/ec' and `let/ec'
  425. See "Prompt Primitives".
  426. ** New procedures to read all characters from a port
  427. See "Line/Delimited" in the manual for documentation on `read-string'
  428. and `read-string!'.
  429. ** New procedure `sendfile'
  430. See "File System".
  431. ** New procedure `unget-bytevector'
  432. See "R6RS Binary Input".
  433. ** New C helper: `scm_c_bind_keyword_arguments'
  434. See "Keyword Procedures".
  435. ** New command-line arguments: `--language' and `-C'
  436. See "Command-line Options" in the manual.
  437. ** New environment variables: `GUILE_STACK_SIZE', `GUILE_INSTALL_LOCALE'
  438. See "Environment Variables".
  439. ** New procedures for dealing with file names
  440. See "File System" for documentation on `system-file-name-convention',
  441. `file-name-separator?', `absolute-file-name?', and
  442. `file-name-separator-string'.
  443. ** `array-length', an array's first dimension
  444. See "Array Procedures".
  445. ** `hash-count', for hash tables
  446. See "Hash Tables".
  447. ** `round-ash', a bit-shifting operator that rounds on right-shift
  448. See "Bitwise Operations".
  449. ** New foreign types: `ssize_t', `ptrdiff_t'
  450. See "Foreign Types".
  451. ** New C helpers: `scm_from_ptrdiff_t', `scm_to_ptrdiff_t'
  452. See "Integers".
  453. ** Socket option `SO_REUSEPORT' now available from Scheme
  454. If supported on the platform, `SO_REUSEPORT' is now available from
  455. Scheme as well. See "Network Sockets and Communication".
  456. ** `current-language' in default environment
  457. Previously defined only in `(system base language)', `current-language'
  458. is now defined in the default environment, and is used to determine the
  459. language for the REPL, and for `compile-and-load'.
  460. ** New procedure: `fluid->parameter'
  461. See "Parameters", for information on how to convert a fluid to a
  462. parameter.
  463. ** New `print' REPL option
  464. See "REPL Commands" in the manual for information on the new
  465. user-customizable REPL printer.
  466. ** New variable: %site-ccache-dir
  467. The "Installing Site Packages" and "Build Config" manual sections now
  468. refer to this variable to describe where users should install their
  469. `.go' files.
  470. * Build fixes
  471. ** Fix compilation against libgc 7.3.
  472. ** Fix cross-compilation of `c-tokenize.o'.
  473. ** Fix warning when compiling against glibc 2.17.
  474. ** Fix documentation build against Texinfo 5.0.
  475. ** Fix building Guile from a directory with non-ASCII characters.
  476. ** Fix native MinGW build.
  477. ** Fix --disable-posix build.
  478. ** Fix MinGW builds with networking, POSIX, and thread support.
  479. * Bug fixes
  480. ** Fix inexact number printer.
  481. (http://bugs.gnu.org/13757)
  482. ** Fix infinite loop when parsing optional-argument short options (SRFI-37).
  483. (http://bugs.gnu.org/13176)
  484. ** web: Support non-GMT date headers in the HTTP client.
  485. (http://bugs.gnu.org/13544)
  486. ** web: support IP-literal (IPv6 address) in Host header.
  487. ** Avoid stack overflows with `par-map' and nested futures in general.
  488. (http://bugs.gnu.org/13188)
  489. ** Peek-char no longer consumes EOF.
  490. (http://bugs.gnu.org/12216)
  491. ** Avoid swallowing multiple EOFs in R6RS binary-input procedures.
  492. ** A fork when multiple threads are running will now print a warning.
  493. ** Allow for spurious wakeups from pthread_cond_wait.
  494. (http://bugs.gnu.org/10641)
  495. ** Warn and ignore module autoload failures.
  496. (http://bugs.gnu.org/12202)
  497. ** Use chmod portably in (system base compile).
  498. (http://bugs.gnu.org/10474)
  499. ** Fix response-body-port for HTTP responses without content-length.
  500. (http://bugs.gnu.org/13857)
  501. ** Allow case-lambda expressions with no clauses.
  502. (http://bugs.gnu.org/9776)
  503. ** Improve standards conformance of string->number.
  504. (http://bugs.gnu.org/11887)
  505. ** Support calls and tail-calls with more than 255 formals.
  506. ** ,option evaluates its right-hand-side.
  507. (http://bugs.gnu.org/13076)
  508. ** Structs with tail arrays are not simple.
  509. (http://bugs.gnu.org/12808)
  510. ** Make `SCM_LONG_BIT' usable in preprocessor conditionals.
  511. (http://bugs.gnu.org/13848)
  512. ** Fix thread-unsafe lazy initializations.
  513. ** Allow SMOB mark procedures to be called from parallel markers.
  514. (http://bugs.gnu.org/13611)
  515. ** Fix later-bindings-win logic in with-fluids.
  516. (http://bugs.gnu.org/13843)
  517. ** Fix duplicate removal of with-fluids.
  518. (http://bugs.gnu.org/13838)
  519. ** Support calling foreign functions of 10 arguments or more.
  520. (http://bugs.gnu.org/13809)
  521. ** Let reverse! accept arbitrary types as second argument.
  522. (http://bugs.gnu.org/13835)
  523. ** Recognize the `x86_64.*-gnux32' triplet.
  524. ** Check whether a triplet's OS part specifies an ABI.
  525. ** Recognize mips64* as having 32-bit pointers by default.
  526. ** Use portable sed constructs.
  527. (http://bugs.gnu.org/14042)
  528. ** Remove language/glil/decompile-assembly.scm.
  529. (http://bugs.gnu.org/10622)
  530. ** Use O_BINARY in `copy-file', `load-objcode', `mkstemp'.
  531. ** Use byte-oriented functions in `get-bytevector*'.
  532. ** Fix abort when iconv swallows BOM from UTF-16 or UTF-32 stream.
  533. ** Fix compilation of functions with more than 255 local variables.
  534. ** Fix `getgroups' for when zero supplementary group IDs exist.
  535. ** Allow (define-macro name (lambda ...)).
  536. ** Various fixes to the (texinfo) modules.
  537. ** guild: Gracefully handle failures to install the locale.
  538. ** Fix format string warnings for ~!, ~|, ~/, ~q, ~Q, and ~^.
  539. (http://bugs.gnu.org/13485)
  540. ** Fix source annotation bug in psyntax 'expand-body'.
  541. ** Ecmascript: Fix conversion to boolean for non-numbers.
  542. ** Use case-insensitive comparisons for encoding names.
  543. ** Add missing cond-expand feature identifiers.
  544. ** A failure to find a module's file does not prevent future loading.
  545. ** Many (oop goops save) fixes.
  546. ** `http-get': don't shutdown write end of socket.
  547. (http://bugs.gnu.org/13095)
  548. ** Avoid signed integer overflow in scm_product.
  549. ** http: read-response-body always returns bytevector or #f, never EOF.
  550. ** web: Correctly detect "No route to host" conditions.
  551. ** `system*': failure to execvp no longer leaks dangling processes.
  552. (http://bugs.gnu.org/13166)
  553. ** More sensible case-lambda* dispatch.
  554. (http://bugs.gnu.org/12929)
  555. ** Do not defer expansion of internal define-syntax forms.
  556. (http://bugs.gnu.org/13509)
  557. Changes in 2.0.7 (since 2.0.6):
  558. * Notable changes
  559. ** SRFI-105 curly infix expressions are supported
  560. Curly infix expressions as described at
  561. http://srfi.schemers.org/srfi-105/srfi-105.html are now supported by
  562. Guile's reader. This allows users to write things like {a * {b + c}}
  563. instead of (* a (+ b c)). SRFI-105 support is enabled by using the
  564. `#!curly-infix' directive in source code, or the `curly-infix' reader
  565. option. See the manual for details.
  566. ** Reader options may now be per-port
  567. Historically, `read-options' and related procedures would manipulate
  568. global options, affecting the `read' procedure for all threads, and all
  569. current uses of `read'.
  570. Guile can now associate `read' options with specific ports, allowing
  571. different ports to use different options. For instance, the
  572. `#!fold-case' and `#!no-fold-case' reader directives have been
  573. implemented, and their effect is to modify the current read options of
  574. the current port only; similarly for `#!curly-infix'. Thus, it is
  575. possible, for instance, to have one port reading case-sensitive code,
  576. while another port reads case-insensitive code.
  577. ** Futures may now be nested
  578. Futures may now be nested: a future can itself spawn and then `touch'
  579. other futures. In addition, any thread that touches a future that has
  580. not completed now processes other futures while waiting for the touched
  581. future to completed. This allows all threads to be kept busy, and was
  582. made possible by the use of delimited continuations (see the manual for
  583. details.)
  584. Consequently, `par-map' and `par-for-each' have been rewritten and can
  585. now use all cores.
  586. ** `GUILE_LOAD_PATH' et al can now add directories to the end of the path
  587. `GUILE_LOAD_PATH' and `GUILE_LOAD_COMPILED_PATH' can now be used to add
  588. directories to both ends of the load path. If the special path
  589. component `...' (ellipsis) is present in these environment variables,
  590. then the default path is put in place of the ellipsis, otherwise the
  591. default path is placed at the end. See "Environment Variables" in the
  592. manual for details.
  593. ** `load-in-vicinity' search for `.go' files in `%load-compiled-path'
  594. Previously, `load-in-vicinity' would look for compiled files in the
  595. auto-compilation cache, but not in `%load-compiled-path'. This is now
  596. fixed. This affects `load', and the `-l' command-line flag. See
  597. <http://bugs.gnu.org/12519> for details.
  598. ** Extension search order fixed, and LD_LIBRARY_PATH preserved
  599. Up to 2.0.6, Guile would modify the `LD_LIBRARY_PATH' environment
  600. variable (or whichever is relevant for the host OS) to insert its own
  601. default extension directories in the search path (using GNU libltdl
  602. facilities was not possible here.) This approach was problematic in two
  603. ways.
  604. First, the `LD_LIBRARY_PATH' modification would be visible to
  605. sub-processes, and would also affect future calls to `dlopen', which
  606. could lead to subtle bugs in the application or sub-processes. Second,
  607. when the installation prefix is /usr, the `LD_LIBRARY_PATH' modification
  608. would typically end up inserting /usr/lib before /usr/local/lib in the
  609. search path, which is often the opposite of system-wide settings such as
  610. `ld.so.conf'.
  611. Both issues have now been fixed.
  612. ** `make-vtable-vtable' is now deprecated
  613. Programs should instead use `make-vtable' and `<standard-vtable>'.
  614. ** The `-Wduplicate-case-datum' and `-Wbad-case-datum' are enabled
  615. These recently introduced warnings have been documented and are now
  616. enabled by default when auto-compiling.
  617. ** Optimize calls to `equal?' or `eqv?' with a constant argument
  618. The compiler simplifies calls to `equal?' or `eqv?' with a constant
  619. argument to use `eq?' instead, when applicable.
  620. * Manual updates
  621. ** SRFI-9 records now documented under "Compound Data Types"
  622. The documentation of SRFI-9 record types has been moved in the "Compound
  623. Data Types", next to Guile's other record APIs. A new section
  624. introduces the various record APIs, and describes the trade-offs they
  625. make. These changes were made in an attempt to better guide users
  626. through the maze of records API, and to recommend SRFI-9 as the main
  627. API.
  628. The documentation of Guile's raw `struct' API has also been improved.
  629. ** (ice-9 and-let-star) and (ice-9 curried-definitions) now documented
  630. These modules were missing from the manual.
  631. * New interfaces
  632. ** New "functional record setters" as a GNU extension of SRFI-9
  633. The (srfi srfi-9 gnu) module now provides three new macros to deal with
  634. "updates" of immutable records: `define-immutable-record-type',
  635. `set-field', and `set-fields'.
  636. The first one allows record type "functional setters" to be defined;
  637. such setters keep the record unchanged, and instead return a new record
  638. with only one different field. The remaining macros provide the same
  639. functionality, and also optimize updates of multiple or nested fields.
  640. See the manual for details.
  641. ** web: New `http-get*', `response-body-port', and `text-content-type?'
  642. procedures
  643. These procedures return a port from which to read the response's body.
  644. Unlike `http-get' and `read-response-body', they allow the body to be
  645. processed incrementally instead of being stored entirely in memory.
  646. The `text-content-type?' predicate allows users to determine whether the
  647. content type of a response is textual.
  648. See the manual for details.
  649. ** `string-split' accepts character sets and predicates
  650. The `string-split' procedure can now be given a SRFI-14 character set or
  651. a predicate, instead of just a character.
  652. ** R6RS SRFI support
  653. Previously, in R6RS modules, Guile incorrectly ignored components of
  654. SRFI module names after the SRFI number, making it impossible to specify
  655. sub-libraries. This release corrects this, bringing us into accordance
  656. with SRFI 97.
  657. ** `define-public' is no a longer curried definition by default
  658. The (ice-9 curried-definitions) should be used for such uses. See the
  659. manual for details.
  660. * Build fixes
  661. ** Remove reference to `scm_init_popen' when `fork' is unavailable
  662. This fixes a MinGW build issue (http://bugs.gnu.org/12477).
  663. ** Fix race between installing `guild' and the `guile-tools' symlink
  664. * Bug fixes
  665. ** Procedures returned by `eval' now have docstrings
  666. (http://bugs.gnu.org/12173)
  667. ** web client: correctly handle uri-query, etc. in relative URI headers
  668. (http://bugs.gnu.org/12827)
  669. ** Fix docs for R6RS `hashtable-copy'
  670. ** R6RS `string-for-each' now accepts multiple string arguments
  671. ** Fix out-of-range error in the compiler's CSE pass
  672. (http://bugs.gnu.org/12883)
  673. ** Add missing R6RS `open-file-input/output-port' procedure
  674. ** Futures: Avoid creating the worker pool more than once
  675. ** Fix invalid assertion about mutex ownership in threads.c
  676. (http://bugs.gnu.org/12719)
  677. ** Have `SCM_NUM2FLOAT' and `SCM_NUM2DOUBLE' use `scm_to_double'
  678. ** The `scandir' procedure now uses `lstat' instead of `stat'
  679. ** Fix `generalized-vector->list' indexing bug with shared arrays
  680. (http://bugs.gnu.org/12465)
  681. ** web: Change `http-get' to try all the addresses for the given URI
  682. ** Implement `hash' for structs
  683. (http://lists.gnu.org/archive/html/guile-devel/2012-10/msg00031.html)
  684. ** `read' now adds source properties for data types beyond pairs
  685. ** Improve error reporting in `append!'
  686. ** In fold-matches, set regexp/notbol unless matching string start
  687. ** Don't stat(2) and access(2) the .go location before using it
  688. ** SRFI-19: use zero padding for hours in ISO 8601 format, not blanks
  689. ** web: Fix uri-encoding for strings with no unreserved chars, and octets 0-15
  690. ** More robust texinfo alias handling
  691. ** Optimize `format' and `simple-format'
  692. (http://bugs.gnu.org/12033)
  693. ** Angle of -0.0 is pi, not zero
  694. Changes in 2.0.6 (since 2.0.5):
  695. * Notable changes
  696. ** New optimization pass: common subexpression elimination (CSE)
  697. Guile's optimizer will now run a CSE pass after partial evaluation.
  698. This pass propagates static information about branches taken, bound
  699. lexicals, and effects from an expression's dominators. It can replace
  700. common subexpressions with their boolean values (potentially enabling
  701. dead code elimination), equivalent bound lexicals, or it can elide them
  702. entirely, depending on the context in which they are executed. This
  703. pass is especially useful in removing duplicate type checks, such as
  704. those produced by SRFI-9 record accessors.
  705. ** Improvements to the partial evaluator
  706. Peval can now hoist tests that are common to both branches of a
  707. conditional into the test. This can help with long chains of
  708. conditionals, such as those generated by the `match' macro. Peval can
  709. now do simple beta-reductions of procedures with rest arguments. It
  710. also avoids residualizing degenerate lexical aliases, even when full
  711. inlining is not possible. Finally, peval now uses the effects analysis
  712. introduced for the CSE pass. More precise effects analysis allows peval
  713. to move more code.
  714. ** Run finalizers asynchronously in asyncs
  715. Finalizers are now run asynchronously, via an async. See Asyncs in the
  716. manual. This allows Guile and user code to safely allocate memory while
  717. holding a mutex.
  718. ** Update SRFI-14 character sets to Unicode 6.1
  719. Note that this update causes the Latin-1 characters `§' and `¶' to be
  720. reclassified as punctuation. They were previously considered to be part
  721. of `char-set:symbol'.
  722. ** Better source information for datums
  723. When the `positions' reader option is on, as it is by default, Guile's
  724. reader will record source information for more kinds of datums.
  725. ** Improved error and warning messages
  726. `syntax-violation' errors now prefer `subform' for source info, with
  727. `form' as fallback. Syntactic errors in `cond' and `case' now produce
  728. better errors. `case' can now warn on duplicate datums, or datums that
  729. cannot be usefully compared with `eqv?'. `-Warity-mismatch' now handles
  730. applicable structs. `-Wformat' is more robust in the presence of
  731. `gettext'. Finally, various exceptions thrown by the Web modules now
  732. define appropriate exception printers.
  733. ** A few important bug fixes in the HTTP modules.
  734. Guile's web server framework now checks if an application returns a body
  735. where it is not permitted, for example in response to a HEAD request,
  736. and warn or truncate the response as appropriate. Bad requests now
  737. cause a 400 Bad Request response to be printed before closing the port.
  738. Finally, some date-printing and URL-parsing bugs were fixed.
  739. ** Pretty-print improvements
  740. When Guile needs to pretty-print Tree-IL, it will try to reconstruct
  741. `cond', `or`, and other derived syntax forms from the primitive tree-IL
  742. forms. It also uses the original names instead of the fresh unique
  743. names, when it is unambiguous to do so. This can be seen in the output
  744. of REPL commands like `,optimize'.
  745. Also, the `pretty-print' procedure has a new keyword argument,
  746. `#:max-expr-width'.
  747. ** Fix memory leak involving applicable SMOBs
  748. At some point in the 1.9.x series, Guile began leaking any applicable
  749. SMOB that was actually applied. (There was a weak-key map from SMOB to
  750. trampoline functions, where the value had a strong reference on the
  751. key.) This has been fixed. There was much rejoicing!
  752. ** Support for HTTP/1.1 chunked transfer coding
  753. See "Transfer Codings" in the manual, for more.
  754. ** Micro-optimizations
  755. A pile of micro-optimizations: the `string-trim' function when called
  756. with `char-set:whitespace'; the `(web http)' parsers; SMOB application;
  757. conversion of raw UTF-8 and UTF-32 data to and from SCM strings; vlists
  758. and vhashes; `read' when processing string literals.
  759. ** Incompatible change to `scandir'
  760. As was the original intention, `scandir' now runs the `select?'
  761. procedure on all items, including subdirectories and the `.' and `..'
  762. entries. It receives the basename of the file in question instead of
  763. the full name. We apologize for this incompatible change to this
  764. function introduced in the 2.0.4 release.
  765. * Manual updates
  766. The manual has been made much more consistent in its naming conventions
  767. with regards to formal parameters of functions. Thanks to Bake Timmons.
  768. * New interfaces
  769. ** New C function: `scm_to_pointer'
  770. ** New C inline functions: `scm_new_smob', `scm_new_double_smob'
  771. ** (ice-9 format): Add ~h specifier for localized number output.
  772. ** (web response): New procedure: `response-must-not-include-body?'
  773. ** New predicate: 'supports-source-properties?'
  774. ** New C helpers: `scm_c_values', `scm_c_nvalues'
  775. ** Newly public inline C function: `scm_unget_byte'
  776. ** (language tree-il): New functions: `tree-il=?', `tree-il-hash'
  777. ** New fluid: `%default-port-conversion-strategy'
  778. ** New syntax: `=>' within `case'
  779. ** (web http): `make-chunked-input-port', `make-chunked-output-port'
  780. ** (web http): `declare-opaque-header!'
  781. Search the manual for these identifiers, for more information.
  782. * New deprecations
  783. ** `close-io-port' deprecated
  784. Use `close-port'.
  785. ** `scm_sym2var' deprecated
  786. In most cases, replace with `scm_lookup' or `scm_module_variable'. Use
  787. `scm_define' or `scm_module_ensure_local_variable' if the second
  788. argument is nonzero. See "Accessing Modules from C" in the manual, for
  789. full details.
  790. ** Lookup closures deprecated
  791. These were never documented. See "Module System Reflection" in the
  792. manual for replacements.
  793. * Build fixes
  794. ** Fix compilation against uninstalled Guile on non-GNU platforms.
  795. ** Fix `SCM_I_ERROR' definition for MinGW without networking.
  796. ** Fix compilation with the Sun C compiler.
  797. ** Fix check for `clock_gettime' on OpenBSD and some other systems.
  798. ** Fix build with --enable-debug-malloc.
  799. ** Honor $(program_transform_name) for the `guile-tools' symlink.
  800. ** Fix cross-compilation of GOOPS-using code.
  801. * Bug fixes
  802. ** Fix use of unitialized stat buffer in search-path of absolute paths.
  803. ** Avoid calling `freelocale' with a NULL argument.
  804. ** Work around erroneous tr_TR locale in Darwin 8 in tests.
  805. ** Fix `getaddrinfo' test for Darwin 8.
  806. ** Use Gnulib's `regex' module for better regex portability.
  807. ** `source-properties' and friends work on any object
  808. ** Rewrite open-process in C, for robustness related to threads and fork
  809. ** Fix <TAG>vector-length when applied to other uniform vector types
  810. ** Fix escape-only prompt optimization (was disabled previously)
  811. ** Fix a segfault when /dev/urandom is not accessible
  812. ** Fix flush on soft ports, so that it actually runs.
  813. ** Better compatibility of SRFI-9 records with core records
  814. ** Fix and clarify documentation of `sorted?'.
  815. ** Fix IEEE-754 endianness conversion in bytevectors.
  816. ** Correct thunk check in the `wind' instruction.
  817. ** Add @acronym support to texinfo modules
  818. ** Fix docbook->texi for <ulink> without URL
  819. ** Fix `setvbuf' to leave the line/column number unchanged.
  820. ** Add missing public declaration for `scm_take_from_input_buffers'.
  821. ** Fix relative file name canonicalization with empty %LOAD-PATH entries.
  822. ** Import newer (ice-9 match) from Chibi-Scheme.
  823. ** Fix unbound variables and unbound values in ECMAScript runtime.
  824. ** Make SRFI-6 string ports Unicode-capable.
  825. Changes in 2.0.5 (since 2.0.4):
  826. This release fixes the binary interface information (SONAME) of
  827. libguile, which was incorrect in 2.0.4. It does not contain other
  828. changes.
  829. Changes in 2.0.4 (since 2.0.3):
  830. * Notable changes
  831. ** Better debuggability for interpreted procedures.
  832. Guile 2.0 came with a great debugging experience for compiled
  833. procedures, but the story for interpreted procedures was terrible. Now,
  834. at least, interpreted procedures have names, and the `arity' procedure
  835. property is always correct (or, as correct as it can be, in the presence
  836. of `case-lambda').
  837. ** Support for cross-compilation.
  838. One can now use a native Guile to cross-compile `.go' files for a
  839. different architecture. See the documentation for `--target' in the
  840. "Compilation" section of the manual, for information on how to use the
  841. cross-compiler. See the "Cross building Guile" section of the README,
  842. for more on how to cross-compile Guile itself.
  843. ** The return of `local-eval'.
  844. Back by popular demand, `the-environment' and `local-eval' allow the
  845. user to capture a lexical environment, and then evaluate arbitrary
  846. expressions in that context. There is also a new `local-compile'
  847. command. See "Local Evaluation" in the manual, for more. Special
  848. thanks to Mark Weaver for an initial implementation of this feature.
  849. ** Fluids can now have default values.
  850. Fluids are used for dynamic and thread-local binding. They have always
  851. inherited their values from the context or thread that created them.
  852. However, there was a case in which a new thread would enter Guile, and
  853. the default values of all the fluids would be `#f' for that thread.
  854. This has now been fixed so that `make-fluid' has an optional default
  855. value for fluids in unrelated dynamic roots, which defaults to `#f'.
  856. ** Garbage collector tuning.
  857. The garbage collector has now been tuned to run more often under some
  858. circumstances.
  859. *** Unmanaged allocation
  860. The new `scm_gc_register_allocation' function will notify the collector
  861. of unmanaged allocation. This will cause the collector to run sooner.
  862. Guile's `scm_malloc', `scm_calloc', and `scm_realloc' unmanaged
  863. allocators eventually call this function. This leads to better
  864. performance under steady-state unmanaged allocation.
  865. *** Transient allocation
  866. When the collector runs, it will try to record the total memory
  867. footprint of a process, if the platform supports this information. If
  868. the memory footprint is growing, the collector will run more frequently.
  869. This reduces the increase of the resident size of a process in response
  870. to a transient increase in allocation.
  871. *** Management of threads, bignums
  872. Creating a thread will allocate a fair amount of memory. Guile now does
  873. some GC work (using `GC_collect_a_little') when allocating a thread.
  874. This leads to a better memory footprint when creating many short-lived
  875. threads.
  876. Similarly, bignums can occupy a lot of memory. Guile now offers hooks
  877. to enable custom GMP allocators that end up calling
  878. `scm_gc_register_allocation'. These allocators are enabled by default
  879. when running Guile from the command-line. To enable them in libraries,
  880. set the `scm_install_gmp_memory_functions' variable to a nonzero value
  881. before loading Guile.
  882. ** SRFI-39 parameters are available by default.
  883. Guile now includes support for parameters, as defined by SRFI-39, in the
  884. default environment. See "Parameters" in the manual, for more
  885. information. `current-input-port', `current-output-port', and
  886. `current-error-port' are now parameters.
  887. ** Add `current-warning-port'.
  888. Guile now outputs warnings on a separate port, `current-warning-port',
  889. initialized to the value that `current-error-port' has on startup.
  890. ** Syntax parameters.
  891. Following Racket's lead, Guile now supports syntax parameters. See
  892. "Syntax parameters" in the manual, for more.
  893. Also see Barzilay, Culpepper, and Flatt's 2011 SFP workshop paper,
  894. "Keeping it Clean with syntax-parameterize".
  895. ** Parse command-line arguments from the locale encoding.
  896. Guile now attempts to parse command-line arguments using the user's
  897. locale. However for backwards compatibility with other 2.0.x releases,
  898. it does so without actually calling `setlocale'. Please report any bugs
  899. in this facility to bug-guile@gnu.org.
  900. ** One-armed conditionals: `when' and `unless'
  901. Guile finally has `when' and `unless' in the default environment. Use
  902. them whenever you would use an `if' with only one branch. See
  903. "Conditionals" in the manual, for more.
  904. ** `current-filename', `add-to-load-path'
  905. There is a new form, `(current-filename)', which expands out to the
  906. source file in which it occurs. Combined with the new
  907. `add-to-load-path', this allows simple scripts to easily add nearby
  908. directories to the load path. See "Load Paths" in the manual, for more.
  909. ** `random-state-from-platform'
  910. This procedure initializes a random seed using good random sources
  911. available on your platform, such as /dev/urandom. See "Random Number
  912. Generation" in the manual, for more.
  913. ** Warn about unsupported `simple-format' options.
  914. The `-Wformat' compilation option now reports unsupported format options
  915. passed to `simple-format'.
  916. ** Manual updates
  917. Besides the sections already mentioned, the following manual sections
  918. are new in this release: "Modules and the File System", "Module System
  919. Reflection", "Syntax Transformer Helpers", and "Local Inclusion".
  920. * New interfaces
  921. ** (ice-9 session): `apropos-hook'
  922. ** New print option: `escape-newlines', defaults to #t.
  923. ** (ice-9 ftw): `file-system-fold', `file-system-tree', `scandir'
  924. ** `scm_c_value_ref': access to multiple returned values from C
  925. ** scm_call (a varargs version), scm_call_7, scm_call_8, scm_call_9
  926. ** Some new syntax helpers in (system syntax)
  927. Search the manual for these identifiers and modules, for more.
  928. * Build fixes
  929. ** FreeBSD build fixes.
  930. ** OpenBSD compilation fixes.
  931. ** Solaris 2.10 test suite fixes.
  932. ** IA64 compilation fix.
  933. ** MinGW build fixes.
  934. ** Work around instruction reordering on SPARC and HPPA in the VM.
  935. ** Gnulib updates: added `dirfd', `setenv' modules.
  936. * Bug fixes
  937. ** Add a deprecated alias for $expt.
  938. ** Add an exception printer for `getaddrinfo-error'.
  939. ** Add deprecated shim for `scm_display_error' with stack as first argument.
  940. ** Add warnings for unsupported `simple-format' options.
  941. ** Allow overlapping regions to be passed to `bytevector-copy!'.
  942. ** Better function prologue disassembly
  943. ** Compiler: fix miscompilation of (values foo ...) in some contexts.
  944. ** Compiler: fix serialization of #nil-terminated lists.
  945. ** Compiler: allow values bound in non-tail let expressions to be collected.
  946. ** Deprecate SCM_ASRTGO.
  947. ** Document invalidity of (begin) as expression; add back-compat shim.
  948. ** Don't leak file descriptors when mmaping objcode.
  949. ** Empty substrings no longer reference the original stringbuf.
  950. ** FFI: Fix `set-pointer-finalizer!' to leave the type cell unchanged.
  951. ** FFI: Hold a weak reference to the CIF made by `procedure->pointer'.
  952. ** FFI: Hold a weak reference to the procedure passed to `procedure->pointer'.
  953. ** FFI: Properly unpack small integer return values in closure call.
  954. ** Fix R6RS `fold-left' so the accumulator is the first argument.
  955. ** Fix bit-set*! bug from 2005.
  956. ** Fix bug in `make-repl' when `lang' is actually a <language>.
  957. ** Fix bugs related to mutation, the null string, and shared substrings.
  958. ** Fix <dynwind> serialization.
  959. ** Fix erroneous check in `set-procedure-properties!'.
  960. ** Fix generalized-vector-{ref,set!} for slices.
  961. ** Fix error messages involving definition forms.
  962. ** Fix primitive-eval to return #<unspecified> for definitions.
  963. ** HTTP: Extend handling of "Cache-Control" header.
  964. ** HTTP: Fix qstring writing of cache-extension values
  965. ** HTTP: Fix validators for various list-style headers.
  966. ** HTTP: Permit non-date values for Expires header.
  967. ** HTTP: `write-request-line' writes absolute paths, not absolute URIs.
  968. ** Hack the port-column of current-output-port after printing a prompt.
  969. ** Make sure `regexp-quote' tests use Unicode-capable string ports.
  970. ** Peval: Fix bugs in the new optimizer.
  971. ** Statistically unique marks and labels, for robust hygiene across sessions.
  972. ** Web: Allow URIs with empty authorities, like "file:///etc/hosts".
  973. ** `,language' at REPL sets the current-language fluid.
  974. ** `primitive-load' returns the value(s) of the last expression.
  975. ** `scm_from_stringn' always returns unique strings.
  976. ** `scm_i_substring_copy' tries to narrow the substring.
  977. ** i18n: Fix gc_malloc/free mismatch on non-GNU systems.
  978. Changes in 2.0.3 (since 2.0.2):
  979. * Speed improvements
  980. ** Guile has a new optimizer, `peval'.
  981. `Peval' is a partial evaluator that performs constant folding, dead code
  982. elimination, copy propagation, and inlining. By default it runs on
  983. every piece of code that Guile compiles, to fold computations that can
  984. happen at compile-time, so they don't have to happen at runtime.
  985. If we did our job right, the only impact you would see would be your
  986. programs getting faster. But if you notice slowdowns or bloated code,
  987. please send a mail to bug-guile@gnu.org with details.
  988. Thanks to William R. Cook, Oscar Waddell, and Kent Dybvig for inspiring
  989. peval and its implementation.
  990. You can see what peval does on a given piece of code by running the new
  991. `,optimize' REPL meta-command, and comparing it to the output of
  992. `,expand'. See "Compile Commands" in the manual, for more.
  993. ** Fewer calls to `stat'.
  994. Guile now stats only the .go file and the .scm file when loading a fresh
  995. compiled file.
  996. * Notable changes
  997. ** New module: `(web client)', a simple synchronous web client.
  998. See "Web Client" in the manual, for more.
  999. ** Users can now install compiled `.go' files.
  1000. See "Installing Site Packages" in the manual.
  1001. ** Remove Front-Cover and Back-Cover text from the manual.
  1002. The manual is still under the GNU Free Documentation License, but no
  1003. longer has any invariant sections.
  1004. ** More helpful `guild help'.
  1005. `guild' is Guile's multi-tool, for use in shell scripting. Now it has a
  1006. nicer interface for querying the set of existing commands, and getting
  1007. help on those commands. Try it out and see!
  1008. ** New macro: `define-syntax-rule'
  1009. `define-syntax-rule' is a shorthand to make a `syntax-rules' macro with
  1010. one clause. See "Syntax Rules" in the manual, for more.
  1011. ** The `,time' REPL meta-command now has more precision.
  1012. The output of this command now has microsecond precision, instead of
  1013. 10-millisecond precision.
  1014. ** `(ice-9 match)' can now match records.
  1015. See "Pattern Matching" in the manual, for more on matching records.
  1016. ** New module: `(language tree-il debug)'.
  1017. This module provides a tree-il verifier. This is useful for people that
  1018. generate tree-il, usually as part of a language compiler.
  1019. ** New functions: `scm_is_exact', `scm_is_inexact'.
  1020. These provide a nice C interface for Scheme's `exact?' and `inexact?',
  1021. respectively.
  1022. * Bugs fixed
  1023. See the git log (or the ChangeLog) for more details on these bugs.
  1024. ** Fix order of importing modules and resolving duplicates handlers.
  1025. ** Fix a number of bugs involving extended (merged) generics.
  1026. ** Fix invocation of merge-generics duplicate handler.
  1027. ** Fix write beyond array end in arrays.c.
  1028. ** Fix read beyond end of hashtable size array in hashtab.c.
  1029. ** (web http): Locale-independent parsing and serialization of dates.
  1030. ** Ensure presence of Host header in HTTP/1.1 requests.
  1031. ** Fix take-right and drop-right for improper lists.
  1032. ** Fix leak in get_current_locale().
  1033. ** Fix recursive define-inlinable expansions.
  1034. ** Check that srfi-1 procedure arguments are procedures.
  1035. ** Fix r6rs `map' for multiple returns.
  1036. ** Fix scm_tmpfile leak on POSIX platforms.
  1037. ** Fix a couple of leaks (objcode->bytecode, make-boot-program).
  1038. ** Fix guile-lib back-compatibility for module-stexi-documentation.
  1039. ** Fix --listen option to allow other ports.
  1040. ** Fix scm_to_latin1_stringn for substrings.
  1041. ** Fix compilation of untyped arrays of rank not 1.
  1042. ** Fix unparse-tree-il of <dynset>.
  1043. ** Fix reading of #||||#.
  1044. ** Fix segfault in GOOPS when class fields are redefined.
  1045. ** Prefer poll(2) over select(2) to allow file descriptors above FD_SETSIZE.
  1046. Changes in 2.0.2 (since 2.0.1):
  1047. * Notable changes
  1048. ** `guile-tools' renamed to `guild'
  1049. The new name is shorter. Its intended future use is for a CPAN-like
  1050. system for Guile wizards and journeyfolk to band together to share code;
  1051. hence the name. `guile-tools' is provided as a backward-compatible
  1052. symbolic link. See "Using Guile Tools" in the manual, for more.
  1053. ** New control operators: `shift' and `reset'
  1054. See "Shift and Reset" in the manual, for more information.
  1055. ** `while' as an expression
  1056. Previously the return value of `while' was unspecified. Now its
  1057. values are specified both in the case of normal termination, and via
  1058. termination by invoking `break', possibly with arguments. See "while
  1059. do" in the manual for more.
  1060. ** Disallow access to handles of weak hash tables
  1061. `hash-get-handle' and `hash-create-handle!' are no longer permitted to
  1062. be called on weak hash tables, because the fields in a weak handle could
  1063. be nulled out by the garbage collector at any time, but yet they are
  1064. otherwise indistinguishable from pairs. Use `hash-ref' and `hash-set!'
  1065. instead.
  1066. ** More precision for `get-internal-run-time', `get-internal-real-time'
  1067. On 64-bit systems which support POSIX clocks, Guile's internal timing
  1068. procedures offer nanosecond resolution instead of the 10-millisecond
  1069. resolution previously available. 32-bit systems now use 1-millisecond
  1070. timers.
  1071. ** Guile now measures time spent in GC
  1072. `gc-stats' now returns a meaningful value for `gc-time-taken'.
  1073. ** Add `gcprof'
  1074. The statprof profiler now exports a `gcprof' procedure, driven by the
  1075. `after-gc-hook', to see which parts of your program are causing GC. Let
  1076. us know if you find it useful.
  1077. ** `map', `for-each' and some others now implemented in Scheme
  1078. We would not mention this in NEWS, as it is not a user-visible change,
  1079. if it were not for one thing: `map' and `for-each' are no longer
  1080. primitive generics. Instead they are normal bindings, which can be
  1081. wrapped by normal generics. This fixes some modularity issues between
  1082. core `map', SRFI-1 `map', and GOOPS.
  1083. Also it's pretty cool that we can do this without a performance impact.
  1084. ** Add `scm_peek_byte_or_eof'.
  1085. This helper is like `scm_peek_char_or_eof', but for bytes instead of
  1086. full characters.
  1087. ** Implement #:stop-at-first-non-option option for getopt-long
  1088. See "getopt-long Reference" in the manual, for more information.
  1089. ** Improve R6RS conformance for conditions in the I/O libraries
  1090. The `(rnrs io simple)' module now raises the correct R6RS conditions in
  1091. error cases. `(rnrs io ports)' is also more correct now, though it is
  1092. still a work in progress.
  1093. ** All deprecated routines emit warnings
  1094. A few deprecated routines were lacking deprecation warnings. This has
  1095. been fixed now.
  1096. * Speed improvements
  1097. ** Constants in compiled code now share state better
  1098. Constants with shared state, like `("foo")' and `"foo"', now share state
  1099. as much as possible, in the entire compilation unit. This cuts compiled
  1100. `.go' file sizes in half, generally, and speeds startup.
  1101. ** VLists: optimize `vlist-fold-right', and add `vhash-fold-right'
  1102. These procedures are now twice as fast as they were.
  1103. ** UTF-8 ports to bypass `iconv' entirely
  1104. This reduces memory usage in a very common case.
  1105. ** Compiler speedups
  1106. The compiler is now about 40% faster. (Note that this is only the case
  1107. once the compiler is itself compiled, so the build still takes as long
  1108. as it did before.)
  1109. ** VM speed tuning
  1110. Some assertions that were mostly useful for sanity-checks on the
  1111. bytecode compiler are now off for both "regular" and "debug" engines.
  1112. This together with a fix to cache a TLS access and some other tweaks
  1113. improve the VM's performance by about 20%.
  1114. ** SRFI-1 list-set optimizations
  1115. lset-adjoin and lset-union now have fast paths for eq? sets.
  1116. ** `memq', `memv' optimizations
  1117. These procedures are now at least twice as fast than in 2.0.1.
  1118. * Deprecations
  1119. ** Deprecate scm_whash API
  1120. `scm_whash_get_handle', `SCM_WHASHFOUNDP', `SCM_WHASHREF',
  1121. `SCM_WHASHSET', `scm_whash_create_handle', `scm_whash_lookup', and
  1122. `scm_whash_insert' are now deprecated. Use the normal hash table API
  1123. instead.
  1124. ** Deprecate scm_struct_table
  1125. `SCM_STRUCT_TABLE_NAME', `SCM_SET_STRUCT_TABLE_NAME',
  1126. `SCM_STRUCT_TABLE_CLASS', `SCM_SET_STRUCT_TABLE_CLASS',
  1127. `scm_struct_table', and `scm_struct_create_handle' are now deprecated.
  1128. These routines formed part of the internals of the map between structs
  1129. and classes.
  1130. ** Deprecate scm_internal_dynamic_wind
  1131. The `scm_t_inner' type and `scm_internal_dynamic_wind' are deprecated,
  1132. as the `scm_dynwind' API is better, and this API encourages users to
  1133. stuff SCM values into pointers.
  1134. ** Deprecate scm_immutable_cell, scm_immutable_double_cell
  1135. These routines are deprecated, as the GC_STUBBORN API doesn't do
  1136. anything any more.
  1137. * Manual updates
  1138. Andreas Rottman kindly transcribed the missing parts of the `(rnrs io
  1139. ports)' documentation from the R6RS documentation. Thanks Andreas!
  1140. * Bugs fixed
  1141. ** Fix double-loading of script in -ds case
  1142. ** -x error message fix
  1143. ** iconveh-related cross-compilation fixes
  1144. ** Fix small integer return value packing on big endian machines.
  1145. ** Fix hash-set! in weak-value table from non-immediate to immediate
  1146. ** Fix call-with-input-file & relatives for multiple values
  1147. ** Fix `hash' for inf and nan
  1148. ** Fix libguile internal type errors caught by typing-strictness==2
  1149. ** Fix compile error in MinGW fstat socket detection
  1150. ** Fix generation of auto-compiled file names on MinGW
  1151. ** Fix multithreaded access to internal hash tables
  1152. ** Emit a 1-based line number in error messages
  1153. ** Fix define-module ordering
  1154. ** Fix several POSIX functions to use the locale encoding
  1155. ** Add type and range checks to the complex generalized vector accessors
  1156. ** Fix unaligned accesses for bytevectors of complex numbers
  1157. ** Fix '(a #{.} b)
  1158. ** Fix erroneous VM stack overflow for canceled threads
  1159. Changes in 2.0.1 (since 2.0.0):
  1160. * Notable changes
  1161. ** guile.m4 supports linking with rpath
  1162. The GUILE_FLAGS macro now sets GUILE_LIBS and GUILE_LTLIBS, which
  1163. include appropriate directives to the linker to include libguile-2.0.so
  1164. in the runtime library lookup path.
  1165. ** `begin' expands macros in its body before other expressions
  1166. This enables support for programs like the following:
  1167. (begin
  1168. (define even?
  1169. (lambda (x)
  1170. (or (= x 0) (odd? (- x 1)))))
  1171. (define-syntax odd?
  1172. (syntax-rules ()
  1173. ((odd? x) (not (even? x)))))
  1174. (even? 10))
  1175. ** REPL reader usability enhancements
  1176. The REPL now flushes input after a read error, which should prevent one
  1177. error from causing other errors. The REPL also now interprets comments
  1178. as whitespace.
  1179. ** REPL output has configurable width
  1180. The REPL now defaults to output with the current terminal's width, in
  1181. columns. See "Debug Commands" in the manual for more information on
  1182. the ,width command.
  1183. ** Better C access to the module system
  1184. Guile now has convenient C accessors to look up variables or values in
  1185. modules and their public interfaces. See `scm_c_public_ref' and friends
  1186. in "Accessing Modules from C" in the manual.
  1187. ** Added `scm_call_5', `scm_call_6'
  1188. See "Fly Evaluation" in the manual.
  1189. ** Added `scm_from_latin1_keyword', `scm_from_utf8_keyword'
  1190. See "Keyword Procedures" in the manual, for more. Note that
  1191. `scm_from_locale_keyword' should not be used when the name is a C string
  1192. constant.
  1193. ** R6RS unicode and string I/O work
  1194. Added efficient implementations of `get-string-n' and `get-string-n!'
  1195. for binary ports. Exported `current-input-port', `current-output-port'
  1196. and `current-error-port' from `(rnrs io ports)', and enhanced support
  1197. for transcoders.
  1198. ** Added `pointer->scm', `scm->pointer' to `(system foreign)'
  1199. These procedure are useful if one needs to pass and receive SCM values
  1200. to and from foreign functions. See "Foreign Variables" in the manual,
  1201. for more.
  1202. ** Added `heap-allocated-since-gc' to `(gc-stats)'
  1203. Also fixed the long-standing bug in the REPL `,stat' command.
  1204. ** Add `on-error' REPL option
  1205. This option controls what happens when an error occurs at the REPL, and
  1206. defaults to `debug', indicating that Guile should enter the debugger.
  1207. Other values include `report', which will simply print a backtrace
  1208. without entering the debugger. See "System Commands" in the manual.
  1209. ** Enforce immutability of string literals
  1210. Attempting to mutate a string literal now causes a runtime error.
  1211. ** Fix pthread redirection
  1212. Guile 2.0.0 shipped with headers that, if configured with pthread
  1213. support, would re-define `pthread_create', `pthread_join', and other API
  1214. to redirect to the BDW-GC wrappers, `GC_pthread_create', etc. This was
  1215. unintended, and not necessary: because threads must enter Guile with
  1216. `scm_with_guile', Guile can handle thread registration itself, without
  1217. needing to make the GC aware of all threads. This oversight has been
  1218. fixed.
  1219. ** `with-continuation-barrier' now unwinds on `quit'
  1220. A throw to `quit' in a continuation barrier will cause Guile to exit.
  1221. Before, it would do so before unwinding to the barrier, which would
  1222. prevent cleanup handlers from running. This has been fixed so that it
  1223. exits only after unwinding.
  1224. ** `string->pointer' and `pointer->string' have optional encoding arg
  1225. This allows users of the FFI to more easily deal in strings with
  1226. particular (non-locale) encodings, like "utf-8". See "Void Pointers and
  1227. Byte Access" in the manual, for more.
  1228. ** R6RS fixnum arithmetic optimizations
  1229. R6RS fixnum operations are are still slower than generic arithmetic,
  1230. however.
  1231. ** New procedure: `define-inlinable'
  1232. See "Inlinable Procedures" in the manual, for more.
  1233. ** New procedure: `exact-integer-sqrt'
  1234. See "Integer Operations" in the manual, for more.
  1235. ** "Extended read syntax" for symbols parses better
  1236. In #{foo}# symbols, backslashes are now treated as escapes, as the
  1237. symbol-printing code intended. Additionally, "\x" within #{foo}# is now
  1238. interpreted as starting an R6RS hex escape. This is backward compatible
  1239. because the symbol printer would never produce a "\x" before. The
  1240. printer also works better too.
  1241. ** Added `--fresh-auto-compile' option
  1242. This allows a user to invalidate the auto-compilation cache. It's
  1243. usually not needed. See "Compilation" in the manual, for a discussion.
  1244. * Manual updates
  1245. ** GOOPS documentation updates
  1246. ** New man page
  1247. Thanks to Mark Harig for improvements to guile.1.
  1248. ** SRFI-23 documented
  1249. The humble `error' SRFI now has an entry in the manual.
  1250. * New modules
  1251. ** `(ice-9 binary-ports)': "R6RS I/O Ports", in the manual
  1252. ** `(ice-9 eval-string)': "Fly Evaluation", in the manual
  1253. ** `(ice-9 command-line)', not documented yet
  1254. * Bugs fixed
  1255. ** Fixed `iconv_t' memory leak on close-port
  1256. ** Fixed some leaks with weak hash tables
  1257. ** Export `vhash-delq' and `vhash-delv' from `(ice-9 vlist)'
  1258. ** `after-gc-hook' works again
  1259. ** `define-record-type' now allowed in nested contexts
  1260. ** `exact-integer-sqrt' now handles large integers correctly
  1261. ** Fixed C extension examples in manual
  1262. ** `vhash-delete' honors HASH argument
  1263. ** Make `locale-digit-grouping' more robust
  1264. ** Default exception printer robustness fixes
  1265. ** Fix presence of non-I CPPFLAGS in `guile-2.0.pc'
  1266. ** `read' updates line/column numbers when reading SCSH block comments
  1267. ** Fix imports of multiple custom interfaces of same module
  1268. ** Fix encoding scanning for non-seekable ports
  1269. ** Fix `setter' when called with a non-setter generic
  1270. ** Fix f32 and f64 bytevectors to not accept rationals
  1271. ** Fix description of the R6RS `finite?' in manual
  1272. ** Quotient, remainder and modulo accept inexact integers again
  1273. ** Fix `continue' within `while' to take zero arguments
  1274. ** Fix alignment for structures in FFI
  1275. ** Fix port-filename of stdin, stdout, stderr to match the docs
  1276. ** Fix weak hash table-related bug in `define-wrapped-pointer-type'
  1277. ** Fix partial continuation application with pending procedure calls
  1278. ** scm_{to,from}_locale_string use current locale, not current ports
  1279. ** Fix thread cleanup, by using a pthread_key destructor
  1280. ** Fix `quit' at the REPL
  1281. ** Fix a failure to sync regs in vm bytevector ops
  1282. ** Fix (texinfo reflection) to handle nested structures like syntax patterns
  1283. ** Fix stexi->html double translation
  1284. ** Fix tree-il->scheme fix for <prompt>
  1285. ** Fix compilation of <prompt> in <fix> in single-value context
  1286. ** Fix race condition in ensure-writable-dir
  1287. ** Fix error message on ,disassemble "non-procedure"
  1288. ** Fix prompt and abort with the boot evaluator
  1289. ** Fix `procedure->pointer' for functions returning `void'
  1290. ** Fix error reporting in dynamic-pointer
  1291. ** Fix problems detecting coding: in block comments
  1292. ** Fix duplicate load-path and load-compiled-path in compilation environment
  1293. ** Add fallback read(2) suppport for .go files if mmap(2) unavailable
  1294. ** Fix c32vector-set!, c64vector-set!
  1295. ** Fix mistakenly deprecated read syntax for uniform complex vectors
  1296. ** Fix parsing of exact numbers with negative exponents
  1297. ** Ignore SIGPIPE in (system repl server)
  1298. ** Fix optional second arg to R6RS log function
  1299. ** Fix R6RS `assert' to return true value.
  1300. ** Fix fencepost error when seeking in bytevector input ports
  1301. ** Gracefully handle `setlocale' errors when starting the REPL
  1302. ** Improve support of the `--disable-posix' configure option
  1303. ** Make sure R6RS binary ports pass `binary-port?' regardless of the locale
  1304. ** Gracefully handle unterminated UTF-8 sequences instead of hitting an `assert'
  1305. Changes in 2.0.0 (changes since the 1.8.x series):
  1306. * New modules (see the manual for details)
  1307. ** `(srfi srfi-18)', more sophisticated multithreading support
  1308. ** `(srfi srfi-27)', sources of random bits
  1309. ** `(srfi srfi-38)', External Representation for Data With Shared Structure
  1310. ** `(srfi srfi-42)', eager comprehensions
  1311. ** `(srfi srfi-45)', primitives for expressing iterative lazy algorithms
  1312. ** `(srfi srfi-67)', compare procedures
  1313. ** `(ice-9 i18n)', internationalization support
  1314. ** `(ice-9 futures)', fine-grain parallelism
  1315. ** `(rnrs bytevectors)', the R6RS bytevector API
  1316. ** `(rnrs io ports)', a subset of the R6RS I/O port API
  1317. ** `(system xref)', a cross-referencing facility (FIXME undocumented)
  1318. ** `(ice-9 vlist)', lists with constant-time random access; hash lists
  1319. ** `(system foreign)', foreign function interface
  1320. ** `(sxml match)', a pattern matcher for SXML
  1321. ** `(srfi srfi-9 gnu)', extensions to the SRFI-9 record library
  1322. ** `(system vm coverage)', a line-by-line code coverage library
  1323. ** `(web uri)', URI data type, parser, and unparser
  1324. ** `(web http)', HTTP header parsers and unparsers
  1325. ** `(web request)', HTTP request data type, reader, and writer
  1326. ** `(web response)', HTTP response data type, reader, and writer
  1327. ** `(web server)', Generic HTTP server
  1328. ** `(ice-9 poll)', a poll wrapper
  1329. ** `(web server http)', HTTP-over-TCP web server implementation
  1330. ** Replaced `(ice-9 match)' with Alex Shinn's compatible, hygienic matcher.
  1331. Guile's copy of Andrew K. Wright's `match' library has been replaced by
  1332. a compatible hygienic implementation by Alex Shinn. It is now
  1333. documented, see "Pattern Matching" in the manual.
  1334. Compared to Andrew K. Wright's `match', the new `match' lacks
  1335. `match-define', `match:error-control', `match:set-error-control',
  1336. `match:error', `match:set-error', and all structure-related procedures.
  1337. ** Imported statprof, SSAX, and texinfo modules from Guile-Lib
  1338. The statprof statistical profiler, the SSAX XML toolkit, and the texinfo
  1339. toolkit from Guile-Lib have been imported into Guile proper. See
  1340. "Standard Library" in the manual for more details.
  1341. ** Integration of lalr-scm, a parser generator
  1342. Guile has included Dominique Boucher's fine `lalr-scm' parser generator
  1343. as `(system base lalr)'. See "LALR(1) Parsing" in the manual, for more
  1344. information.
  1345. * Changes to the stand-alone interpreter
  1346. ** Guile now can compile Scheme to bytecode for a custom virtual machine.
  1347. Compiled code loads much faster than Scheme source code, and runs around
  1348. 3 or 4 times as fast, generating much less garbage in the process.
  1349. ** Evaluating Scheme code does not use the C stack.
  1350. Besides when compiling Guile itself, Guile no longer uses a recursive C
  1351. function as an evaluator. This obviates the need to check the C stack
  1352. pointer for overflow. Continuations still capture the C stack, however.
  1353. ** New environment variables: GUILE_LOAD_COMPILED_PATH,
  1354. GUILE_SYSTEM_LOAD_COMPILED_PATH
  1355. GUILE_LOAD_COMPILED_PATH is for compiled files what GUILE_LOAD_PATH is
  1356. for source files. It is a different path, however, because compiled
  1357. files are architecture-specific. GUILE_SYSTEM_LOAD_COMPILED_PATH is like
  1358. GUILE_SYSTEM_PATH.
  1359. ** New read-eval-print loop (REPL) implementation
  1360. Running Guile with no arguments drops the user into the new REPL. See
  1361. "Using Guile Interactively" in the manual, for more information.
  1362. ** Remove old Emacs interface
  1363. Guile had an unused `--emacs' command line argument that was supposed to
  1364. help when running Guile inside Emacs. This option has been removed, and
  1365. the helper functions `named-module-use!' and `load-emacs-interface' have
  1366. been deprecated.
  1367. ** Add `(system repl server)' module and `--listen' command-line argument
  1368. The `(system repl server)' module exposes procedures to listen on
  1369. sockets for connections, and serve REPLs to those clients. The --listen
  1370. command-line argument allows any Guile program to thus be remotely
  1371. debuggable.
  1372. See "Invoking Guile" for more information on `--listen'.
  1373. ** Command line additions
  1374. The guile binary now supports a new switch "-x", which can be used to
  1375. extend the list of filename extensions tried when loading files
  1376. (%load-extensions).
  1377. ** New reader options: `square-brackets', `r6rs-hex-escapes',
  1378. `hungry-eol-escapes'
  1379. The reader supports a new option (changeable via `read-options'),
  1380. `square-brackets', which instructs it to interpret square brackets as
  1381. parentheses. This option is on by default.
  1382. When the new `r6rs-hex-escapes' reader option is enabled, the reader
  1383. will recognize string escape sequences as defined in R6RS. R6RS string
  1384. escape sequences are incompatible with Guile's existing escapes, though,
  1385. so this option is off by default.
  1386. Additionally, Guile follows the R6RS newline escaping rules when the
  1387. `hungry-eol-escapes' option is enabled.
  1388. See "String Syntax" in the manual, for more information.
  1389. ** Function profiling and tracing at the REPL
  1390. The `,profile FORM' REPL meta-command can now be used to statistically
  1391. profile execution of a form, to see which functions are taking the most
  1392. time. See `,help profile' for more information.
  1393. Similarly, `,trace FORM' traces all function applications that occur
  1394. during the execution of `FORM'. See `,help trace' for more information.
  1395. ** Recursive debugging REPL on error
  1396. When Guile sees an error at the REPL, instead of saving the stack, Guile
  1397. will directly enter a recursive REPL in the dynamic context of the
  1398. error. See "Error Handling" in the manual, for more information.
  1399. A recursive REPL is the same as any other REPL, except that it
  1400. has been augmented with debugging information, so that one can inspect
  1401. the context of the error. The debugger has been integrated with the REPL
  1402. via a set of debugging meta-commands.
  1403. For example, one may access a backtrace with `,backtrace' (or
  1404. `,bt'). See "Interactive Debugging" in the manual, for more
  1405. information.
  1406. ** New `guile-tools' commands: `compile', `disassemble'
  1407. Pass the `--help' command-line option to these commands for more
  1408. information.
  1409. ** Guile now adds its install prefix to the LTDL_LIBRARY_PATH
  1410. Users may now install Guile to nonstandard prefixes and just run
  1411. `/path/to/bin/guile', instead of also having to set LTDL_LIBRARY_PATH to
  1412. include `/path/to/lib'.
  1413. ** Guile's Emacs integration is now more keyboard-friendly
  1414. Backtraces may now be disclosed with the keyboard in addition to the
  1415. mouse.
  1416. ** Load path change: search in version-specific paths before site paths
  1417. When looking for a module, Guile now searches first in Guile's
  1418. version-specific path (the library path), *then* in the site dir. This
  1419. allows Guile's copy of SSAX to override any Guile-Lib copy the user has
  1420. installed. Also it should cut the number of `stat' system calls by half,
  1421. in the common case.
  1422. ** Value history in the REPL on by default
  1423. By default, the REPL will save computed values in variables like `$1',
  1424. `$2', and the like. There are programmatic and interactive interfaces to
  1425. control this. See "Value History" in the manual, for more information.
  1426. ** Readline tab completion for arguments
  1427. When readline is enabled, tab completion works for arguments too, not
  1428. just for the operator position.
  1429. ** Expression-oriented readline history
  1430. Guile's readline history now tries to operate on expressions instead of
  1431. input lines. Let us know what you think!
  1432. ** Interactive Guile follows GNU conventions
  1433. As recommended by the GPL, Guile now shows a brief copyright and
  1434. warranty disclaimer on startup, along with pointers to more information.
  1435. * Changes to Scheme functions and syntax
  1436. ** Support for R6RS libraries
  1437. The `library' and `import' forms from the latest Scheme report have been
  1438. added to Guile, in such a way that R6RS libraries share a namespace with
  1439. Guile modules. R6RS modules may import Guile modules, and are available
  1440. for Guile modules to import via use-modules and all the rest. See "R6RS
  1441. Libraries" in the manual for more information.
  1442. ** Implementations of R6RS libraries
  1443. Guile now has implementations for all of the libraries defined in the
  1444. R6RS. Thanks to Julian Graham for this excellent hack. See "R6RS
  1445. Standard Libraries" in the manual for a full list of libraries.
  1446. ** Partial R6RS compatibility
  1447. Guile now has enough support for R6RS to run a reasonably large subset
  1448. of R6RS programs.
  1449. Guile is not fully R6RS compatible. Many incompatibilities are simply
  1450. bugs, though some parts of Guile will remain R6RS-incompatible for the
  1451. foreseeable future. See "R6RS Incompatibilities" in the manual, for more
  1452. information.
  1453. Please contact bug-guile@gnu.org if you have found an issue not
  1454. mentioned in that compatibility list.
  1455. ** New implementation of `primitive-eval'
  1456. Guile's `primitive-eval' is now implemented in Scheme. Actually there is
  1457. still a C evaluator, used when building a fresh Guile to interpret the
  1458. compiler, so we can compile eval.scm. Thereafter all calls to
  1459. primitive-eval are implemented by VM-compiled code.
  1460. This allows all of Guile's procedures, be they interpreted or compiled,
  1461. to execute on the same stack, unifying multiple-value return semantics,
  1462. providing for proper tail recursion between interpreted and compiled
  1463. code, and simplifying debugging.
  1464. As part of this change, the evaluator no longer mutates the internal
  1465. representation of the code being evaluated in a thread-unsafe manner.
  1466. There are two negative aspects of this change, however. First, Guile
  1467. takes a lot longer to compile now. Also, there is less debugging
  1468. information available for debugging interpreted code. We hope to improve
  1469. both of these situations.
  1470. There are many changes to the internal C evalator interface, but all
  1471. public interfaces should be the same. See the ChangeLog for details. If
  1472. we have inadvertantly changed an interface that you were using, please
  1473. contact bug-guile@gnu.org.
  1474. ** Procedure removed: `the-environment'
  1475. This procedure was part of the interpreter's execution model, and does
  1476. not apply to the compiler.
  1477. ** No more `local-eval'
  1478. `local-eval' used to exist so that one could evaluate code in the
  1479. lexical context of a function. Since there is no way to get the lexical
  1480. environment any more, as that concept has no meaning for the compiler,
  1481. and a different meaning for the interpreter, we have removed the
  1482. function.
  1483. If you think you need `local-eval', you should probably implement your
  1484. own metacircular evaluator. It will probably be as fast as Guile's
  1485. anyway.
  1486. ** Scheme source files will now be compiled automatically.
  1487. If a compiled .go file corresponding to a .scm file is not found or is
  1488. not fresh, the .scm file will be compiled on the fly, and the resulting
  1489. .go file stored away. An advisory note will be printed on the console.
  1490. Note that this mechanism depends on the timestamp of the .go file being
  1491. newer than that of the .scm file; if the .scm or .go files are moved
  1492. after installation, care should be taken to preserve their original
  1493. timestamps.
  1494. Auto-compiled files will be stored in the $XDG_CACHE_HOME/guile/ccache
  1495. directory, where $XDG_CACHE_HOME defaults to ~/.cache. This directory
  1496. will be created if needed.
  1497. To inhibit automatic compilation, set the GUILE_AUTO_COMPILE environment
  1498. variable to 0, or pass --no-auto-compile on the Guile command line.
  1499. ** New POSIX procedures: `getrlimit' and `setrlimit'
  1500. Note however that the interface of these functions is likely to change
  1501. in the next prerelease.
  1502. ** New POSIX procedure: `getsid'
  1503. Scheme binding for the `getsid' C library call.
  1504. ** New POSIX procedure: `getaddrinfo'
  1505. Scheme binding for the `getaddrinfo' C library function.
  1506. ** Multicast socket options
  1507. Support was added for the IP_MULTICAST_TTL and IP_MULTICAST_IF socket
  1508. options. See "Network Sockets and Communication" in the manual, for
  1509. more information.
  1510. ** `recv!', `recvfrom!', `send', `sendto' now deal in bytevectors
  1511. These socket procedures now take bytevectors as arguments, instead of
  1512. strings. There is some deprecated string support, however.
  1513. ** New GNU procedures: `setaffinity' and `getaffinity'.
  1514. See "Processes" in the manual, for more information.
  1515. ** New procedures: `compose', `negate', and `const'
  1516. See "Higher-Order Functions" in the manual, for more information.
  1517. ** New procedure in `(oops goops)': `method-formals'
  1518. ** New procedures in (ice-9 session): `add-value-help-handler!',
  1519. `remove-value-help-handler!', `add-name-help-handler!'
  1520. `remove-name-help-handler!', `procedure-arguments'
  1521. The value and name help handlers provide some minimal extensibility to
  1522. the help interface. Guile-lib's `(texinfo reflection)' uses them, for
  1523. example, to make stexinfo help documentation available. See those
  1524. procedures' docstrings for more information.
  1525. `procedure-arguments' describes the arguments that a procedure can take,
  1526. combining arity and formals. For example:
  1527. (procedure-arguments resolve-interface)
  1528. => ((required . (name)) (rest . args))
  1529. Additionally, `module-commentary' is now publically exported from
  1530. `(ice-9 session).
  1531. ** Removed: `procedure->memoizing-macro', `procedure->syntax'
  1532. These procedures created primitive fexprs for the old evaluator, and are
  1533. no longer supported. If you feel that you need these functions, you
  1534. probably need to write your own metacircular evaluator (which will
  1535. probably be as fast as Guile's, anyway).
  1536. ** New language: ECMAScript
  1537. Guile now ships with one other high-level language supported,
  1538. ECMAScript. The goal is to support all of version 3.1 of the standard,
  1539. but not all of the libraries are there yet. This support is not yet
  1540. documented; ask on the mailing list if you are interested.
  1541. ** New language: Brainfuck
  1542. Brainfuck is a toy language that closely models Turing machines. Guile's
  1543. brainfuck compiler is meant to be an example of implementing other
  1544. languages. See the manual for details, or
  1545. http://en.wikipedia.org/wiki/Brainfuck for more information about the
  1546. Brainfuck language itself.
  1547. ** New language: Elisp
  1548. Guile now has an experimental Emacs Lisp compiler and runtime. You can
  1549. now switch to Elisp at the repl: `,language elisp'. All kudos to Daniel
  1550. Kraft and Brian Templeton, and all bugs to bug-guile@gnu.org.
  1551. ** Better documentation infrastructure for macros
  1552. It is now possible to introspect on the type of a macro, e.g.
  1553. syntax-rules, identifier-syntax, etc, and extract information about that
  1554. macro, such as the syntax-rules patterns or the defmacro arguments.
  1555. `(texinfo reflection)' takes advantage of this to give better macro
  1556. documentation.
  1557. ** Support for arbitrary procedure metadata
  1558. Building on its support for docstrings, Guile now supports multiple
  1559. docstrings, adding them to the tail of a compiled procedure's
  1560. properties. For example:
  1561. (define (foo)
  1562. "one"
  1563. "two"
  1564. 3)
  1565. (procedure-properties foo)
  1566. => ((name . foo) (documentation . "one") (documentation . "two"))
  1567. Also, vectors of pairs are now treated as additional metadata entries:
  1568. (define (bar)
  1569. #((quz . #f) (docstring . "xyzzy"))
  1570. 3)
  1571. (procedure-properties bar)
  1572. => ((name . bar) (quz . #f) (docstring . "xyzzy"))
  1573. This allows arbitrary literals to be embedded as metadata in a compiled
  1574. procedure.
  1575. ** The psyntax expander now knows how to interpret the @ and @@ special
  1576. forms.
  1577. ** The psyntax expander is now hygienic with respect to modules.
  1578. Free variables in a macro are scoped in the module that the macro was
  1579. defined in, not in the module the macro is used in. For example, code
  1580. like this works now:
  1581. (define-module (foo) #:export (bar))
  1582. (define (helper x) ...)
  1583. (define-syntax bar
  1584. (syntax-rules () ((_ x) (helper x))))
  1585. (define-module (baz) #:use-module (foo))
  1586. (bar qux)
  1587. It used to be you had to export `helper' from `(foo)' as well.
  1588. Thankfully, this has been fixed.
  1589. ** Support for version information in Guile's `module' form
  1590. Guile modules now have a `#:version' field. See "R6RS Version
  1591. References", "General Information about Modules", "Using Guile Modules",
  1592. and "Creating Guile Modules" in the manual for more information.
  1593. ** Support for renaming bindings on module export
  1594. Wherever Guile accepts a symbol as an argument to specify a binding to
  1595. export, it now also accepts a pair of symbols, indicating that a binding
  1596. should be renamed on export. See "Creating Guile Modules" in the manual
  1597. for more information.
  1598. ** New procedure: `module-export-all!'
  1599. This procedure exports all current and future bindings from a module.
  1600. Use as `(module-export-all! (current-module))'.
  1601. ** New procedure `reload-module', and `,reload' REPL command
  1602. See "Module System Reflection" and "Module Commands" in the manual, for
  1603. more information.
  1604. ** `eval-case' has been deprecated, and replaced by `eval-when'.
  1605. The semantics of `eval-when' are easier to understand. See "Eval When"
  1606. in the manual, for more information.
  1607. ** Guile is now more strict about prohibiting definitions in expression
  1608. contexts.
  1609. Although previous versions of Guile accepted it, the following
  1610. expression is not valid, in R5RS or R6RS:
  1611. (if test (define foo 'bar) (define foo 'baz))
  1612. In this specific case, it would be better to do:
  1613. (define foo (if test 'bar 'baz))
  1614. It is possible to circumvent this restriction with e.g.
  1615. `(module-define! (current-module) 'foo 'baz)'. Contact the list if you
  1616. have any questions.
  1617. ** Support for `letrec*'
  1618. Guile now supports `letrec*', a recursive lexical binding operator in
  1619. which the identifiers are bound in order. See "Local Bindings" in the
  1620. manual, for more details.
  1621. ** Internal definitions now expand to `letrec*'
  1622. Following the R6RS, internal definitions now expand to letrec* instead
  1623. of letrec. The following program is invalid for R5RS, but valid for
  1624. R6RS:
  1625. (define (foo)
  1626. (define bar 10)
  1627. (define baz (+ bar 20))
  1628. baz)
  1629. ;; R5RS and Guile <= 1.8:
  1630. (foo) => Unbound variable: bar
  1631. ;; R6RS and Guile >= 2.0:
  1632. (foo) => 30
  1633. This change should not affect correct R5RS programs, or programs written
  1634. in earlier Guile dialects.
  1635. ** Macro expansion produces structures instead of s-expressions
  1636. In the olden days, macroexpanding an s-expression would yield another
  1637. s-expression. Though the lexical variables were renamed, expansions of
  1638. core forms like `if' and `begin' were still non-hygienic, as they relied
  1639. on the toplevel definitions of `if' et al being the conventional ones.
  1640. The solution is to expand to structures instead of s-expressions. There
  1641. is an `if' structure, a `begin' structure, a `toplevel-ref' structure,
  1642. etc. The expander already did this for compilation, producing Tree-IL
  1643. directly; it has been changed now to do so when expanding for the
  1644. evaluator as well.
  1645. ** Defmacros must now produce valid Scheme expressions.
  1646. It used to be that defmacros could unquote in Scheme values, as a way of
  1647. supporting partial evaluation, and avoiding some hygiene issues. For
  1648. example:
  1649. (define (helper x) ...)
  1650. (define-macro (foo bar)
  1651. `(,helper ,bar))
  1652. Assuming this macro is in the `(baz)' module, the direct translation of
  1653. this code would be:
  1654. (define (helper x) ...)
  1655. (define-macro (foo bar)
  1656. `((@@ (baz) helper) ,bar))
  1657. Of course, one could just use a hygienic macro instead:
  1658. (define-syntax foo
  1659. (syntax-rules ()
  1660. ((_ bar) (helper bar))))
  1661. ** Guile's psyntax now supports docstrings and internal definitions.
  1662. The following Scheme is not strictly legal:
  1663. (define (foo)
  1664. "bar"
  1665. (define (baz) ...)
  1666. (baz))
  1667. However its intent is fairly clear. Guile interprets "bar" to be the
  1668. docstring of `foo', and the definition of `baz' is still in definition
  1669. context.
  1670. ** Support for settable identifier syntax
  1671. Following the R6RS, "variable transformers" are settable
  1672. identifier-syntax. See "Identifier macros" in the manual, for more
  1673. information.
  1674. ** syntax-case treats `_' as a placeholder
  1675. Following R6RS, a `_' in a syntax-rules or syntax-case pattern matches
  1676. anything, and binds no pattern variables. Unlike the R6RS, Guile also
  1677. permits `_' to be in the literals list for a pattern.
  1678. ** Macros need to be defined before their first use.
  1679. It used to be that with lazy memoization, this might work:
  1680. (define (foo x)
  1681. (ref x))
  1682. (define-macro (ref x) x)
  1683. (foo 1) => 1
  1684. But now, the body of `foo' is interpreted to mean a call to the toplevel
  1685. `ref' function, instead of a macro expansion. The solution is to define
  1686. macros before code that uses them.
  1687. ** Functions needed by macros at expand-time need to be present at
  1688. expand-time.
  1689. For example, this code will work at the REPL:
  1690. (define (double-helper x) (* x x))
  1691. (define-macro (double-literal x) (double-helper x))
  1692. (double-literal 2) => 4
  1693. But it will not work when a file is compiled, because the definition of
  1694. `double-helper' is not present at expand-time. The solution is to wrap
  1695. the definition of `double-helper' in `eval-when':
  1696. (eval-when (load compile eval)
  1697. (define (double-helper x) (* x x)))
  1698. (define-macro (double-literal x) (double-helper x))
  1699. (double-literal 2) => 4
  1700. See the documentation for eval-when for more information.
  1701. ** `macroexpand' produces structures, not S-expressions.
  1702. Given the need to maintain referential transparency, both lexically and
  1703. modular, the result of expanding Scheme expressions is no longer itself
  1704. an s-expression. If you want a human-readable approximation of the
  1705. result of `macroexpand', call `tree-il->scheme' from `(language
  1706. tree-il)'.
  1707. ** Removed function: `macroexpand-1'
  1708. It is unclear how to implement `macroexpand-1' with syntax-case, though
  1709. PLT Scheme does prove that it is possible.
  1710. ** New reader macros: #' #` #, #,@
  1711. These macros translate, respectively, to `syntax', `quasisyntax',
  1712. `unsyntax', and `unsyntax-splicing'. See the R6RS for more information.
  1713. These reader macros may be overridden by `read-hash-extend'.
  1714. ** Incompatible change to #'
  1715. Guile did have a #' hash-extension, by default, which just returned the
  1716. subsequent datum: #'foo => foo. In the unlikely event that anyone
  1717. actually used this, this behavior may be reinstated via the
  1718. `read-hash-extend' mechanism.
  1719. ** `unquote' and `unquote-splicing' accept multiple expressions
  1720. As per the R6RS, these syntax operators can now accept any number of
  1721. expressions to unquote.
  1722. ** Scheme expresssions may be commented out with #;
  1723. #; comments out an entire expression. See SRFI-62 or the R6RS for more
  1724. information.
  1725. ** Prompts: Delimited, composable continuations
  1726. Guile now has prompts as part of its primitive language. See "Prompts"
  1727. in the manual, for more information.
  1728. Expressions entered in at the REPL, or from the command line, are
  1729. surrounded by a prompt with the default prompt tag.
  1730. ** `make-stack' with a tail-called procedural narrowing argument no longer
  1731. works (with compiled procedures)
  1732. It used to be the case that a captured stack could be narrowed to select
  1733. calls only up to or from a certain procedure, even if that procedure
  1734. already tail-called another procedure. This was because the debug
  1735. information from the original procedure was kept on the stack.
  1736. Now with the new compiler, the stack only contains active frames from
  1737. the current continuation. A narrow to a procedure that is not in the
  1738. stack will result in an empty stack. To fix this, narrow to a procedure
  1739. that is active in the current continuation, or narrow to a specific
  1740. number of stack frames.
  1741. ** Backtraces through compiled procedures only show procedures that are
  1742. active in the current continuation
  1743. Similarly to the previous issue, backtraces in compiled code may be
  1744. different from backtraces in interpreted code. There are no semantic
  1745. differences, however. Please mail bug-guile@gnu.org if you see any
  1746. deficiencies with Guile's backtraces.
  1747. ** `positions' reader option enabled by default
  1748. This change allows primitive-load without --auto-compile to also
  1749. propagate source information through the expander, for better errors and
  1750. to let macros know their source locations. The compiler was already
  1751. turning it on anyway.
  1752. ** New macro: `current-source-location'
  1753. The macro returns the current source location (to be documented).
  1754. ** syntax-rules and syntax-case macros now propagate source information
  1755. through to the expanded code
  1756. This should result in better backtraces.
  1757. ** The currying behavior of `define' has been removed.
  1758. Before, `(define ((f a) b) (* a b))' would translate to
  1759. (define f (lambda (a) (lambda (b) (* a b))))
  1760. Now a syntax error is signaled, as this syntax is not supported by
  1761. default. Use the `(ice-9 curried-definitions)' module to get back the
  1762. old behavior.
  1763. ** New procedure, `define!'
  1764. `define!' is a procedure that takes two arguments, a symbol and a value,
  1765. and binds the value to the symbol in the current module. It's useful to
  1766. programmatically make definitions in the current module, and is slightly
  1767. less verbose than `module-define!'.
  1768. ** All modules have names now
  1769. Before, you could have anonymous modules: modules without names. Now,
  1770. because of hygiene and macros, all modules have names. If a module was
  1771. created without a name, the first time `module-name' is called on it, a
  1772. fresh name will be lazily generated for it.
  1773. ** The module namespace is now separate from the value namespace
  1774. It was a little-known implementation detail of Guile's module system
  1775. that it was built on a single hierarchical namespace of values -- that
  1776. if there was a module named `(foo bar)', then in the module named
  1777. `(foo)' there was a binding from `bar' to the `(foo bar)' module.
  1778. This was a neat trick, but presented a number of problems. One problem
  1779. was that the bindings in a module were not apparent from the module
  1780. itself; perhaps the `(foo)' module had a private binding for `bar', and
  1781. then an external contributor defined `(foo bar)'. In the end there can
  1782. be only one binding, so one of the two will see the wrong thing, and
  1783. produce an obtuse error of unclear provenance.
  1784. Also, the public interface of a module was also bound in the value
  1785. namespace, as `%module-public-interface'. This was a hack from the early
  1786. days of Guile's modules.
  1787. Both of these warts have been fixed by the addition of fields in the
  1788. `module' data type. Access to modules and their interfaces from the
  1789. value namespace has been deprecated, and all accessors use the new
  1790. record accessors appropriately.
  1791. When Guile is built with support for deprecated code, as is the default,
  1792. the value namespace is still searched for modules and public interfaces,
  1793. and a deprecation warning is raised as appropriate.
  1794. Finally, to support lazy loading of modules as one used to be able to do
  1795. with module binder procedures, Guile now has submodule binders, called
  1796. if a given submodule is not found. See boot-9.scm for more information.
  1797. ** New procedures: module-ref-submodule, module-define-submodule,
  1798. nested-ref-module, nested-define-module!, local-ref-module,
  1799. local-define-module
  1800. These new accessors are like their bare variants, but operate on
  1801. namespaces instead of values.
  1802. ** The (app modules) module tree is officially deprecated
  1803. It used to be that one could access a module named `(foo bar)' via
  1804. `(nested-ref the-root-module '(app modules foo bar))'. The `(app
  1805. modules)' bit was a never-used and never-documented abstraction, and has
  1806. been deprecated. See the following mail for a full discussion:
  1807. http://lists.gnu.org/archive/html/guile-devel/2010-04/msg00168.html
  1808. The `%app' binding is also deprecated.
  1809. ** `module-filename' field and accessor
  1810. Modules now record the file in which they are defined. This field may be
  1811. accessed with the new `module-filename' procedure.
  1812. ** Modules load within a known environment
  1813. It takes a few procedure calls to define a module, and those procedure
  1814. calls need to be in scope. Now we ensure that the current module when
  1815. loading a module is one that has the needed bindings, instead of relying
  1816. on chance.
  1817. ** `load' is a macro (!) that resolves paths relative to source file dir
  1818. The familiar Schem `load' procedure is now a macro that captures the
  1819. name of the source file being expanded, and dispatches to the new
  1820. `load-in-vicinity'. Referencing `load' by bare name returns a closure
  1821. that embeds the current source file name.
  1822. This fix allows `load' of relative paths to be resolved with respect to
  1823. the location of the file that calls `load'.
  1824. ** Many syntax errors have different texts now
  1825. Syntax errors still throw to the `syntax-error' key, but the arguments
  1826. are often different now. Perhaps in the future, Guile will switch to
  1827. using standard SRFI-35 conditions.
  1828. ** Returning multiple values to compiled code will silently truncate the
  1829. values to the expected number
  1830. For example, the interpreter would raise an error evaluating the form,
  1831. `(+ (values 1 2) (values 3 4))', because it would see the operands as
  1832. being two compound "values" objects, to which `+' does not apply.
  1833. The compiler, on the other hand, receives multiple values on the stack,
  1834. not as a compound object. Given that it must check the number of values
  1835. anyway, if too many values are provided for a continuation, it chooses
  1836. to truncate those values, effectively evaluating `(+ 1 3)' instead.
  1837. The idea is that the semantics that the compiler implements is more
  1838. intuitive, and the use of the interpreter will fade out with time.
  1839. This behavior is allowed both by the R5RS and the R6RS.
  1840. ** Multiple values in compiled code are not represented by compound
  1841. objects
  1842. This change may manifest itself in the following situation:
  1843. (let ((val (foo))) (do-something) val)
  1844. In the interpreter, if `foo' returns multiple values, multiple values
  1845. are produced from the `let' expression. In the compiler, those values
  1846. are truncated to the first value, and that first value is returned. In
  1847. the compiler, if `foo' returns no values, an error will be raised, while
  1848. the interpreter would proceed.
  1849. Both of these behaviors are allowed by R5RS and R6RS. The compiler's
  1850. behavior is more correct, however. If you wish to preserve a potentially
  1851. multiply-valued return, you will need to set up a multiple-value
  1852. continuation, using `call-with-values'.
  1853. ** Defmacros are now implemented in terms of syntax-case.
  1854. The practical ramification of this is that the `defmacro?' predicate has
  1855. been removed, along with `defmacro-transformer', `macro-table',
  1856. `xformer-table', `assert-defmacro?!', `set-defmacro-transformer!' and
  1857. `defmacro:transformer'. This is because defmacros are simply macros. If
  1858. any of these procedures provided useful facilities to you, we encourage
  1859. you to contact the Guile developers.
  1860. ** Hygienic macros documented as the primary syntactic extension mechanism.
  1861. The macro documentation was finally fleshed out with some documentation
  1862. on `syntax-rules' and `syntax-case' macros, and other parts of the macro
  1863. expansion process. See "Macros" in the manual, for details.
  1864. ** psyntax is now the default expander
  1865. Scheme code is now expanded by default by the psyntax hygienic macro
  1866. expander. Expansion is performed completely before compilation or
  1867. interpretation.
  1868. Notably, syntax errors will be signalled before interpretation begins.
  1869. In the past, many syntax errors were only detected at runtime if the
  1870. code in question was memoized.
  1871. As part of its expansion, psyntax renames all lexically-bound
  1872. identifiers. Original identifier names are preserved and given to the
  1873. compiler, but the interpreter will see the renamed variables, e.g.,
  1874. `x432' instead of `x'.
  1875. Note that the psyntax that Guile uses is a fork, as Guile already had
  1876. modules before incompatible modules were added to psyntax -- about 10
  1877. years ago! Thus there are surely a number of bugs that have been fixed
  1878. in psyntax since then. If you find one, please notify bug-guile@gnu.org.
  1879. ** syntax-rules and syntax-case are available by default.
  1880. There is no longer any need to import the `(ice-9 syncase)' module
  1881. (which is now deprecated). The expander may be invoked directly via
  1882. `macroexpand', though it is normally searched for via the current module
  1883. transformer.
  1884. Also, the helper routines for syntax-case are available in the default
  1885. environment as well: `syntax->datum', `datum->syntax',
  1886. `bound-identifier=?', `free-identifier=?', `generate-temporaries',
  1887. `identifier?', and `syntax-violation'. See the R6RS for documentation.
  1888. ** Tail patterns in syntax-case
  1889. Guile has pulled in some more recent changes from the psyntax portable
  1890. syntax expander, to implement support for "tail patterns". Such patterns
  1891. are supported by syntax-rules and syntax-case. This allows a syntax-case
  1892. match clause to have ellipses, then a pattern at the end. For example:
  1893. (define-syntax case
  1894. (syntax-rules (else)
  1895. ((_ val match-clause ... (else e e* ...))
  1896. [...])))
  1897. Note how there is MATCH-CLAUSE, which is ellipsized, then there is a
  1898. tail pattern for the else clause. Thanks to Andreas Rottmann for the
  1899. patch, and Kent Dybvig for the code.
  1900. ** Lexical bindings introduced by hygienic macros may not be referenced
  1901. by nonhygienic macros.
  1902. If a lexical binding is introduced by a hygienic macro, it may not be
  1903. referenced by a nonhygienic macro. For example, this works:
  1904. (let ()
  1905. (define-macro (bind-x val body)
  1906. `(let ((x ,val)) ,body))
  1907. (define-macro (ref x)
  1908. x)
  1909. (bind-x 10 (ref x)))
  1910. But this does not:
  1911. (let ()
  1912. (define-syntax bind-x
  1913. (syntax-rules ()
  1914. ((_ val body) (let ((x val)) body))))
  1915. (define-macro (ref x)
  1916. x)
  1917. (bind-x 10 (ref x)))
  1918. It is not normal to run into this situation with existing code. However,
  1919. if you have defmacros that expand to hygienic macros, it is possible to
  1920. run into situations like this. For example, if you have a defmacro that
  1921. generates a `while' expression, the `break' bound by the `while' may not
  1922. be visible within other parts of your defmacro. The solution is to port
  1923. from defmacros to syntax-rules or syntax-case.
  1924. ** Macros may no longer be referenced as first-class values.
  1925. In the past, you could evaluate e.g. `if', and get its macro value. Now,
  1926. expanding this form raises a syntax error.
  1927. Macros still /exist/ as first-class values, but they must be
  1928. /referenced/ via the module system, e.g. `(module-ref (current-module)
  1929. 'if)'.
  1930. ** Macros may now have docstrings.
  1931. `object-documentation' from `(ice-9 documentation)' may be used to
  1932. retrieve the docstring, once you have a macro value -- but see the above
  1933. note about first-class macros. Docstrings are associated with the syntax
  1934. transformer procedures.
  1935. ** `case-lambda' is now available in the default environment.
  1936. The binding in the default environment is equivalent to the one from the
  1937. `(srfi srfi-16)' module. Use the srfi-16 module explicitly if you wish
  1938. to maintain compatibility with Guile 1.8 and earlier.
  1939. ** Procedures may now have more than one arity.
  1940. This can be the case, for example, in case-lambda procedures. The
  1941. arities of compiled procedures may be accessed via procedures from the
  1942. `(system vm program)' module; see "Compiled Procedures", "Optional
  1943. Arguments", and "Case-lambda" in the manual.
  1944. ** Deprecate arity access via (procedure-properties proc 'arity)
  1945. Instead of accessing a procedure's arity as a property, use the new
  1946. `procedure-minimum-arity' function, which gives the most permissive
  1947. arity that the function has, in the same format as the old arity
  1948. accessor.
  1949. ** `lambda*' and `define*' are now available in the default environment
  1950. As with `case-lambda', `(ice-9 optargs)' continues to be supported, for
  1951. compatibility purposes. No semantic change has been made (we hope).
  1952. Optional and keyword arguments now dispatch via special VM operations,
  1953. without the need to cons rest arguments, making them very fast.
  1954. ** New syntax: define-once
  1955. `define-once' is like Lisp's `defvar': it creates a toplevel binding,
  1956. but only if one does not exist already.
  1957. ** New function, `truncated-print', with `format' support
  1958. `(ice-9 pretty-print)' now exports `truncated-print', a printer that
  1959. will ensure that the output stays within a certain width, truncating the
  1960. output in what is hopefully an intelligent manner. See the manual for
  1961. more details.
  1962. There is a new `format' specifier, `~@y', for doing a truncated
  1963. print (as opposed to `~y', which does a pretty-print). See the `format'
  1964. documentation for more details.
  1965. ** Better pretty-printing
  1966. Indentation recognizes more special forms, like `syntax-case', and read
  1967. macros like `quote' are printed better.
  1968. ** Passing a number as the destination of `format' is deprecated
  1969. The `format' procedure in `(ice-9 format)' now emits a deprecation
  1970. warning if a number is passed as its first argument.
  1971. Also, it used to be that you could omit passing a port to `format', in
  1972. some cases. This still works, but has been formally deprecated.
  1973. ** SRFI-4 vectors reimplemented in terms of R6RS bytevectors
  1974. Guile now implements SRFI-4 vectors using bytevectors. Often when you
  1975. have a numeric vector, you end up wanting to write its bytes somewhere,
  1976. or have access to the underlying bytes, or read in bytes from somewhere
  1977. else. Bytevectors are very good at this sort of thing. But the SRFI-4
  1978. APIs are nicer to use when doing number-crunching, because they are
  1979. addressed by element and not by byte.
  1980. So as a compromise, Guile allows all bytevector functions to operate on
  1981. numeric vectors. They address the underlying bytes in the native
  1982. endianness, as one would expect.
  1983. Following the same reasoning, that it's just bytes underneath, Guile
  1984. also allows uniform vectors of a given type to be accessed as if they
  1985. were of any type. One can fill a u32vector, and access its elements with
  1986. u8vector-ref. One can use f64vector-ref on bytevectors. It's all the
  1987. same to Guile.
  1988. In this way, uniform numeric vectors may be written to and read from
  1989. input/output ports using the procedures that operate on bytevectors.
  1990. Calls to SRFI-4 accessors (ref and set functions) from Scheme are now
  1991. inlined to the VM instructions for bytevector access.
  1992. See "SRFI-4" in the manual, for more information.
  1993. ** Nonstandard SRFI-4 procedures now available from `(srfi srfi-4 gnu)'
  1994. Guile's `(srfi srfi-4)' now only exports those srfi-4 procedures that
  1995. are part of the standard. Complex uniform vectors and the
  1996. `any->FOOvector' family are now available only from `(srfi srfi-4 gnu)'.
  1997. Guile's default environment imports `(srfi srfi-4)', and probably should
  1998. import `(srfi srfi-4 gnu)' as well.
  1999. See "SRFI-4 Extensions" in the manual, for more information.
  2000. ** New syntax: include-from-path.
  2001. `include-from-path' is like `include', except it looks for its file in
  2002. the load path. It can be used to compile other files into a file.
  2003. ** New syntax: quasisyntax.
  2004. `quasisyntax' is to `syntax' as `quasiquote' is to `quote'. See the R6RS
  2005. documentation for more information. Thanks to Andre van Tonder for the
  2006. implementation.
  2007. ** `*unspecified*' is identifier syntax
  2008. `*unspecified*' is no longer a variable, so it is optimized properly by
  2009. the compiler, and is not `set!'-able.
  2010. ** Changes and bugfixes in numerics code
  2011. *** Added six new sets of fast quotient and remainder operators
  2012. Added six new sets of fast quotient and remainder operator pairs with
  2013. different semantics than the R5RS operators. They support not only
  2014. integers, but all reals, including exact rationals and inexact
  2015. floating point numbers.
  2016. These procedures accept two real numbers N and D, where the divisor D
  2017. must be non-zero. Each set of operators computes an integer quotient
  2018. Q and a real remainder R such that N = Q*D + R and |R| < |D|. They
  2019. differ only in how N/D is rounded to produce Q.
  2020. `euclidean-quotient' returns the integer Q and `euclidean-remainder'
  2021. returns the real R such that N = Q*D + R and 0 <= R < |D|. `euclidean/'
  2022. returns both Q and R, and is more efficient than computing each
  2023. separately. Note that when D > 0, `euclidean-quotient' returns
  2024. floor(N/D), and when D < 0 it returns ceiling(N/D).
  2025. `centered-quotient', `centered-remainder', and `centered/' are similar
  2026. except that the range of remainders is -abs(D/2) <= R < abs(D/2), and
  2027. `centered-quotient' rounds N/D to the nearest integer. Note that these
  2028. operators are equivalent to the R6RS integer division operators `div',
  2029. `mod', `div-and-mod', `div0', `mod0', and `div0-and-mod0'.
  2030. `floor-quotient' and `floor-remainder' compute Q and R, respectively,
  2031. where Q has been rounded toward negative infinity. `floor/' returns
  2032. both Q and R, and is more efficient than computing each separately.
  2033. Note that when applied to integers, `floor-remainder' is equivalent to
  2034. the R5RS integer-only `modulo' operator. `ceiling-quotient',
  2035. `ceiling-remainder', and `ceiling/' are similar except that Q is
  2036. rounded toward positive infinity.
  2037. For `truncate-quotient', `truncate-remainder', and `truncate/', Q is
  2038. rounded toward zero. Note that when applied to integers,
  2039. `truncate-quotient' and `truncate-remainder' are equivalent to the
  2040. R5RS integer-only operators `quotient' and `remainder'.
  2041. For `round-quotient', `round-remainder', and `round/', Q is rounded to
  2042. the nearest integer, with ties going to the nearest even integer.
  2043. *** Complex number changes
  2044. Guile is now able to represent non-real complex numbers whose
  2045. imaginary part is an _inexact_ zero (0.0 or -0.0), per R6RS.
  2046. Previously, such numbers were immediately changed into inexact reals.
  2047. (real? 0.0+0.0i) now returns #f, per R6RS, although (zero? 0.0+0.0i)
  2048. still returns #t, per R6RS. (= 0 0.0+0.0i) and (= 0.0 0.0+0.0i) are
  2049. #t, but the same comparisons using `eqv?' or `equal?' are #f.
  2050. Like other non-real numbers, these complex numbers with inexact zero
  2051. imaginary part will raise exceptions is passed to procedures requiring
  2052. reals, such as `<', `>', `<=', `>=', `min', `max', `positive?',
  2053. `negative?', `inf?', `nan?', `finite?', etc.
  2054. **** `make-rectangular' changes
  2055. scm_make_rectangular `make-rectangular' now returns a real number only
  2056. if the imaginary part is an _exact_ 0. Previously, it would return a
  2057. real number if the imaginary part was an inexact zero.
  2058. scm_c_make_rectangular now always returns a non-real complex number,
  2059. even if the imaginary part is zero. Previously, it would return a
  2060. real number if the imaginary part was zero.
  2061. **** `make-polar' changes
  2062. scm_make_polar `make-polar' now returns a real number only if the
  2063. angle or magnitude is an _exact_ 0. If the magnitude is an exact 0,
  2064. it now returns an exact 0. Previously, it would return a real
  2065. number if the imaginary part was an inexact zero.
  2066. scm_c_make_polar now always returns a non-real complex number, even if
  2067. the imaginary part is 0.0. Previously, it would return a real number
  2068. if the imaginary part was 0.0.
  2069. **** `imag-part' changes
  2070. scm_imag_part `imag-part' now returns an exact 0 if applied to an
  2071. inexact real number. Previously it returned an inexact zero in this
  2072. case.
  2073. *** `eqv?' and `equal?' now compare numbers equivalently
  2074. scm_equal_p `equal?' now behaves equivalently to scm_eqv_p `eqv?' for
  2075. numeric values, per R5RS. Previously, equal? worked differently,
  2076. e.g. `(equal? 0.0 -0.0)' returned #t but `(eqv? 0.0 -0.0)' returned #f,
  2077. and `(equal? +nan.0 +nan.0)' returned #f but `(eqv? +nan.0 +nan.0)'
  2078. returned #t.
  2079. *** `(equal? +nan.0 +nan.0)' now returns #t
  2080. Previously, `(equal? +nan.0 +nan.0)' returned #f, although
  2081. `(let ((x +nan.0)) (equal? x x))' and `(eqv? +nan.0 +nan.0)'
  2082. both returned #t. R5RS requires that `equal?' behave like
  2083. `eqv?' when comparing numbers.
  2084. *** Change in handling products `*' involving exact 0
  2085. scm_product `*' now handles exact 0 differently. A product containing
  2086. an exact 0 now returns an exact 0 if and only if the other arguments
  2087. are all exact. An inexact zero is returned if and only if the other
  2088. arguments are all finite but not all exact. If an infinite or NaN
  2089. value is present, a NaN value is returned. Previously, any product
  2090. containing an exact 0 yielded an exact 0, regardless of the other
  2091. arguments.
  2092. *** `expt' and `integer-expt' changes when the base is 0
  2093. While `(expt 0 0)' is still 1, and `(expt 0 N)' for N > 0 is still
  2094. zero, `(expt 0 N)' for N < 0 is now a NaN value, and likewise for
  2095. integer-expt. This is more correct, and conforming to R6RS, but seems
  2096. to be incompatible with R5RS, which would return 0 for all non-zero
  2097. values of N.
  2098. *** `expt' and `integer-expt' are more generic, less strict
  2099. When raising to an exact non-negative integer exponent, `expt' and
  2100. `integer-expt' are now able to exponentiate any object that can be
  2101. multiplied using `*'. They can also raise an object to an exact
  2102. negative integer power if its reciprocal can be taken using `/'.
  2103. In order to allow this, the type of the first argument is no longer
  2104. checked when raising to an exact integer power. If the exponent is 0
  2105. or 1, the first parameter is not manipulated at all, and need not
  2106. even support multiplication.
  2107. *** Infinities are no longer integers, nor rationals
  2108. scm_integer_p `integer?' and scm_rational_p `rational?' now return #f
  2109. for infinities, per R6RS. Previously they returned #t for real
  2110. infinities. The real infinities and NaNs are still considered real by
  2111. scm_real `real?' however, per R6RS.
  2112. *** NaNs are no longer rationals
  2113. scm_rational_p `rational?' now returns #f for NaN values, per R6RS.
  2114. Previously it returned #t for real NaN values. They are still
  2115. considered real by scm_real `real?' however, per R6RS.
  2116. *** `inf?' and `nan?' now throw exceptions for non-reals
  2117. The domain of `inf?' and `nan?' is the real numbers. Guile now signals
  2118. an error when a non-real number or non-number is passed to these
  2119. procedures. (Note that NaNs _are_ considered numbers by scheme, despite
  2120. their name).
  2121. *** `rationalize' bugfixes and changes
  2122. Fixed bugs in scm_rationalize `rationalize'. Previously, it returned
  2123. exact integers unmodified, although that was incorrect if the epsilon
  2124. was at least 1 or inexact, e.g. (rationalize 4 1) should return 3 per
  2125. R5RS and R6RS, but previously it returned 4. It also now handles
  2126. cases involving infinities and NaNs properly, per R6RS.
  2127. *** Trigonometric functions now return exact numbers in some cases
  2128. scm_sin `sin', scm_cos `cos', scm_tan `tan', scm_asin `asin', scm_acos
  2129. `acos', scm_atan `atan', scm_sinh `sinh', scm_cosh `cosh', scm_tanh
  2130. `tanh', scm_sys_asinh `asinh', scm_sys_acosh `acosh', and
  2131. scm_sys_atanh `atanh' now return exact results in some cases.
  2132. *** New procedure: `finite?'
  2133. Add scm_finite_p `finite?' from R6RS to guile core, which returns #t
  2134. if and only if its argument is neither infinite nor a NaN. Note that
  2135. this is not the same as (not (inf? x)) or (not (infinite? x)), since
  2136. NaNs are neither finite nor infinite.
  2137. *** Improved exactness handling for complex number parsing
  2138. When parsing non-real complex numbers, exactness specifiers are now
  2139. applied to each component, as is done in PLT Scheme. For complex
  2140. numbers written in rectangular form, exactness specifiers are applied
  2141. to the real and imaginary parts before calling scm_make_rectangular.
  2142. For complex numbers written in polar form, exactness specifiers are
  2143. applied to the magnitude and angle before calling scm_make_polar.
  2144. Previously, exactness specifiers were applied to the number as a whole
  2145. _after_ calling scm_make_rectangular or scm_make_polar.
  2146. For example, (string->number "#i5.0+0i") now does the equivalent of:
  2147. (make-rectangular (exact->inexact 5.0) (exact->inexact 0))
  2148. which yields 5.0+0.0i. Previously it did the equivalent of:
  2149. (exact->inexact (make-rectangular 5.0 0))
  2150. which yielded 5.0.
  2151. ** Unicode characters
  2152. Unicode characters may be entered in octal format via e.g. `#\454', or
  2153. created via (integer->char 300). A hex external representation will
  2154. probably be introduced at some point.
  2155. ** Unicode strings
  2156. Internally, strings are now represented either in the `latin-1'
  2157. encoding, one byte per character, or in UTF-32, with four bytes per
  2158. character. Strings manage their own allocation, switching if needed.
  2159. Extended characters may be written in a literal string using the
  2160. hexadecimal escapes `\xXX', `\uXXXX', or `\UXXXXXX', for 8-bit, 16-bit,
  2161. or 24-bit codepoints, respectively, or entered directly in the native
  2162. encoding of the port on which the string is read.
  2163. ** Unicode symbols
  2164. One may now use U+03BB (GREEK SMALL LETTER LAMBDA) as an identifier.
  2165. ** Support for non-ASCII source code files
  2166. The default reader now handles source code files for some of the
  2167. non-ASCII character encodings, such as UTF-8. A non-ASCII source file
  2168. should have an encoding declaration near the top of the file. Also,
  2169. there is a new function, `file-encoding', that scans a port for a coding
  2170. declaration. See the section of the manual entitled, "Character Encoding
  2171. of Source Files".
  2172. The pre-1.9.3 reader handled 8-bit clean but otherwise unspecified source
  2173. code. This use is now discouraged. Binary input and output is
  2174. currently supported by opening ports in the ISO-8859-1 locale.
  2175. ** Source files default to UTF-8.
  2176. If source files do not specify their encoding via a `coding:' block,
  2177. the default encoding is UTF-8, instead of being taken from the current
  2178. locale.
  2179. ** Interactive Guile installs the current locale.
  2180. Instead of leaving the user in the "C" locale, running the Guile REPL
  2181. installs the current locale. [FIXME xref?]
  2182. ** Support for locale transcoding when reading from and writing to ports
  2183. Ports now have an associated character encoding, and port read and write
  2184. operations do conversion to and from locales automatically. Ports also
  2185. have an associated strategy for how to deal with locale conversion
  2186. failures.
  2187. See the documentation in the manual for the four new support functions,
  2188. `set-port-encoding!', `port-encoding', `set-port-conversion-strategy!',
  2189. and `port-conversion-strategy'.
  2190. ** String and SRFI-13 functions can operate on Unicode strings
  2191. ** Unicode support for SRFI-14 character sets
  2192. The default character sets are no longer locale dependent and contain
  2193. characters from the whole Unicode range. There is a new predefined
  2194. character set, `char-set:designated', which contains all assigned
  2195. Unicode characters. There is a new debugging function, `%char-set-dump'.
  2196. ** Character functions operate on Unicode characters
  2197. `char-upcase' and `char-downcase' use default Unicode casing rules.
  2198. Character comparisons such as `char<?' and `char-ci<?' now sort based on
  2199. Unicode code points.
  2200. ** Global variables `scm_charnames' and `scm_charnums' are removed
  2201. These variables contained the names of control characters and were
  2202. used when writing characters. While these were global, they were
  2203. never intended to be public API. They have been replaced with private
  2204. functions.
  2205. ** EBCDIC support is removed
  2206. There was an EBCDIC compile flag that altered some of the character
  2207. processing. It appeared that full EBCDIC support was never completed
  2208. and was unmaintained.
  2209. ** Compile-time warnings
  2210. Guile can warn about potentially unbound free variables. Pass the
  2211. -Wunbound-variable on the `guile-tools compile' command line, or add
  2212. `#:warnings '(unbound-variable)' to your `compile' or `compile-file'
  2213. invocation. Warnings are also enabled by default for expressions entered
  2214. at the REPL.
  2215. Guile can also warn when you pass the wrong number of arguments to a
  2216. procedure, with -Warity-mismatch, or `arity-mismatch' in the
  2217. `#:warnings' as above.
  2218. Other warnings include `-Wunused-variable' and `-Wunused-toplevel', to
  2219. warn about unused local or global (top-level) variables, and `-Wformat',
  2220. to check for various errors related to the `format' procedure.
  2221. ** A new `memoize-symbol' evaluator trap has been added.
  2222. This trap can be used for efficiently implementing a Scheme code
  2223. coverage.
  2224. ** Duplicate bindings among used modules are resolved lazily.
  2225. This slightly improves program startup times.
  2226. ** New thread cancellation and thread cleanup API
  2227. See `cancel-thread', `set-thread-cleanup!', and `thread-cleanup'.
  2228. ** New threads are in `(guile-user)' by default, not `(guile)'
  2229. It used to be that a new thread entering Guile would do so in the
  2230. `(guile)' module, unless this was the first time Guile was initialized,
  2231. in which case it was `(guile-user)'. This has been fixed to have all
  2232. new threads unknown to Guile default to `(guile-user)'.
  2233. ** New helpers: `print-exception', `set-exception-printer!'
  2234. These functions implement an extensible exception printer. Guile
  2235. registers printers for all of the exceptions it throws. Users may add
  2236. their own printers. There is also `scm_print_exception', for use by C
  2237. programs. Pleasantly, this allows SRFI-35 and R6RS exceptions to be
  2238. printed appropriately.
  2239. ** GOOPS dispatch in scheme
  2240. As an implementation detail, GOOPS dispatch is no longer implemented by
  2241. special evaluator bytecodes, but rather directly via a Scheme function
  2242. associated with an applicable struct. There is some VM support for the
  2243. underlying primitives, like `class-of'.
  2244. This change will in the future allow users to customize generic function
  2245. dispatch without incurring a performance penalty, and allow us to
  2246. implement method combinations.
  2247. ** Applicable struct support
  2248. One may now make structs from Scheme that may be applied as procedures.
  2249. To do so, make a struct whose vtable is `<applicable-struct-vtable>'.
  2250. That struct will be the vtable of your applicable structs; instances of
  2251. that new struct are assumed to have the procedure in their first slot.
  2252. `<applicable-struct-vtable>' is like Common Lisp's
  2253. `funcallable-standard-class'. Likewise there is
  2254. `<applicable-struct-with-setter-vtable>', which looks for the setter in
  2255. the second slot. This needs to be better documented.
  2256. ** GOOPS cleanups.
  2257. GOOPS had a number of concepts that were relevant to the days of Tcl,
  2258. but not any more: operators and entities, mainly. These objects were
  2259. never documented, and it is unlikely that they were ever used. Operators
  2260. were a kind of generic specific to the Tcl support. Entities were
  2261. replaced by applicable structs, mentioned above.
  2262. ** New struct slot allocation: "hidden"
  2263. A hidden slot is readable and writable, but will not be initialized by a
  2264. call to make-struct. For example in your layout you would say "ph"
  2265. instead of "pw". Hidden slots are useful for adding new slots to a
  2266. vtable without breaking existing invocations to make-struct.
  2267. ** eqv? not a generic
  2268. One used to be able to extend `eqv?' as a primitive-generic, but no
  2269. more. Because `eqv?' is in the expansion of `case' (via `memv'), which
  2270. should be able to compile to static dispatch tables, it doesn't make
  2271. sense to allow extensions that would subvert this optimization.
  2272. ** `inet-ntop' and `inet-pton' are always available.
  2273. Guile now use a portable implementation of `inet_pton'/`inet_ntop', so
  2274. there is no more need to use `inet-aton'/`inet-ntoa'. The latter
  2275. functions are deprecated.
  2276. ** `getopt-long' parsing errors throw to `quit', not `misc-error'
  2277. This change should inhibit backtraces on argument parsing errors.
  2278. `getopt-long' has been modified to print out the error that it throws
  2279. itself.
  2280. ** New primitive: `tmpfile'.
  2281. See "File System" in the manual.
  2282. ** Random generator state may be serialized to a datum
  2283. `random-state->datum' will serialize a random state to a datum, which
  2284. may be written out, read back in later, and revivified using
  2285. `datum->random-state'. See "Random" in the manual, for more details.
  2286. ** Fix random number generator on 64-bit platforms
  2287. There was a nasty bug on 64-bit platforms in which asking for a random
  2288. integer with a range between 2**32 and 2**64 caused a segfault. After
  2289. many embarrassing iterations, this was fixed.
  2290. ** Fast bit operations.
  2291. The bit-twiddling operations `ash', `logand', `logior', and `logxor' now
  2292. have dedicated bytecodes. Guile is not just for symbolic computation,
  2293. it's for number crunching too.
  2294. ** Faster SRFI-9 record access
  2295. SRFI-9 records are now implemented directly on top of Guile's structs,
  2296. and their accessors are defined in such a way that normal call-sites
  2297. inline to special VM opcodes, while still allowing for the general case
  2298. (e.g. passing a record accessor to `apply').
  2299. ** R6RS block comment support
  2300. Guile now supports R6RS nested block comments. The start of a comment is
  2301. marked with `#|', and the end with `|#'.
  2302. ** `guile-2' cond-expand feature
  2303. To test if your code is running under Guile 2.0 (or its alpha releases),
  2304. test for the `guile-2' cond-expand feature. Like this:
  2305. (cond-expand (guile-2 (eval-when (compile)
  2306. ;; This must be evaluated at compile time.
  2307. (fluid-set! current-reader my-reader)))
  2308. (guile
  2309. ;; Earlier versions of Guile do not have a
  2310. ;; separate compilation phase.
  2311. (fluid-set! current-reader my-reader)))
  2312. ** New global variables: %load-compiled-path, %load-compiled-extensions
  2313. These are analogous to %load-path and %load-extensions.
  2314. ** New fluid: `%file-port-name-canonicalization'
  2315. This fluid parameterizes the file names that are associated with file
  2316. ports. If %file-port-name-canonicalization is 'absolute, then file names
  2317. are canonicalized to be absolute paths. If it is 'relative, then the
  2318. name is canonicalized, but any prefix corresponding to a member of
  2319. `%load-path' is stripped off. Otherwise the names are passed through
  2320. unchanged.
  2321. In addition, the `compile-file' and `compile-and-load' procedures bind
  2322. %file-port-name-canonicalization to their `#:canonicalization' keyword
  2323. argument, which defaults to 'relative. In this way, one might compile
  2324. "../module/ice-9/boot-9.scm", but the path that gets residualized into
  2325. the .go is "ice-9/boot-9.scm".
  2326. ** New procedure, `make-promise'
  2327. `(make-promise (lambda () foo))' is equivalent to `(delay foo)'.
  2328. ** `defined?' may accept a module as its second argument
  2329. Previously it only accepted internal structures from the evaluator.
  2330. ** New entry into %guile-build-info: `ccachedir'
  2331. ** Fix bug in `module-bound?'.
  2332. `module-bound?' was returning true if a module did have a local
  2333. variable, but one that was unbound, but another imported module bound
  2334. the variable. This was an error, and was fixed.
  2335. ** `(ice-9 syncase)' has been deprecated.
  2336. As syntax-case is available by default, importing `(ice-9 syncase)' has
  2337. no effect, and will trigger a deprecation warning.
  2338. ** New readline history functions
  2339. The (ice-9 readline) module now provides add-history, read-history,
  2340. write-history and clear-history, which wrap the corresponding GNU
  2341. History library functions.
  2342. ** Removed deprecated uniform array procedures:
  2343. dimensions->uniform-array, list->uniform-array, array-prototype
  2344. Instead, use make-typed-array, list->typed-array, or array-type,
  2345. respectively.
  2346. ** Deprecate the old `scm-style-repl'
  2347. The following bindings from boot-9 are now found in `(ice-9
  2348. scm-style-repl)': `scm-style-repl', `error-catching-loop',
  2349. `error-catching-repl', `bad-throw', `scm-repl-silent'
  2350. `assert-repl-silence', `repl-print-unspecified',
  2351. `assert-repl-print-unspecified', `scm-repl-verbose',
  2352. `assert-repl-verbosity', `scm-repl-prompt', `set-repl-prompt!', `repl',
  2353. `default-pre-unwind-handler', `handle-system-error',
  2354. The following bindings have been deprecated, with no replacement:
  2355. `pre-unwind-handler-dispatch'.
  2356. The following bindings have been totally removed:
  2357. `before-signal-stack'.
  2358. Deprecated forwarding shims have been installed so that users that
  2359. expect these bindings in the main namespace will still work, but receive
  2360. a deprecation warning.
  2361. ** `set-batch-mode?!' replaced by `ensure-batch-mode!'
  2362. "Batch mode" is a flag used to tell a program that it is not running
  2363. interactively. One usually turns it on after a fork. It may not be
  2364. turned off. `ensure-batch-mode!' deprecates the old `set-batch-mode?!',
  2365. because it is a better interface, as it can only turn on batch mode, not
  2366. turn it off.
  2367. ** Deprecate `save-stack', `the-last-stack'
  2368. It used to be that the way to debug programs in Guile was to capture the
  2369. stack at the time of error, drop back to the REPL, then debug that
  2370. stack. But this approach didn't compose, was tricky to get right in the
  2371. presence of threads, and was not very powerful.
  2372. So `save-stack', `stack-saved?', and `the-last-stack' have been moved to
  2373. `(ice-9 save-stack)', with deprecated bindings left in the root module.
  2374. ** `top-repl' has its own module
  2375. The `top-repl' binding, called with Guile is run interactively, is now
  2376. is its own module, `(ice-9 top-repl)'. A deprecated forwarding shim was
  2377. left in the default environment.
  2378. ** `display-error' takes a frame
  2379. The `display-error' / `scm_display_error' helper now takes a frame as an
  2380. argument instead of a stack. Stacks are still supported in deprecated
  2381. builds. Additionally, `display-error' will again source location
  2382. information for the error.
  2383. ** No more `(ice-9 debug)'
  2384. This module had some debugging helpers that are no longer applicable to
  2385. the current debugging model. Importing this module will produce a
  2386. deprecation warning. Users should contact bug-guile for support.
  2387. ** Remove obsolete debug-options
  2388. Removed `breakpoints', `trace', `procnames', `indent', `frames',
  2389. `maxdepth', and `debug' debug-options.
  2390. ** `backtrace' debug option on by default
  2391. Given that Guile 2.0 can always give you a backtrace, backtraces are now
  2392. on by default.
  2393. ** `turn-on-debugging' deprecated
  2394. ** Remove obsolete print-options
  2395. The `source' and `closure-hook' print options are obsolete, and have
  2396. been removed.
  2397. ** Remove obsolete read-options
  2398. The "elisp-strings" and "elisp-vectors" read options were unused and
  2399. obsolete, so they have been removed.
  2400. ** Remove eval-options and trap-options
  2401. Eval-options and trap-options are obsolete with the new VM and
  2402. evaluator.
  2403. ** Remove (ice-9 debugger) and (ice-9 debugging)
  2404. See "Traps" and "Interactive Debugging" in the manual, for information
  2405. on their replacements.
  2406. ** Remove the GDS Emacs integration
  2407. See "Using Guile in Emacs" in the manual, for info on how we think you
  2408. should use Guile with Emacs.
  2409. ** Deprecated: `lazy-catch'
  2410. `lazy-catch' was a form that captured the stack at the point of a
  2411. `throw', but the dynamic state at the point of the `catch'. It was a bit
  2412. crazy. Please change to use `catch', possibly with a throw-handler, or
  2413. `with-throw-handler'.
  2414. ** Deprecated: primitive properties
  2415. The `primitive-make-property', `primitive-property-set!',
  2416. `primitive-property-ref', and `primitive-property-del!' procedures were
  2417. crufty and only used to implement object properties, which has a new,
  2418. threadsafe implementation. Use object properties or weak hash tables
  2419. instead.
  2420. ** Deprecated `@bind' syntax
  2421. `@bind' was part of an older implementation of the Emacs Lisp language,
  2422. and is no longer used.
  2423. ** Miscellaneous other deprecations
  2424. `cuserid' has been deprecated, as it only returns 8 bytes of a user's
  2425. login. Use `(passwd:name (getpwuid (geteuid)))' instead.
  2426. Additionally, the procedures `apply-to-args', `has-suffix?', `scheme-file-suffix'
  2427. `get-option', `for-next-option', `display-usage-report',
  2428. `transform-usage-lambda', `collect', and `set-batch-mode?!' have all
  2429. been deprecated.
  2430. ** Add support for unbound fluids
  2431. See `make-unbound-fluid', `fluid-unset!', and `fluid-bound?' in the
  2432. manual.
  2433. ** Add `variable-unset!'
  2434. See "Variables" in the manual, for more details.
  2435. ** Last but not least, the `λ' macro can be used in lieu of `lambda'
  2436. * Changes to the C interface
  2437. ** Guile now uses libgc, the Boehm-Demers-Weiser garbage collector
  2438. The semantics of `scm_gc_malloc ()' have been changed, in a
  2439. backward-compatible way. A new allocation routine,
  2440. `scm_gc_malloc_pointerless ()', was added.
  2441. Libgc is a conservative GC, which we hope will make interaction with C
  2442. code easier and less error-prone.
  2443. ** New procedures: `scm_to_stringn', `scm_from_stringn'
  2444. ** New procedures: scm_{to,from}_{utf8,latin1}_symbol{n,}
  2445. ** New procedures: scm_{to,from}_{utf8,utf32,latin1}_string{n,}
  2446. These new procedures convert to and from string representations in
  2447. particular encodings.
  2448. Users should continue to use locale encoding for user input, user
  2449. output, or interacting with the C library.
  2450. Use the Latin-1 functions for ASCII, and for literals in source code.
  2451. Use UTF-8 functions for interaction with modern libraries which deal in
  2452. UTF-8, and UTF-32 for interaction with utf32-using libraries.
  2453. Otherwise, use scm_to_stringn or scm_from_stringn with a specific
  2454. encoding.
  2455. ** New type definitions for `scm_t_intptr' and friends.
  2456. `SCM_T_UINTPTR_MAX', `SCM_T_INTPTR_MIN', `SCM_T_INTPTR_MAX',
  2457. `SIZEOF_SCM_T_BITS', `scm_t_intptr' and `scm_t_uintptr' are now
  2458. available to C. Have fun!
  2459. ** The GH interface (deprecated in version 1.6, 2001) was removed.
  2460. ** Internal `scm_i_' functions now have "hidden" linkage with GCC/ELF
  2461. This makes these internal functions technically not callable from
  2462. application code.
  2463. ** Functions for handling `scm_option' now no longer require an argument
  2464. indicating length of the `scm_t_option' array.
  2465. ** Procedures-with-setters are now implemented using applicable structs
  2466. From a user's perspective this doesn't mean very much. But if, for some
  2467. odd reason, you used the SCM_PROCEDURE_WITH_SETTER_P, SCM_PROCEDURE, or
  2468. SCM_SETTER macros, know that they're deprecated now. Also, scm_tc7_pws
  2469. is gone.
  2470. ** Remove old evaluator closures
  2471. There used to be ranges of typecodes allocated to interpreted data
  2472. structures, but that it no longer the case, given that interpreted
  2473. procedure are now just regular VM closures. As a result, there is a
  2474. newly free tc3, and a number of removed macros. See the ChangeLog for
  2475. details.
  2476. ** Primitive procedures are now VM trampoline procedures
  2477. It used to be that there were something like 12 different typecodes
  2478. allocated to primitive procedures, each with its own calling convention.
  2479. Now there is only one, the gsubr. This may affect user code if you were
  2480. defining a procedure using scm_c_make_subr rather scm_c_make_gsubr. The
  2481. solution is to switch to use scm_c_make_gsubr. This solution works well
  2482. both with the old 1.8 and with the current 1.9 branch.
  2483. Guile's old evaluator used to have special cases for applying "gsubrs",
  2484. primitive procedures with specified numbers of required, optional, and
  2485. rest arguments. Now, however, Guile represents gsubrs as normal VM
  2486. procedures, with appropriate bytecode to parse out the correct number of
  2487. arguments, including optional and rest arguments, and then with a
  2488. special bytecode to apply the gsubr.
  2489. This allows primitive procedures to appear on the VM stack, allowing
  2490. them to be accurately counted in profiles. Also they now have more
  2491. debugging information attached to them -- their number of arguments, for
  2492. example. In addition, the VM can completely inline the application
  2493. mechanics, allowing for faster primitive calls.
  2494. However there are some changes on the C level. There is no more
  2495. `scm_tc7_gsubr' or `scm_tcs_subrs' typecode for primitive procedures, as
  2496. they are just VM procedures. Likewise the macros `SCM_GSUBR_TYPE',
  2497. `SCM_GSUBR_MAKTYPE', `SCM_GSUBR_REQ', `SCM_GSUBR_OPT', and
  2498. `SCM_GSUBR_REST' are gone, as are `SCM_SUBR_META_INFO', `SCM_SUBR_PROPS'
  2499. `SCM_SET_SUBR_GENERIC_LOC', and `SCM_SUBR_ARITY_TO_TYPE'.
  2500. Perhaps more significantly, `scm_c_make_subr',
  2501. `scm_c_make_subr_with_generic', `scm_c_define_subr', and
  2502. `scm_c_define_subr_with_generic'. They all operated on subr typecodes,
  2503. and there are no more subr typecodes. Use the scm_c_make_gsubr family
  2504. instead.
  2505. Normal users of gsubrs should not be affected, though, as the
  2506. scm_c_make_gsubr family still is the correct way to create primitive
  2507. procedures.
  2508. ** Remove deprecated array C interfaces
  2509. Removed the deprecated array functions `scm_i_arrayp',
  2510. `scm_i_array_ndim', `scm_i_array_mem', `scm_i_array_v',
  2511. `scm_i_array_base', `scm_i_array_dims', and the deprecated macros
  2512. `SCM_ARRAYP', `SCM_ARRAY_NDIM', `SCM_ARRAY_CONTP', `SCM_ARRAY_MEM',
  2513. `SCM_ARRAY_V', `SCM_ARRAY_BASE', and `SCM_ARRAY_DIMS'.
  2514. ** Remove unused snarf macros
  2515. `SCM_DEFINE1', `SCM_PRIMITIVE_GENERIC_1', `SCM_PROC1, and `SCM_GPROC1'
  2516. are no more. Use SCM_DEFINE or SCM_PRIMITIVE_GENERIC instead.
  2517. ** New functions: `scm_call_n', `scm_c_run_hookn'
  2518. `scm_call_n' applies to apply a function to an array of arguments.
  2519. `scm_c_run_hookn' runs a hook with an array of arguments.
  2520. ** Some SMOB types changed to have static typecodes
  2521. Fluids, dynamic states, and hash tables used to be SMOB objects, but now
  2522. they have statically allocated tc7 typecodes.
  2523. ** Preparations for changing SMOB representation
  2524. If things go right, we'll be changing the SMOB representation soon. To
  2525. that end, we did a lot of cleanups to calls to e.g. SCM_CELL_WORD_2(x) when
  2526. the code meant SCM_SMOB_DATA_2(x); user code will need similar changes
  2527. in the future. Code accessing SMOBs using SCM_CELL macros was never
  2528. correct, but until now things still worked. Users should be aware of
  2529. such changes.
  2530. ** Changed invocation mechanics of applicable SMOBs
  2531. Guile's old evaluator used to have special cases for applying SMOB
  2532. objects. Now, with the VM, when Guile sees a SMOB, it looks up a VM
  2533. trampoline procedure for it, and use the normal mechanics to apply the
  2534. trampoline. This simplifies procedure application in the normal,
  2535. non-SMOB case.
  2536. The upshot is that the mechanics used to apply a SMOB are different from
  2537. 1.8. Descriptors no longer have `apply_0', `apply_1', `apply_2', and
  2538. `apply_3' functions, and the macros SCM_SMOB_APPLY_0 and friends are now
  2539. deprecated. Just use the scm_call_0 family of procedures.
  2540. ** Removed support shlibs for SRFIs 1, 4, 13, 14, and 60
  2541. Though these SRFI support libraries did expose API, they encoded a
  2542. strange version string into their library names. That version was never
  2543. programmatically exported, so there was no way people could use the
  2544. libs.
  2545. This was a fortunate oversight, as it allows us to remove the need for
  2546. extra, needless shared libraries --- the C support code for SRFIs 4, 13,
  2547. and 14 was already in core --- and allow us to incrementally return the
  2548. SRFI implementation to Scheme.
  2549. ** New C function: scm_module_public_interface
  2550. This procedure corresponds to Scheme's `module-public-interface'.
  2551. ** Undeprecate `scm_the_root_module ()'
  2552. It's useful to be able to get the root module from C without doing a
  2553. full module lookup.
  2554. ** Inline vector allocation
  2555. Instead of having vectors point out into the heap for their data, their
  2556. data is now allocated inline to the vector object itself. The same is
  2557. true for bytevectors, by default, though there is an indirection
  2558. available which should allow for making a bytevector from an existing
  2559. memory region.
  2560. ** New struct constructors that don't involve making lists
  2561. `scm_c_make_struct' and `scm_c_make_structv' are new varargs and array
  2562. constructors, respectively, for structs. You might find them useful.
  2563. ** Stack refactor
  2564. In Guile 1.8, there were debugging frames on the C stack. Now there is
  2565. no more need to explicitly mark the stack in this way, because Guile has
  2566. a VM stack that it knows how to walk, which simplifies the C API
  2567. considerably. See the ChangeLog for details; the relevant interface is
  2568. in libguile/stacks.h. The Scheme API has not been changed significantly.
  2569. ** Removal of Guile's primitive object system.
  2570. There were a number of pieces in `objects.[ch]' that tried to be a
  2571. minimal object system, but were never documented, and were quickly
  2572. obseleted by GOOPS' merge into Guile proper. So `scm_make_class_object',
  2573. `scm_make_subclass_object', `scm_metaclass_standard', and like symbols
  2574. from objects.h are no more. In the very unlikely case in which these
  2575. were useful to you, we urge you to contact guile-devel.
  2576. ** No future.
  2577. Actually the future is still in the state that it was, is, and ever
  2578. shall be, Amen, except that `futures.c' and `futures.h' are no longer a
  2579. part of it. These files were experimental, never compiled, and would be
  2580. better implemented in Scheme anyway. In the future, that is.
  2581. ** Deprecate trampolines
  2582. There used to be C functions `scm_trampoline_0', `scm_trampoline_1', and
  2583. so on. The point was to do some precomputation on the type of the
  2584. procedure, then return a specialized "call" procedure. However this
  2585. optimization wasn't actually an optimization, so it is now deprecated.
  2586. Just use `scm_call_0', etc instead.
  2587. ** Deprecated `scm_badargsp'
  2588. This function is unused in Guile, but was part of its API.
  2589. ** Better support for Lisp `nil'.
  2590. The bit representation of `nil' has been tweaked so that it is now very
  2591. efficient to check e.g. if a value is equal to Scheme's end-of-list or
  2592. Lisp's nil. Additionally there are a heap of new, specific predicates
  2593. like scm_is_null_or_nil.
  2594. ** Better integration of Lisp `nil'.
  2595. `scm_is_boolean', `scm_is_false', and `scm_is_null' all return true now
  2596. for Lisp's `nil'. This shouldn't affect any Scheme code at this point,
  2597. but when we start to integrate more with Emacs, it is possible that we
  2598. break code that assumes that, for example, `(not x)' implies that `x' is
  2599. `eq?' to `#f'. This is not a common assumption. Refactoring affected
  2600. code to rely on properties instead of identities will improve code
  2601. correctness. See "Nil" in the manual, for more details.
  2602. ** Support for static allocation of strings, symbols, and subrs.
  2603. Calls to snarfing CPP macros like SCM_DEFINE macro will now allocate
  2604. much of their associated data as static variables, reducing Guile's
  2605. memory footprint.
  2606. ** `scm_stat' has an additional argument, `exception_on_error'
  2607. ** `scm_primitive_load_path' has an additional argument `exception_on_not_found'
  2608. ** `scm_set_port_seek' and `scm_set_port_truncate' use the `scm_t_off' type
  2609. Previously they would use the `off_t' type, which is fragile since its
  2610. definition depends on the application's value for `_FILE_OFFSET_BITS'.
  2611. ** The `long_long' C type, deprecated in 1.8, has been removed
  2612. ** Removed deprecated uniform array procedures: scm_make_uve,
  2613. scm_array_prototype, scm_list_to_uniform_array,
  2614. scm_dimensions_to_uniform_array, scm_make_ra, scm_shap2ra, scm_cvref,
  2615. scm_ra_set_contp, scm_aind, scm_raprin1
  2616. These functions have been deprecated since early 2005.
  2617. * Changes to the distribution
  2618. ** Guile's license is now LGPLv3+
  2619. In other words the GNU Lesser General Public License, version 3 or
  2620. later (at the discretion of each person that chooses to redistribute
  2621. part of Guile).
  2622. ** AM_SILENT_RULES
  2623. Guile's build is visually quieter, due to the use of Automake 1.11's
  2624. AM_SILENT_RULES. Build as `make V=1' to see all of the output.
  2625. ** GOOPS documentation folded into Guile reference manual
  2626. GOOPS, Guile's object system, used to be documented in separate manuals.
  2627. This content is now included in Guile's manual directly.
  2628. ** `guile-config' will be deprecated in favor of `pkg-config'
  2629. `guile-config' has been rewritten to get its information from
  2630. `pkg-config', so this should be a transparent change. Note however that
  2631. guile.m4 has yet to be modified to call pkg-config instead of
  2632. guile-config.
  2633. ** Guile now provides `guile-2.0.pc' instead of `guile-1.8.pc'
  2634. Programs that use `pkg-config' to find Guile or one of its Autoconf
  2635. macros should now require `guile-2.0' instead of `guile-1.8'.
  2636. ** New installation directory: $(pkglibdir)/1.9/ccache
  2637. If $(libdir) is /usr/lib, for example, Guile will install its .go files
  2638. to /usr/lib/guile/1.9/ccache. These files are architecture-specific.
  2639. ** Parallel installability fixes
  2640. Guile now installs its header files to a effective-version-specific
  2641. directory, and includes the effective version (e.g. 2.0) in the library
  2642. name (e.g. libguile-2.0.so).
  2643. This change should be transparent to users, who should detect Guile via
  2644. the guile.m4 macro, or the guile-2.0.pc pkg-config file. It will allow
  2645. parallel installs for multiple versions of Guile development
  2646. environments.
  2647. ** Dynamically loadable extensions may be placed in a Guile-specific path
  2648. Before, Guile only searched the system library paths for extensions
  2649. (e.g. /usr/lib), which meant that the names of Guile extensions had to
  2650. be globally unique. Installing them to a Guile-specific extensions
  2651. directory is cleaner. Use `pkg-config --variable=extensiondir
  2652. guile-2.0' to get the location of the extensions directory.
  2653. ** User Scheme code may be placed in a version-specific path
  2654. Before, there was only one way to install user Scheme code to a
  2655. version-specific Guile directory: install to Guile's own path,
  2656. e.g. /usr/share/guile/2.0. The site directory,
  2657. e.g. /usr/share/guile/site, was unversioned. This has been changed to
  2658. add a version-specific site directory, e.g. /usr/share/guile/site/2.0,
  2659. searched before the global site directory.
  2660. ** New dependency: libgc
  2661. See http://www.hpl.hp.com/personal/Hans_Boehm/gc/, for more information.
  2662. ** New dependency: GNU libunistring
  2663. See http://www.gnu.org/software/libunistring/, for more information. Our
  2664. Unicode support uses routines from libunistring.
  2665. ** New dependency: libffi
  2666. See http://sourceware.org/libffi/, for more information.
  2667. Changes in 1.8.8 (since 1.8.7)
  2668. * Bugs fixed
  2669. ** Fix possible buffer overruns when parsing numbers
  2670. ** Avoid clash with system setjmp/longjmp on IA64
  2671. ** Fix `wrong type arg' exceptions with IPv6 addresses
  2672. Changes in 1.8.7 (since 1.8.6)
  2673. * New modules (see the manual for details)
  2674. ** `(srfi srfi-98)', an interface to access environment variables
  2675. * Bugs fixed
  2676. ** Fix compilation with `--disable-deprecated'
  2677. ** Fix %fast-slot-ref/set!, to avoid possible segmentation fault
  2678. ** Fix MinGW build problem caused by HAVE_STRUCT_TIMESPEC confusion
  2679. ** Fix build problem when scm_t_timespec is different from struct timespec
  2680. ** Fix build when compiled with -Wundef -Werror
  2681. ** More build fixes for `alphaev56-dec-osf5.1b' (Tru64)
  2682. ** Build fixes for `powerpc-ibm-aix5.3.0.0' (AIX 5.3)
  2683. ** With GCC, always compile with `-mieee' on `alpha*' and `sh*'
  2684. ** Better diagnose broken `(strftime "%z" ...)' in `time.test' (bug #24130)
  2685. ** Fix parsing of SRFI-88/postfix keywords longer than 128 characters
  2686. ** Fix reading of complex numbers where both parts are inexact decimals
  2687. ** Allow @ macro to work with (ice-9 syncase)
  2688. Previously, use of the @ macro in a module whose code is being
  2689. transformed by (ice-9 syncase) would cause an "Invalid syntax" error.
  2690. Now it works as you would expect (giving the value of the specified
  2691. module binding).
  2692. ** Have `scm_take_locale_symbol ()' return an interned symbol (bug #25865)
  2693. Changes in 1.8.6 (since 1.8.5)
  2694. * New features (see the manual for details)
  2695. ** New convenience function `scm_c_symbol_length ()'
  2696. ** Single stepping through code from Emacs
  2697. When you use GDS to evaluate Scheme code from Emacs, you can now use
  2698. `C-u' to indicate that you want to single step through that code. See
  2699. `Evaluating Scheme Code' in the manual for more details.
  2700. ** New "guile(1)" man page!
  2701. * Changes to the distribution
  2702. ** Automake's `AM_MAINTAINER_MODE' is no longer used
  2703. Thus, the `--enable-maintainer-mode' configure option is no longer
  2704. available: Guile is now always configured in "maintainer mode".
  2705. ** `ChangeLog' files are no longer updated
  2706. Instead, changes are detailed in the version control system's logs. See
  2707. the top-level `ChangeLog' files for details.
  2708. * Bugs fixed
  2709. ** `symbol->string' now returns a read-only string, as per R5RS
  2710. ** Fix incorrect handling of the FLAGS argument of `fold-matches'
  2711. ** `guile-config link' now prints `-L$libdir' before `-lguile'
  2712. ** Fix memory corruption involving GOOPS' `class-redefinition'
  2713. ** Fix possible deadlock in `mutex-lock'
  2714. ** Fix build issue on Tru64 and ia64-hp-hpux11.23 (`SCM_UNPACK' macro)
  2715. ** Fix build issue on mips, mipsel, powerpc and ia64 (stack direction)
  2716. ** Fix build issue on hppa2.0w-hp-hpux11.11 (`dirent64' and `readdir64_r')
  2717. ** Fix build issue on i386-unknown-freebsd7.0 ("break strict-aliasing rules")
  2718. ** Fix misleading output from `(help rationalize)'
  2719. ** Fix build failure on Debian hppa architecture (bad stack growth detection)
  2720. ** Fix `gcd' when called with a single, negative argument.
  2721. ** Fix `Stack overflow' errors seen when building on some platforms
  2722. ** Fix bug when `scm_with_guile ()' was called several times from the
  2723. same thread
  2724. ** The handler of SRFI-34 `with-exception-handler' is now invoked in the
  2725. dynamic environment of the call to `raise'
  2726. ** Fix potential deadlock in `make-struct'
  2727. ** Fix compilation problem with libltdl from Libtool 2.2.x
  2728. ** Fix sloppy bound checking in `string-{ref,set!}' with the empty string
  2729. Changes in 1.8.5 (since 1.8.4)
  2730. * Infrastructure changes
  2731. ** Guile repository switched from CVS to Git
  2732. The new repository can be accessed using
  2733. "git-clone git://git.sv.gnu.org/guile.git", or can be browsed on-line at
  2734. http://git.sv.gnu.org/gitweb/?p=guile.git . See `README' for details.
  2735. ** Add support for `pkg-config'
  2736. See "Autoconf Support" in the manual for details.
  2737. * New modules (see the manual for details)
  2738. ** `(srfi srfi-88)'
  2739. * New features (see the manual for details)
  2740. ** New `postfix' read option, for SRFI-88 keyword syntax
  2741. ** Some I/O primitives have been inlined, which improves I/O performance
  2742. ** New object-based traps infrastructure
  2743. This is a GOOPS-based infrastructure that builds on Guile's low-level
  2744. evaluator trap calls and facilitates the development of debugging
  2745. features like single-stepping, breakpoints, tracing and profiling.
  2746. See the `Traps' node of the manual for details.
  2747. ** New support for working on Guile code from within Emacs
  2748. Guile now incorporates the `GDS' library (previously distributed
  2749. separately) for working on Guile code from within Emacs. See the
  2750. `Using Guile In Emacs' node of the manual for details.
  2751. * Bugs fixed
  2752. ** `scm_add_slot ()' no longer segfaults (fixes bug #22369)
  2753. ** Fixed `(ice-9 match)' for patterns like `((_ ...) ...)'
  2754. Previously, expressions like `(match '((foo) (bar)) (((_ ...) ...) #t))'
  2755. would trigger an unbound variable error for `match:andmap'.
  2756. ** `(oop goops describe)' now properly provides the `describe' feature
  2757. ** Fixed `args-fold' from `(srfi srfi-37)'
  2758. Previously, parsing short option names of argument-less options would
  2759. lead to a stack overflow.
  2760. ** `(srfi srfi-35)' is now visible through `cond-expand'
  2761. ** Fixed type-checking for the second argument of `eval'
  2762. ** Fixed type-checking for SRFI-1 `partition'
  2763. ** Fixed `struct-ref' and `struct-set!' on "light structs"
  2764. ** Honor struct field access rights in GOOPS
  2765. ** Changed the storage strategy of source properties, which fixes a deadlock
  2766. ** Allow compilation of Guile-using programs in C99 mode with GCC 4.3 and later
  2767. ** Fixed build issue for GNU/Linux on IA64
  2768. ** Fixed build issues on NetBSD 1.6
  2769. ** Fixed build issue on Solaris 2.10 x86_64
  2770. ** Fixed build issue with DEC/Compaq/HP's compiler
  2771. ** Fixed `scm_from_complex_double' build issue on FreeBSD
  2772. ** Fixed `alloca' build issue on FreeBSD 6
  2773. ** Removed use of non-portable makefile constructs
  2774. ** Fixed shadowing of libc's <random.h> on Tru64, which broke compilation
  2775. ** Make sure all tests honor `$TMPDIR'
  2776. Changes in 1.8.4 (since 1.8.3)
  2777. * Bugs fixed
  2778. ** CR (ASCII 0x0d) is (again) recognized as a token delimiter by the reader
  2779. ** Fixed a segmentation fault which occurred when displaying the
  2780. backtrace of a stack with a promise object (made by `delay') in it.
  2781. ** Make `accept' leave guile mode while blocking
  2782. ** `scm_c_read ()' and `scm_c_write ()' now type-check their port argument
  2783. ** Fixed a build problem on AIX (use of func_data identifier)
  2784. ** Fixed a segmentation fault which occurred when hashx-ref or hashx-set! was
  2785. called with an associator proc that returns neither a pair nor #f.
  2786. ** Secondary threads now always return a valid module for (current-module).
  2787. ** Avoid MacOS build problems caused by incorrect combination of "64"
  2788. system and library calls.
  2789. ** `guile-snarf' now honors `$TMPDIR'
  2790. ** `guile-config compile' now reports CPPFLAGS used at compile-time
  2791. ** Fixed build with Sun Studio (Solaris 9)
  2792. ** Fixed wrong-type-arg errors when creating zero length SRFI-4
  2793. uniform vectors on AIX.
  2794. ** Fixed a deadlock that occurs upon GC with multiple threads.
  2795. ** Fixed compile problem with GCC on Solaris and AIX (use of _Complex_I)
  2796. ** Fixed autotool-derived build problems on AIX 6.1.
  2797. ** Fixed NetBSD/alpha support
  2798. ** Fixed MacOS build problem caused by use of rl_get_keymap(_name)
  2799. * New modules (see the manual for details)
  2800. ** `(srfi srfi-69)'
  2801. * Documentation fixes and improvements
  2802. ** Removed premature breakpoint documentation
  2803. The features described are not available in the series of 1.8.x
  2804. releases, so the documentation was misleading and has been removed.
  2805. ** More about Guile's default *random-state* variable
  2806. ** GOOPS: more about how to use `next-method'
  2807. * Changes to the distribution
  2808. ** Corrected a few files that referred incorrectly to the old GPL + special exception licence
  2809. In fact Guile since 1.8.0 has been licensed with the GNU Lesser
  2810. General Public License, and the few incorrect files have now been
  2811. fixed to agree with the rest of the Guile distribution.
  2812. ** Removed unnecessary extra copies of COPYING*
  2813. The distribution now contains a single COPYING.LESSER at its top level.
  2814. Changes in 1.8.3 (since 1.8.2)
  2815. * New modules (see the manual for details)
  2816. ** `(srfi srfi-35)'
  2817. ** `(srfi srfi-37)'
  2818. * Bugs fixed
  2819. ** The `(ice-9 slib)' module now works as expected
  2820. ** Expressions like "(set! 'x #t)" no longer yield a crash
  2821. ** Warnings about duplicate bindings now go to stderr
  2822. ** A memory leak in `make-socket-address' was fixed
  2823. ** Alignment issues (e.g., on SPARC) in network routines were fixed
  2824. ** A threading issue that showed up at least on NetBSD was fixed
  2825. ** Build problems on Solaris and IRIX fixed
  2826. * Implementation improvements
  2827. ** The reader is now faster, which reduces startup time
  2828. ** Procedures returned by `record-accessor' and `record-modifier' are faster
  2829. Changes in 1.8.2 (since 1.8.1):
  2830. * New procedures (see the manual for details)
  2831. ** set-program-arguments
  2832. ** make-vtable
  2833. * Incompatible changes
  2834. ** The body of a top-level `define' no longer sees the binding being created
  2835. In a top-level `define', the binding being created is no longer visible
  2836. from the `define' body. This breaks code like
  2837. "(define foo (begin (set! foo 1) (+ foo 1)))", where `foo' is now
  2838. unbound in the body. However, such code was not R5RS-compliant anyway,
  2839. per Section 5.2.1.
  2840. * Bugs fixed
  2841. ** Fractions were not `equal?' if stored in unreduced form.
  2842. (A subtle problem, since printing a value reduced it, making it work.)
  2843. ** srfi-60 `copy-bit' failed on 64-bit systems
  2844. ** "guile --use-srfi" option at the REPL can replace core functions
  2845. (Programs run with that option were ok, but in the interactive REPL
  2846. the core bindings got priority, preventing SRFI replacements or
  2847. extensions.)
  2848. ** `regexp-exec' doesn't abort() on #\nul in the input or bad flags arg
  2849. ** `kill' on mingw throws an error for a PID other than oneself
  2850. ** Procedure names are attached to procedure-with-setters
  2851. ** Array read syntax works with negative lower bound
  2852. ** `array-in-bounds?' fix if an array has different lower bounds on each index
  2853. ** `*' returns exact 0 for "(* inexact 0)"
  2854. This follows what it always did for "(* 0 inexact)".
  2855. ** SRFI-19: Value returned by `(current-time time-process)' was incorrect
  2856. ** SRFI-19: `date->julian-day' did not account for timezone offset
  2857. ** `ttyname' no longer crashes when passed a non-tty argument
  2858. ** `inet-ntop' no longer crashes on SPARC when passed an `AF_INET' address
  2859. ** Small memory leaks have been fixed in `make-fluid' and `add-history'
  2860. ** GOOPS: Fixed a bug in `method-more-specific?'
  2861. ** Build problems on Solaris fixed
  2862. ** Build problems on HP-UX IA64 fixed
  2863. ** Build problems on MinGW fixed
  2864. Changes in 1.8.1 (since 1.8.0):
  2865. * LFS functions are now used to access 64-bit files on 32-bit systems.
  2866. * New procedures (see the manual for details)
  2867. ** primitive-_exit - [Scheme] the-root-module
  2868. ** scm_primitive__exit - [C]
  2869. ** make-completion-function - [Scheme] (ice-9 readline)
  2870. ** scm_c_locale_stringn_to_number - [C]
  2871. ** scm_srfi1_append_reverse [C]
  2872. ** scm_srfi1_append_reverse_x [C]
  2873. ** scm_log - [C]
  2874. ** scm_log10 - [C]
  2875. ** scm_exp - [C]
  2876. ** scm_sqrt - [C]
  2877. * Bugs fixed
  2878. ** Build problems have been fixed on MacOS, SunOS, and QNX.
  2879. ** `strftime' fix sign of %z timezone offset.
  2880. ** A one-dimensional array can now be 'equal?' to a vector.
  2881. ** Structures, records, and SRFI-9 records can now be compared with `equal?'.
  2882. ** SRFI-14 standard char sets are recomputed upon a successful `setlocale'.
  2883. ** `record-accessor' and `record-modifier' now have strict type checks.
  2884. Record accessor and modifier procedures now throw an error if the
  2885. record type of the record they're given is not the type expected.
  2886. (Previously accessors returned #f and modifiers silently did nothing).
  2887. ** It is now OK to use both autoload and use-modules on a given module.
  2888. ** `apply' checks the number of arguments more carefully on "0 or 1" funcs.
  2889. Previously there was no checking on primatives like make-vector that
  2890. accept "one or two" arguments. Now there is.
  2891. ** The srfi-1 assoc function now calls its equality predicate properly.
  2892. Previously srfi-1 assoc would call the equality predicate with the key
  2893. last. According to the SRFI, the key should be first.
  2894. ** A bug in n-par-for-each and n-for-each-par-map has been fixed.
  2895. ** The array-set! procedure no longer segfaults when given a bit vector.
  2896. ** Bugs in make-shared-array have been fixed.
  2897. ** string<? and friends now follow char<? etc order on 8-bit chars.
  2898. ** The format procedure now handles inf and nan values for ~f correctly.
  2899. ** exact->inexact should no longer overflow when given certain large fractions.
  2900. ** srfi-9 accessor and modifier procedures now have strict record type checks.
  2901. This matches the srfi-9 specification.
  2902. ** (ice-9 ftw) procedures won't ignore different files with same inode number.
  2903. Previously the (ice-9 ftw) procedures would ignore any file that had
  2904. the same inode number as a file they had already seen, even if that
  2905. file was on a different device.
  2906. Changes in 1.8.0 (changes since the 1.6.x series):
  2907. * Changes to the distribution
  2908. ** Guile is now licensed with the GNU Lesser General Public License.
  2909. ** The manual is now licensed with the GNU Free Documentation License.
  2910. ** Guile now requires GNU MP (http://swox.com/gmp).
  2911. Guile now uses the GNU MP library for arbitrary precision arithmetic.
  2912. ** Guile now has separate private and public configuration headers.
  2913. That is, things like HAVE_STRING_H no longer leak from Guile's
  2914. headers.
  2915. ** Guile now provides and uses an "effective" version number.
  2916. Guile now provides scm_effective_version and effective-version
  2917. functions which return the "effective" version number. This is just
  2918. the normal full version string without the final micro-version number,
  2919. so the current effective-version is "1.8". The effective version
  2920. should remain unchanged during a stable series, and should be used for
  2921. items like the versioned share directory name
  2922. i.e. /usr/share/guile/1.8.
  2923. Providing an unchanging version number during a stable release for
  2924. things like the versioned share directory can be particularly
  2925. important for Guile "add-on" packages, since it provides a directory
  2926. that they can install to that won't be changed out from under them
  2927. with each micro release during a stable series.
  2928. ** Thread implementation has changed.
  2929. When you configure "--with-threads=null", you will get the usual
  2930. threading API (call-with-new-thread, make-mutex, etc), but you can't
  2931. actually create new threads. Also, "--with-threads=no" is now
  2932. equivalent to "--with-threads=null". This means that the thread API
  2933. is always present, although you might not be able to create new
  2934. threads.
  2935. When you configure "--with-threads=pthreads" or "--with-threads=yes",
  2936. you will get threads that are implemented with the portable POSIX
  2937. threads. These threads can run concurrently (unlike the previous
  2938. "coop" thread implementation), but need to cooperate for things like
  2939. the GC.
  2940. The default is "pthreads", unless your platform doesn't have pthreads,
  2941. in which case "null" threads are used.
  2942. See the manual for details, nodes "Initialization", "Multi-Threading",
  2943. "Blocking", and others.
  2944. ** There is the new notion of 'discouraged' features.
  2945. This is a milder form of deprecation.
  2946. Things that are discouraged should not be used in new code, but it is
  2947. OK to leave them in old code for now. When a discouraged feature is
  2948. used, no warning message is printed like there is for 'deprecated'
  2949. features. Also, things that are merely discouraged are nevertheless
  2950. implemented efficiently, while deprecated features can be very slow.
  2951. You can omit discouraged features from libguile by configuring it with
  2952. the '--disable-discouraged' option.
  2953. ** Deprecation warnings can be controlled at run-time.
  2954. (debug-enable 'warn-deprecated) switches them on and (debug-disable
  2955. 'warn-deprecated) switches them off.
  2956. ** Support for SRFI 61, extended cond syntax for multiple values has
  2957. been added.
  2958. This SRFI is always available.
  2959. ** Support for require-extension, SRFI-55, has been added.
  2960. The SRFI-55 special form `require-extension' has been added. It is
  2961. available at startup, and provides a portable way to load Scheme
  2962. extensions. SRFI-55 only requires support for one type of extension,
  2963. "srfi"; so a set of SRFIs may be loaded via (require-extension (srfi 1
  2964. 13 14)).
  2965. ** New module (srfi srfi-26) provides support for `cut' and `cute'.
  2966. The (srfi srfi-26) module is an implementation of SRFI-26 which
  2967. provides the `cut' and `cute' syntax. These may be used to specialize
  2968. parameters without currying.
  2969. ** New module (srfi srfi-31)
  2970. This is an implementation of SRFI-31 which provides a special form
  2971. `rec' for recursive evaluation.
  2972. ** The modules (srfi srfi-13), (srfi srfi-14) and (srfi srfi-4) have
  2973. been merged with the core, making their functionality always
  2974. available.
  2975. The modules are still available, tho, and you could use them together
  2976. with a renaming import, for example.
  2977. ** Guile no longer includes its own version of libltdl.
  2978. The official version is good enough now.
  2979. ** The --enable-htmldoc option has been removed from 'configure'.
  2980. Support for translating the documentation into HTML is now always
  2981. provided. Use 'make html'.
  2982. ** New module (ice-9 serialize):
  2983. (serialize FORM1 ...) and (parallelize FORM1 ...) are useful when you
  2984. don't trust the thread safety of most of your program, but where you
  2985. have some section(s) of code which you consider can run in parallel to
  2986. other sections. See ice-9/serialize.scm for more information.
  2987. ** The configure option '--disable-arrays' has been removed.
  2988. Support for arrays and uniform numeric arrays is now always included
  2989. in Guile.
  2990. * Changes to the stand-alone interpreter
  2991. ** New command line option `-L'.
  2992. This option adds a directory to the front of the load path.
  2993. ** New command line option `--no-debug'.
  2994. Specifying `--no-debug' on the command line will keep the debugging
  2995. evaluator turned off, even for interactive sessions.
  2996. ** User-init file ~/.guile is now loaded with the debugging evaluator.
  2997. Previously, the normal evaluator would have been used. Using the
  2998. debugging evaluator gives better error messages.
  2999. ** The '-e' option now 'read's its argument.
  3000. This is to allow the new '(@ MODULE-NAME VARIABLE-NAME)' construct to
  3001. be used with '-e'. For example, you can now write a script like
  3002. #! /bin/sh
  3003. exec guile -e '(@ (demo) main)' -s "$0" "$@"
  3004. !#
  3005. (define-module (demo)
  3006. :export (main))
  3007. (define (main args)
  3008. (format #t "Demo: ~a~%" args))
  3009. * Changes to Scheme functions and syntax
  3010. ** Guardians have changed back to their original semantics
  3011. Guardians now behave like described in the paper by Dybvig et al. In
  3012. particular, they no longer make guarantees about the order in which
  3013. they return objects, and they can no longer be greedy.
  3014. They no longer drop cyclic data structures.
  3015. The C function scm_make_guardian has been changed incompatibly and no
  3016. longer takes the 'greedy_p' argument.
  3017. ** New function hashx-remove!
  3018. This function completes the set of 'hashx' functions.
  3019. ** The concept of dynamic roots has been factored into continuation
  3020. barriers and dynamic states.
  3021. Each thread has a current dynamic state that carries the values of the
  3022. fluids. You can create and copy dynamic states and use them as the
  3023. second argument for 'eval'. See "Fluids and Dynamic States" in the
  3024. manual.
  3025. To restrict the influence that captured continuations can have on the
  3026. control flow, you can errect continuation barriers. See "Continuation
  3027. Barriers" in the manual.
  3028. The function call-with-dynamic-root now essentially temporarily
  3029. installs a new dynamic state and errects a continuation barrier.
  3030. ** The default load path no longer includes "." at the end.
  3031. Automatically loading modules from the current directory should not
  3032. happen by default. If you want to allow it in a more controlled
  3033. manner, set the environment variable GUILE_LOAD_PATH or the Scheme
  3034. variable %load-path.
  3035. ** The uniform vector and array support has been overhauled.
  3036. It now complies with SRFI-4 and the weird prototype based uniform
  3037. array creation has been deprecated. See the manual for more details.
  3038. Some non-compatible changes have been made:
  3039. - characters can no longer be stored into byte arrays.
  3040. - strings and bit vectors are no longer considered to be uniform numeric
  3041. vectors.
  3042. - array-rank throws an error for non-arrays instead of returning zero.
  3043. - array-ref does no longer accept non-arrays when no indices are given.
  3044. There is the new notion of 'generalized vectors' and corresponding
  3045. procedures like 'generalized-vector-ref'. Generalized vectors include
  3046. strings, bitvectors, ordinary vectors, and uniform numeric vectors.
  3047. Arrays use generalized vectors as their storage, so that you still
  3048. have arrays of characters, bits, etc. However, uniform-array-read!
  3049. and uniform-array-write can no longer read/write strings and
  3050. bitvectors.
  3051. ** There is now support for copy-on-write substrings, mutation-sharing
  3052. substrings and read-only strings.
  3053. Three new procedures are related to this: substring/shared,
  3054. substring/copy, and substring/read-only. See the manual for more
  3055. information.
  3056. ** Backtraces will now highlight the value that caused the error.
  3057. By default, these values are enclosed in "{...}", such as in this
  3058. example:
  3059. guile> (car 'a)
  3060. Backtrace:
  3061. In current input:
  3062. 1: 0* [car {a}]
  3063. <unnamed port>:1:1: In procedure car in expression (car (quote a)):
  3064. <unnamed port>:1:1: Wrong type (expecting pair): a
  3065. ABORT: (wrong-type-arg)
  3066. The prefix and suffix used for highlighting can be set via the two new
  3067. printer options 'highlight-prefix' and 'highlight-suffix'. For
  3068. example, putting this into ~/.guile will output the bad value in bold
  3069. on an ANSI terminal:
  3070. (print-set! highlight-prefix "\x1b[1m")
  3071. (print-set! highlight-suffix "\x1b[22m")
  3072. ** 'gettext' support for internationalization has been added.
  3073. See the manual for details.
  3074. ** New syntax '@' and '@@':
  3075. You can now directly refer to variables exported from a module by
  3076. writing
  3077. (@ MODULE-NAME VARIABLE-NAME)
  3078. For example (@ (ice-9 pretty-print) pretty-print) will directly access
  3079. the pretty-print variable exported from the (ice-9 pretty-print)
  3080. module. You don't need to 'use' that module first. You can also use
  3081. '@' as a target of 'set!', as in (set! (@ mod var) val).
  3082. The related syntax (@@ MODULE-NAME VARIABLE-NAME) works just like '@',
  3083. but it can also access variables that have not been exported. It is
  3084. intended only for kluges and temporary fixes and for debugging, not
  3085. for ordinary code.
  3086. ** Keyword syntax has been made more disciplined.
  3087. Previously, the name of a keyword was read as a 'token' but printed as
  3088. a symbol. Now, it is read as a general Scheme datum which must be a
  3089. symbol.
  3090. Previously:
  3091. guile> #:12
  3092. #:#{12}#
  3093. guile> #:#{12}#
  3094. #:#{\#{12}\#}#
  3095. guile> #:(a b c)
  3096. #:#{}#
  3097. ERROR: In expression (a b c):
  3098. Unbound variable: a
  3099. guile> #: foo
  3100. #:#{}#
  3101. ERROR: Unbound variable: foo
  3102. Now:
  3103. guile> #:12
  3104. ERROR: Wrong type (expecting symbol): 12
  3105. guile> #:#{12}#
  3106. #:#{12}#
  3107. guile> #:(a b c)
  3108. ERROR: Wrong type (expecting symbol): (a b c)
  3109. guile> #: foo
  3110. #:foo
  3111. ** The printing of symbols that might look like keywords can be
  3112. controlled.
  3113. The new printer option 'quote-keywordish-symbols' controls how symbols
  3114. are printed that have a colon as their first or last character. The
  3115. default now is to only quote a symbol with #{...}# when the read
  3116. option 'keywords' is not '#f'. Thus:
  3117. guile> (define foo (string->symbol ":foo"))
  3118. guile> (read-set! keywords #f)
  3119. guile> foo
  3120. :foo
  3121. guile> (read-set! keywords 'prefix)
  3122. guile> foo
  3123. #{:foo}#
  3124. guile> (print-set! quote-keywordish-symbols #f)
  3125. guile> foo
  3126. :foo
  3127. ** 'while' now provides 'break' and 'continue'
  3128. break and continue were previously bound in a while loop, but not
  3129. documented, and continue didn't quite work properly. The undocumented
  3130. parameter to break which gave a return value for the while has been
  3131. dropped.
  3132. ** 'call-with-current-continuation' is now also available under the name
  3133. 'call/cc'.
  3134. ** The module system now checks for duplicate bindings.
  3135. The module system now can check for name conflicts among imported
  3136. bindings.
  3137. The behavior can be controlled by specifying one or more 'duplicates'
  3138. handlers. For example, to make Guile return an error for every name
  3139. collision, write:
  3140. (define-module (foo)
  3141. :use-module (bar)
  3142. :use-module (baz)
  3143. :duplicates check)
  3144. The new default behavior of the module system when a name collision
  3145. has been detected is to
  3146. 1. Give priority to bindings marked as a replacement.
  3147. 2. Issue a warning (different warning if overriding core binding).
  3148. 3. Give priority to the last encountered binding (this corresponds to
  3149. the old behavior).
  3150. If you want the old behavior back without replacements or warnings you
  3151. can add the line:
  3152. (default-duplicate-binding-handler 'last)
  3153. to your .guile init file.
  3154. ** New define-module option: :replace
  3155. :replace works as :export, but, in addition, marks the binding as a
  3156. replacement.
  3157. A typical example is `format' in (ice-9 format) which is a replacement
  3158. for the core binding `format'.
  3159. ** Adding prefixes to imported bindings in the module system
  3160. There is now a new :use-module option :prefix. It can be used to add
  3161. a prefix to all imported bindings.
  3162. (define-module (foo)
  3163. :use-module ((bar) :prefix bar:))
  3164. will import all bindings exported from bar, but rename them by adding
  3165. the prefix `bar:'.
  3166. ** Conflicting generic functions can be automatically merged.
  3167. When two imported bindings conflict and they are both generic
  3168. functions, the two functions can now be merged automatically. This is
  3169. activated with the 'duplicates' handler 'merge-generics'.
  3170. ** New function: effective-version
  3171. Returns the "effective" version number. This is just the normal full
  3172. version string without the final micro-version number. See "Changes
  3173. to the distribution" above.
  3174. ** New threading functions: parallel, letpar, par-map, and friends
  3175. These are convenient ways to run calculations in parallel in new
  3176. threads. See "Parallel forms" in the manual for details.
  3177. ** New function 'try-mutex'.
  3178. This function will attempt to lock a mutex but will return immediately
  3179. instead of blocking and indicate failure.
  3180. ** Waiting on a condition variable can have a timeout.
  3181. The function 'wait-condition-variable' now takes a third, optional
  3182. argument that specifies the point in time where the waiting should be
  3183. aborted.
  3184. ** New function 'broadcast-condition-variable'.
  3185. ** New functions 'all-threads' and 'current-thread'.
  3186. ** Signals and system asyncs work better with threads.
  3187. The function 'sigaction' now takes a fourth, optional, argument that
  3188. specifies the thread that the handler should run in. When the
  3189. argument is omitted, the handler will run in the thread that called
  3190. 'sigaction'.
  3191. Likewise, 'system-async-mark' takes a second, optional, argument that
  3192. specifies the thread that the async should run in. When it is
  3193. omitted, the async will run in the thread that called
  3194. 'system-async-mark'.
  3195. C code can use the new functions scm_sigaction_for_thread and
  3196. scm_system_async_mark_for_thread to pass the new thread argument.
  3197. When a thread blocks on a mutex, a condition variable or is waiting
  3198. for IO to be possible, it will still execute system asyncs. This can
  3199. be used to interrupt such a thread by making it execute a 'throw', for
  3200. example.
  3201. ** The function 'system-async' is deprecated.
  3202. You can now pass any zero-argument procedure to 'system-async-mark'.
  3203. The function 'system-async' will just return its argument unchanged
  3204. now.
  3205. ** New functions 'call-with-blocked-asyncs' and
  3206. 'call-with-unblocked-asyncs'
  3207. The expression (call-with-blocked-asyncs PROC) will call PROC and will
  3208. block execution of system asyncs for the current thread by one level
  3209. while PROC runs. Likewise, call-with-unblocked-asyncs will call a
  3210. procedure and will unblock the execution of system asyncs by one
  3211. level for the current thread.
  3212. Only system asyncs are affected by these functions.
  3213. ** The functions 'mask-signals' and 'unmask-signals' are deprecated.
  3214. Use 'call-with-blocked-asyncs' or 'call-with-unblocked-asyncs'
  3215. instead. Those functions are easier to use correctly and can be
  3216. nested.
  3217. ** New function 'unsetenv'.
  3218. ** New macro 'define-syntax-public'.
  3219. It works like 'define-syntax' and also exports the defined macro (but
  3220. only on top-level).
  3221. ** There is support for Infinity and NaNs.
  3222. Following PLT Scheme, Guile can now work with infinite numbers, and
  3223. 'not-a-numbers'.
  3224. There is new syntax for numbers: "+inf.0" (infinity), "-inf.0"
  3225. (negative infinity), "+nan.0" (not-a-number), and "-nan.0" (same as
  3226. "+nan.0"). These numbers are inexact and have no exact counterpart.
  3227. Dividing by an inexact zero returns +inf.0 or -inf.0, depending on the
  3228. sign of the dividend. The infinities are integers, and they answer #t
  3229. for both 'even?' and 'odd?'. The +nan.0 value is not an integer and is
  3230. not '=' to itself, but '+nan.0' is 'eqv?' to itself.
  3231. For example
  3232. (/ 1 0.0)
  3233. => +inf.0
  3234. (/ 0 0.0)
  3235. => +nan.0
  3236. (/ 0)
  3237. ERROR: Numerical overflow
  3238. Two new predicates 'inf?' and 'nan?' can be used to test for the
  3239. special values.
  3240. ** Inexact zero can have a sign.
  3241. Guile can now distinguish between plus and minus inexact zero, if your
  3242. platform supports this, too. The two zeros are equal according to
  3243. '=', but not according to 'eqv?'. For example
  3244. (- 0.0)
  3245. => -0.0
  3246. (= 0.0 (- 0.0))
  3247. => #t
  3248. (eqv? 0.0 (- 0.0))
  3249. => #f
  3250. ** Guile now has exact rationals.
  3251. Guile can now represent fractions such as 1/3 exactly. Computing with
  3252. them is also done exactly, of course:
  3253. (* 1/3 3/2)
  3254. => 1/2
  3255. ** 'floor', 'ceiling', 'round' and 'truncate' now return exact numbers
  3256. for exact arguments.
  3257. For example: (floor 2) now returns an exact 2 where in the past it
  3258. returned an inexact 2.0. Likewise, (floor 5/4) returns an exact 1.
  3259. ** inexact->exact no longer returns only integers.
  3260. Without exact rationals, the closest exact number was always an
  3261. integer, but now inexact->exact returns the fraction that is exactly
  3262. equal to a floating point number. For example:
  3263. (inexact->exact 1.234)
  3264. => 694680242521899/562949953421312
  3265. When you want the old behavior, use 'round' explicitly:
  3266. (inexact->exact (round 1.234))
  3267. => 1
  3268. ** New function 'rationalize'.
  3269. This function finds a simple fraction that is close to a given real
  3270. number. For example (and compare with inexact->exact above):
  3271. (rationalize (inexact->exact 1.234) 1/2000)
  3272. => 58/47
  3273. Note that, as required by R5RS, rationalize returns only then an exact
  3274. result when both its arguments are exact.
  3275. ** 'odd?' and 'even?' work also for inexact integers.
  3276. Previously, (odd? 1.0) would signal an error since only exact integers
  3277. were recognized as integers. Now (odd? 1.0) returns #t, (odd? 2.0)
  3278. returns #f and (odd? 1.5) signals an error.
  3279. ** Guile now has uninterned symbols.
  3280. The new function 'make-symbol' will return an uninterned symbol. This
  3281. is a symbol that is unique and is guaranteed to remain unique.
  3282. However, uninterned symbols can not yet be read back in.
  3283. Use the new function 'symbol-interned?' to check whether a symbol is
  3284. interned or not.
  3285. ** pretty-print has more options.
  3286. The function pretty-print from the (ice-9 pretty-print) module can now
  3287. also be invoked with keyword arguments that control things like
  3288. maximum output width. See the manual for details.
  3289. ** Variables have no longer a special behavior for `equal?'.
  3290. Previously, comparing two variables with `equal?' would recursivly
  3291. compare their values. This is no longer done. Variables are now only
  3292. `equal?' if they are `eq?'.
  3293. ** `(begin)' is now valid.
  3294. You can now use an empty `begin' form. It will yield #<unspecified>
  3295. when evaluated and simply be ignored in a definition context.
  3296. ** Deprecated: procedure->macro
  3297. Change your code to use 'define-macro' or r5rs macros. Also, be aware
  3298. that macro expansion will not be done during evaluation, but prior to
  3299. evaluation.
  3300. ** Soft ports now allow a `char-ready?' procedure
  3301. The vector argument to `make-soft-port' can now have a length of
  3302. either 5 or 6. (Previously the length had to be 5.) The optional 6th
  3303. element is interpreted as an `input-waiting' thunk -- i.e. a thunk
  3304. that returns the number of characters that can be read immediately
  3305. without the soft port blocking.
  3306. ** Deprecated: undefine
  3307. There is no replacement for undefine.
  3308. ** The functions make-keyword-from-dash-symbol and keyword-dash-symbol
  3309. have been discouraged.
  3310. They are relics from a time where a keyword like #:foo was used
  3311. directly as a Tcl option "-foo" and thus keywords were internally
  3312. stored as a symbol with a starting dash. We now store a symbol
  3313. without the dash.
  3314. Use symbol->keyword and keyword->symbol instead.
  3315. ** The `cheap' debug option is now obsolete
  3316. Evaluator trap calls are now unconditionally "cheap" - in other words,
  3317. they pass a debug object to the trap handler rather than a full
  3318. continuation. The trap handler code can capture a full continuation
  3319. by using `call-with-current-continuation' in the usual way, if it so
  3320. desires.
  3321. The `cheap' option is retained for now so as not to break existing
  3322. code which gets or sets it, but setting it now has no effect. It will
  3323. be removed in the next major Guile release.
  3324. ** Evaluator trap calls now support `tweaking'
  3325. `Tweaking' means that the trap handler code can modify the Scheme
  3326. expression that is about to be evaluated (in the case of an
  3327. enter-frame trap) or the value that is being returned (in the case of
  3328. an exit-frame trap). The trap handler code indicates that it wants to
  3329. do this by returning a pair whose car is the symbol 'instead and whose
  3330. cdr is the modified expression or return value.
  3331. * Changes to the C interface
  3332. ** The functions scm_hash_fn_remove_x and scm_hashx_remove_x no longer
  3333. take a 'delete' function argument.
  3334. This argument makes no sense since the delete function is used to
  3335. remove a pair from an alist, and this must not be configurable.
  3336. This is an incompatible change.
  3337. ** The GH interface is now subject to the deprecation mechanism
  3338. The GH interface has been deprecated for quite some time but now it is
  3339. actually removed from Guile when it is configured with
  3340. --disable-deprecated.
  3341. See the manual "Transitioning away from GH" for more information.
  3342. ** A new family of functions for converting between C values and
  3343. Scheme values has been added.
  3344. These functions follow a common naming scheme and are designed to be
  3345. easier to use, thread-safe and more future-proof than the older
  3346. alternatives.
  3347. - int scm_is_* (...)
  3348. These are predicates that return a C boolean: 1 or 0. Instead of
  3349. SCM_NFALSEP, you can now use scm_is_true, for example.
  3350. - <type> scm_to_<type> (SCM val, ...)
  3351. These are functions that convert a Scheme value into an appropriate
  3352. C value. For example, you can use scm_to_int to safely convert from
  3353. a SCM to an int.
  3354. - SCM scm_from_<type> (<type> val, ...)
  3355. These functions convert from a C type to a SCM value; for example,
  3356. scm_from_int for ints.
  3357. There is a huge number of these functions, for numbers, strings,
  3358. symbols, vectors, etc. They are documented in the reference manual in
  3359. the API section together with the types that they apply to.
  3360. ** New functions for dealing with complex numbers in C have been added.
  3361. The new functions are scm_c_make_rectangular, scm_c_make_polar,
  3362. scm_c_real_part, scm_c_imag_part, scm_c_magnitude and scm_c_angle.
  3363. They work like scm_make_rectangular etc but take or return doubles
  3364. directly.
  3365. ** The function scm_make_complex has been discouraged.
  3366. Use scm_c_make_rectangular instead.
  3367. ** The INUM macros have been deprecated.
  3368. A lot of code uses these macros to do general integer conversions,
  3369. although the macros only work correctly with fixnums. Use the
  3370. following alternatives.
  3371. SCM_INUMP -> scm_is_integer or similar
  3372. SCM_NINUMP -> !scm_is_integer or similar
  3373. SCM_MAKINUM -> scm_from_int or similar
  3374. SCM_INUM -> scm_to_int or similar
  3375. SCM_VALIDATE_INUM_* -> Do not use these; scm_to_int, etc. will
  3376. do the validating for you.
  3377. ** The scm_num2<type> and scm_<type>2num functions and scm_make_real
  3378. have been discouraged.
  3379. Use the newer scm_to_<type> and scm_from_<type> functions instead for
  3380. new code. The functions have been discouraged since they don't fit
  3381. the naming scheme.
  3382. ** The 'boolean' macros SCM_FALSEP etc have been discouraged.
  3383. They have strange names, especially SCM_NFALSEP, and SCM_BOOLP
  3384. evaluates its argument twice. Use scm_is_true, etc. instead for new
  3385. code.
  3386. ** The macro SCM_EQ_P has been discouraged.
  3387. Use scm_is_eq for new code, which fits better into the naming
  3388. conventions.
  3389. ** The macros SCM_CONSP, SCM_NCONSP, SCM_NULLP, and SCM_NNULLP have
  3390. been discouraged.
  3391. Use the function scm_is_pair or scm_is_null instead.
  3392. ** The functions scm_round and scm_truncate have been deprecated and
  3393. are now available as scm_c_round and scm_c_truncate, respectively.
  3394. These functions occupy the names that scm_round_number and
  3395. scm_truncate_number should have.
  3396. ** The functions scm_c_string2str, scm_c_substring2str, and
  3397. scm_c_symbol2str have been deprecated.
  3398. Use scm_to_locale_stringbuf or similar instead, maybe together with
  3399. scm_substring.
  3400. ** New functions scm_c_make_string, scm_c_string_length,
  3401. scm_c_string_ref, scm_c_string_set_x, scm_c_substring,
  3402. scm_c_substring_shared, scm_c_substring_copy.
  3403. These are like scm_make_string, scm_length, etc. but are slightly
  3404. easier to use from C.
  3405. ** The macros SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_LENGTH,
  3406. SCM_SYMBOL_CHARS, and SCM_SYMBOL_LENGTH have been deprecated.
  3407. They export too many assumptions about the implementation of strings
  3408. and symbols that are no longer true in the presence of
  3409. mutation-sharing substrings and when Guile switches to some form of
  3410. Unicode.
  3411. When working with strings, it is often best to use the normal string
  3412. functions provided by Guile, such as scm_c_string_ref,
  3413. scm_c_string_set_x, scm_string_append, etc. Be sure to look in the
  3414. manual since many more such functions are now provided than
  3415. previously.
  3416. When you want to convert a SCM string to a C string, use the
  3417. scm_to_locale_string function or similar instead. For symbols, use
  3418. scm_symbol_to_string and then work with that string. Because of the
  3419. new string representation, scm_symbol_to_string does not need to copy
  3420. and is thus quite efficient.
  3421. ** Some string, symbol and keyword functions have been discouraged.
  3422. They don't fit into the uniform naming scheme and are not explicit
  3423. about the character encoding.
  3424. Replace according to the following table:
  3425. scm_allocate_string -> scm_c_make_string
  3426. scm_take_str -> scm_take_locale_stringn
  3427. scm_take0str -> scm_take_locale_string
  3428. scm_mem2string -> scm_from_locale_stringn
  3429. scm_str2string -> scm_from_locale_string
  3430. scm_makfrom0str -> scm_from_locale_string
  3431. scm_mem2symbol -> scm_from_locale_symboln
  3432. scm_mem2uninterned_symbol -> scm_from_locale_stringn + scm_make_symbol
  3433. scm_str2symbol -> scm_from_locale_symbol
  3434. SCM_SYMBOL_HASH -> scm_hashq
  3435. SCM_SYMBOL_INTERNED_P -> scm_symbol_interned_p
  3436. scm_c_make_keyword -> scm_from_locale_keyword
  3437. ** The functions scm_keyword_to_symbol and sym_symbol_to_keyword are
  3438. now also available to C code.
  3439. ** SCM_KEYWORDP and SCM_KEYWORDSYM have been deprecated.
  3440. Use scm_is_keyword and scm_keyword_to_symbol instead, but note that
  3441. the latter returns the true name of the keyword, not the 'dash name',
  3442. as SCM_KEYWORDSYM used to do.
  3443. ** A new way to access arrays in a thread-safe and efficient way has
  3444. been added.
  3445. See the manual, node "Accessing Arrays From C".
  3446. ** The old uniform vector and bitvector implementations have been
  3447. unceremoniously removed.
  3448. This implementation exposed the details of the tagging system of
  3449. Guile. Use the new C API explained in the manual in node "Uniform
  3450. Numeric Vectors" and "Bit Vectors", respectively.
  3451. The following macros are gone: SCM_UVECTOR_BASE, SCM_SET_UVECTOR_BASE,
  3452. SCM_UVECTOR_MAXLENGTH, SCM_UVECTOR_LENGTH, SCM_MAKE_UVECTOR_TAG,
  3453. SCM_SET_UVECTOR_LENGTH, SCM_BITVECTOR_P, SCM_BITVECTOR_BASE,
  3454. SCM_SET_BITVECTOR_BASE, SCM_BITVECTOR_MAX_LENGTH,
  3455. SCM_BITVECTOR_LENGTH, SCM_MAKE_BITVECTOR_TAG,
  3456. SCM_SET_BITVECTOR_LENGTH, SCM_BITVEC_REF, SCM_BITVEC_SET,
  3457. SCM_BITVEC_CLR.
  3458. ** The macros dealing with vectors have been deprecated.
  3459. Use the new functions scm_is_vector, scm_vector_elements,
  3460. scm_vector_writable_elements, etc, or scm_is_simple_vector,
  3461. SCM_SIMPLE_VECTOR_REF, SCM_SIMPLE_VECTOR_SET, etc instead. See the
  3462. manual for more details.
  3463. Deprecated are SCM_VECTORP, SCM_VELTS, SCM_VECTOR_MAX_LENGTH,
  3464. SCM_VECTOR_LENGTH, SCM_VECTOR_REF, SCM_VECTOR_SET, SCM_WRITABLE_VELTS.
  3465. The following macros have been removed: SCM_VECTOR_BASE,
  3466. SCM_SET_VECTOR_BASE, SCM_MAKE_VECTOR_TAG, SCM_SET_VECTOR_LENGTH,
  3467. SCM_VELTS_AS_STACKITEMS, SCM_SETVELTS, SCM_GC_WRITABLE_VELTS.
  3468. ** Some C functions and macros related to arrays have been deprecated.
  3469. Migrate according to the following table:
  3470. scm_make_uve -> scm_make_typed_array, scm_make_u8vector etc.
  3471. scm_make_ra -> scm_make_array
  3472. scm_shap2ra -> scm_make_array
  3473. scm_cvref -> scm_c_generalized_vector_ref
  3474. scm_ra_set_contp -> do not use
  3475. scm_aind -> scm_array_handle_pos
  3476. scm_raprin1 -> scm_display or scm_write
  3477. SCM_ARRAYP -> scm_is_array
  3478. SCM_ARRAY_NDIM -> scm_c_array_rank
  3479. SCM_ARRAY_DIMS -> scm_array_handle_dims
  3480. SCM_ARRAY_CONTP -> do not use
  3481. SCM_ARRAY_MEM -> do not use
  3482. SCM_ARRAY_V -> scm_array_handle_elements or similar
  3483. SCM_ARRAY_BASE -> do not use
  3484. ** SCM_CELL_WORD_LOC has been deprecated.
  3485. Use the new macro SCM_CELL_OBJECT_LOC instead, which returns a pointer
  3486. to a SCM, as opposed to a pointer to a scm_t_bits.
  3487. This was done to allow the correct use of pointers into the Scheme
  3488. heap. Previously, the heap words were of type scm_t_bits and local
  3489. variables and function arguments were of type SCM, making it
  3490. non-standards-conformant to have a pointer that can point to both.
  3491. ** New macros SCM_SMOB_DATA_2, SCM_SMOB_DATA_3, etc.
  3492. These macros should be used instead of SCM_CELL_WORD_2/3 to access the
  3493. second and third words of double smobs. Likewise for
  3494. SCM_SET_SMOB_DATA_2 and SCM_SET_SMOB_DATA_3.
  3495. Also, there is SCM_SMOB_FLAGS and SCM_SET_SMOB_FLAGS that should be
  3496. used to get and set the 16 exra bits in the zeroth word of a smob.
  3497. And finally, there is SCM_SMOB_OBJECT and SCM_SMOB_SET_OBJECT for
  3498. accesing the first immediate word of a smob as a SCM value, and there
  3499. is SCM_SMOB_OBJECT_LOC for getting a pointer to the first immediate
  3500. smob word. Like wise for SCM_SMOB_OBJECT_2, etc.
  3501. ** New way to deal with non-local exits and re-entries.
  3502. There is a new set of functions that essentially do what
  3503. scm_internal_dynamic_wind does, but in a way that is more convenient
  3504. for C code in some situations. Here is a quick example of how to
  3505. prevent a potential memory leak:
  3506. void
  3507. foo ()
  3508. {
  3509. char *mem;
  3510. scm_dynwind_begin (0);
  3511. mem = scm_malloc (100);
  3512. scm_dynwind_unwind_handler (free, mem, SCM_F_WIND_EXPLICITLY);
  3513. /* MEM would leak if BAR throws an error.
  3514. SCM_DYNWIND_UNWIND_HANDLER frees it nevertheless.
  3515. */
  3516. bar ();
  3517. scm_dynwind_end ();
  3518. /* Because of SCM_F_WIND_EXPLICITLY, MEM will be freed by
  3519. SCM_DYNWIND_END as well.
  3520. */
  3521. }
  3522. For full documentation, see the node "Dynamic Wind" in the manual.
  3523. ** New function scm_dynwind_free
  3524. This function calls 'free' on a given pointer when a dynwind context
  3525. is left. Thus the call to scm_dynwind_unwind_handler above could be
  3526. replaced with simply scm_dynwind_free (mem).
  3527. ** New functions scm_c_call_with_blocked_asyncs and
  3528. scm_c_call_with_unblocked_asyncs
  3529. Like scm_call_with_blocked_asyncs etc. but for C functions.
  3530. ** New functions scm_dynwind_block_asyncs and scm_dynwind_unblock_asyncs
  3531. In addition to scm_c_call_with_blocked_asyncs you can now also use
  3532. scm_dynwind_block_asyncs in a 'dynwind context' (see above). Likewise for
  3533. scm_c_call_with_unblocked_asyncs and scm_dynwind_unblock_asyncs.
  3534. ** The macros SCM_DEFER_INTS, SCM_ALLOW_INTS, SCM_REDEFER_INTS,
  3535. SCM_REALLOW_INTS have been deprecated.
  3536. They do no longer fulfill their original role of blocking signal
  3537. delivery. Depending on what you want to achieve, replace a pair of
  3538. SCM_DEFER_INTS and SCM_ALLOW_INTS with a dynwind context that locks a
  3539. mutex, blocks asyncs, or both. See node "Critical Sections" in the
  3540. manual.
  3541. ** The value 'scm_mask_ints' is no longer writable.
  3542. Previously, you could set scm_mask_ints directly. This is no longer
  3543. possible. Use scm_c_call_with_blocked_asyncs and
  3544. scm_c_call_with_unblocked_asyncs instead.
  3545. ** New way to temporarily set the current input, output or error ports
  3546. C code can now use scm_dynwind_current_<foo>_port in a 'dynwind
  3547. context' (see above). <foo> is one of "input", "output" or "error".
  3548. ** New way to temporarily set fluids
  3549. C code can now use scm_dynwind_fluid in a 'dynwind context' (see
  3550. above) to temporarily set the value of a fluid.
  3551. ** New types scm_t_intmax and scm_t_uintmax.
  3552. On platforms that have them, these types are identical to intmax_t and
  3553. uintmax_t, respectively. On other platforms, they are identical to
  3554. the largest integer types that Guile knows about.
  3555. ** The functions scm_unmemocopy and scm_unmemoize have been removed.
  3556. You should not have used them.
  3557. ** Many public #defines with generic names have been made private.
  3558. #defines with generic names like HAVE_FOO or SIZEOF_FOO have been made
  3559. private or renamed with a more suitable public name.
  3560. ** The macro SCM_TYP16S has been deprecated.
  3561. This macro is not intended for public use.
  3562. ** The macro SCM_SLOPPY_INEXACTP has been deprecated.
  3563. Use scm_is_true (scm_inexact_p (...)) instead.
  3564. ** The macro SCM_SLOPPY_REALP has been deprecated.
  3565. Use scm_is_real instead.
  3566. ** The macro SCM_SLOPPY_COMPLEXP has been deprecated.
  3567. Use scm_is_complex instead.
  3568. ** Some preprocessor defines have been deprecated.
  3569. These defines indicated whether a certain feature was present in Guile
  3570. or not. Going forward, assume that the features are always present.
  3571. The macros are: USE_THREADS, GUILE_ISELECT, READER_EXTENSIONS,
  3572. DEBUG_EXTENSIONS, DYNAMIC_LINKING.
  3573. The following macros have been removed completely: MEMOIZE_LOCALS,
  3574. SCM_RECKLESS, SCM_CAUTIOUS.
  3575. ** The preprocessor define STACK_DIRECTION has been deprecated.
  3576. There should be no need to know about the stack direction for ordinary
  3577. programs.
  3578. ** New function: scm_effective_version
  3579. Returns the "effective" version number. This is just the normal full
  3580. version string without the final micro-version number. See "Changes
  3581. to the distribution" above.
  3582. ** The function scm_call_with_new_thread has a new prototype.
  3583. Instead of taking a list with the thunk and handler, these two
  3584. arguments are now passed directly:
  3585. SCM scm_call_with_new_thread (SCM thunk, SCM handler);
  3586. This is an incompatible change.
  3587. ** New snarfer macro SCM_DEFINE_PUBLIC.
  3588. This is like SCM_DEFINE, but also calls scm_c_export for the defined
  3589. function in the init section.
  3590. ** The snarfer macro SCM_SNARF_INIT is now officially supported.
  3591. ** Garbage collector rewrite.
  3592. The garbage collector is cleaned up a lot, and now uses lazy
  3593. sweeping. This is reflected in the output of (gc-stats); since cells
  3594. are being freed when they are allocated, the cells-allocated field
  3595. stays roughly constant.
  3596. For malloc related triggers, the behavior is changed. It uses the same
  3597. heuristic as the cell-triggered collections. It may be tuned with the
  3598. environment variables GUILE_MIN_YIELD_MALLOC. This is the percentage
  3599. for minimum yield of malloc related triggers. The default is 40.
  3600. GUILE_INIT_MALLOC_LIMIT sets the initial trigger for doing a GC. The
  3601. default is 200 kb.
  3602. Debugging operations for the freelist have been deprecated, along with
  3603. the C variables that control garbage collection. The environment
  3604. variables GUILE_MAX_SEGMENT_SIZE, GUILE_INIT_SEGMENT_SIZE_2,
  3605. GUILE_INIT_SEGMENT_SIZE_1, and GUILE_MIN_YIELD_2 should be used.
  3606. For understanding the memory usage of a GUILE program, the routine
  3607. gc-live-object-stats returns an alist containing the number of live
  3608. objects for every type.
  3609. ** The function scm_definedp has been renamed to scm_defined_p
  3610. The name scm_definedp is deprecated.
  3611. ** The struct scm_cell type has been renamed to scm_t_cell
  3612. This is in accordance to Guile's naming scheme for types. Note that
  3613. the name scm_cell is now used for a function that allocates and
  3614. initializes a new cell (see below).
  3615. ** New functions for memory management
  3616. A new set of functions for memory management has been added since the
  3617. old way (scm_must_malloc, scm_must_free, etc) was error prone and
  3618. indeed, Guile itself contained some long standing bugs that could
  3619. cause aborts in long running programs.
  3620. The new functions are more symmetrical and do not need cooperation
  3621. from smob free routines, among other improvements.
  3622. The new functions are scm_malloc, scm_realloc, scm_calloc, scm_strdup,
  3623. scm_strndup, scm_gc_malloc, scm_gc_calloc, scm_gc_realloc,
  3624. scm_gc_free, scm_gc_register_collectable_memory, and
  3625. scm_gc_unregister_collectable_memory. Refer to the manual for more
  3626. details and for upgrading instructions.
  3627. The old functions for memory management have been deprecated. They
  3628. are: scm_must_malloc, scm_must_realloc, scm_must_free,
  3629. scm_must_strdup, scm_must_strndup, scm_done_malloc, scm_done_free.
  3630. ** Declarations of exported features are marked with SCM_API.
  3631. Every declaration of a feature that belongs to the exported Guile API
  3632. has been marked by adding the macro "SCM_API" to the start of the
  3633. declaration. This macro can expand into different things, the most
  3634. common of which is just "extern" for Unix platforms. On Win32, it can
  3635. be used to control which symbols are exported from a DLL.
  3636. If you `#define SCM_IMPORT' before including <libguile.h>, SCM_API
  3637. will expand into "__declspec (dllimport) extern", which is needed for
  3638. linking to the Guile DLL in Windows.
  3639. There are also SCM_RL_IMPORT, SCM_SRFI1314_IMPORT, and
  3640. SCM_SRFI4_IMPORT, for the corresponding libraries.
  3641. ** SCM_NEWCELL and SCM_NEWCELL2 have been deprecated.
  3642. Use the new functions scm_cell and scm_double_cell instead. The old
  3643. macros had problems because with them allocation and initialization
  3644. was separated and the GC could sometimes observe half initialized
  3645. cells. Only careful coding by the user of SCM_NEWCELL and
  3646. SCM_NEWCELL2 could make this safe and efficient.
  3647. ** CHECK_ENTRY, CHECK_APPLY and CHECK_EXIT have been deprecated.
  3648. Use the variables scm_check_entry_p, scm_check_apply_p and scm_check_exit_p
  3649. instead.
  3650. ** SRCBRKP has been deprecated.
  3651. Use scm_c_source_property_breakpoint_p instead.
  3652. ** Deprecated: scm_makmacro
  3653. Change your code to use either scm_makmmacro or to define macros in
  3654. Scheme, using 'define-macro'.
  3655. ** New function scm_c_port_for_each.
  3656. This function is like scm_port_for_each but takes a pointer to a C
  3657. function as the callback instead of a SCM value.
  3658. ** The names scm_internal_select, scm_thread_sleep, and
  3659. scm_thread_usleep have been discouraged.
  3660. Use scm_std_select, scm_std_sleep, scm_std_usleep instead.
  3661. ** The GC can no longer be blocked.
  3662. The global flags scm_gc_heap_lock and scm_block_gc have been removed.
  3663. The GC can now run (partially) concurrently with other code and thus
  3664. blocking it is not well defined.
  3665. ** Many definitions have been removed that were previously deprecated.
  3666. scm_lisp_nil, scm_lisp_t, s_nil_ify, scm_m_nil_ify, s_t_ify,
  3667. scm_m_t_ify, s_0_cond, scm_m_0_cond, s_0_ify, scm_m_0_ify, s_1_ify,
  3668. scm_m_1_ify, scm_debug_newcell, scm_debug_newcell2,
  3669. scm_tc16_allocated, SCM_SET_SYMBOL_HASH, SCM_IM_NIL_IFY, SCM_IM_T_IFY,
  3670. SCM_IM_0_COND, SCM_IM_0_IFY, SCM_IM_1_IFY, SCM_GC_SET_ALLOCATED,
  3671. scm_debug_newcell, scm_debug_newcell2, SCM_HUP_SIGNAL, SCM_INT_SIGNAL,
  3672. SCM_FPE_SIGNAL, SCM_BUS_SIGNAL, SCM_SEGV_SIGNAL, SCM_ALRM_SIGNAL,
  3673. SCM_GC_SIGNAL, SCM_TICK_SIGNAL, SCM_SIG_ORD, SCM_ORD_SIG,
  3674. SCM_NUM_SIGS, scm_top_level_lookup_closure_var,
  3675. *top-level-lookup-closure*, scm_system_transformer, scm_eval_3,
  3676. scm_eval2, root_module_lookup_closure, SCM_SLOPPY_STRINGP,
  3677. SCM_RWSTRINGP, scm_read_only_string_p, scm_make_shared_substring,
  3678. scm_tc7_substring, sym_huh, SCM_VARVCELL, SCM_UDVARIABLEP,
  3679. SCM_DEFVARIABLEP, scm_mkbig, scm_big2inum, scm_adjbig, scm_normbig,
  3680. scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl, SCM_FIXNUM_BIT,
  3681. SCM_SETCHARS, SCM_SLOPPY_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET,
  3682. SCM_LENGTH_MAX, SCM_SETLENGTH, SCM_ROSTRINGP, SCM_ROLENGTH,
  3683. SCM_ROCHARS, SCM_ROUCHARS, SCM_SUBSTRP, SCM_COERCE_SUBSTR,
  3684. scm_sym2vcell, scm_intern, scm_intern0, scm_sysintern, scm_sysintern0,
  3685. scm_sysintern0_no_module_lookup, scm_init_symbols_deprecated,
  3686. scm_vector_set_length_x, scm_contregs, scm_debug_info,
  3687. scm_debug_frame, SCM_DSIDEVAL, SCM_CONST_LONG, SCM_VCELL,
  3688. SCM_GLOBAL_VCELL, SCM_VCELL_INIT, SCM_GLOBAL_VCELL_INIT,
  3689. SCM_HUGE_LENGTH, SCM_VALIDATE_STRINGORSUBSTR, SCM_VALIDATE_ROSTRING,
  3690. SCM_VALIDATE_ROSTRING_COPY, SCM_VALIDATE_NULLORROSTRING_COPY,
  3691. SCM_VALIDATE_RWSTRING, DIGITS, scm_small_istr2int, scm_istr2int,
  3692. scm_istr2flo, scm_istring2number, scm_istr2int, scm_istr2flo,
  3693. scm_istring2number, scm_vtable_index_vcell, scm_si_vcell, SCM_ECONSP,
  3694. SCM_NECONSP, SCM_GLOC_VAR, SCM_GLOC_VAL, SCM_GLOC_SET_VAL,
  3695. SCM_GLOC_VAL_LOC, scm_make_gloc, scm_gloc_p, scm_tc16_variable,
  3696. SCM_CHARS, SCM_LENGTH, SCM_SET_STRING_CHARS, SCM_SET_STRING_LENGTH.
  3697. * Changes to bundled modules
  3698. ** (ice-9 debug)
  3699. Using the (ice-9 debug) module no longer automatically switches Guile
  3700. to use the debugging evaluator. If you want to switch to the
  3701. debugging evaluator (which is needed for backtrace information if you
  3702. hit an error), please add an explicit "(debug-enable 'debug)" to your
  3703. code just after the code to use (ice-9 debug).
  3704. Changes since Guile 1.4:
  3705. * Changes to the distribution
  3706. ** A top-level TODO file is included.
  3707. ** Guile now uses a versioning scheme similar to that of the Linux kernel.
  3708. Guile now always uses three numbers to represent the version,
  3709. i.e. "1.6.5". The first number, 1, is the major version number, the
  3710. second number, 6, is the minor version number, and the third number,
  3711. 5, is the micro version number. Changes in major version number
  3712. indicate major changes in Guile.
  3713. Minor version numbers that are even denote stable releases, and odd
  3714. minor version numbers denote development versions (which may be
  3715. unstable). The micro version number indicates a minor sub-revision of
  3716. a given MAJOR.MINOR release.
  3717. In keeping with the new scheme, (minor-version) and scm_minor_version
  3718. no longer return everything but the major version number. They now
  3719. just return the minor version number. Two new functions
  3720. (micro-version) and scm_micro_version have been added to report the
  3721. micro version number.
  3722. In addition, ./GUILE-VERSION now defines GUILE_MICRO_VERSION.
  3723. ** New preprocessor definitions are available for checking versions.
  3724. version.h now #defines SCM_MAJOR_VERSION, SCM_MINOR_VERSION, and
  3725. SCM_MICRO_VERSION to the appropriate integer values.
  3726. ** Guile now actively warns about deprecated features.
  3727. The new configure option `--enable-deprecated=LEVEL' and the
  3728. environment variable GUILE_WARN_DEPRECATED control this mechanism.
  3729. See INSTALL and README for more information.
  3730. ** Guile is much more likely to work on 64-bit architectures.
  3731. Guile now compiles and passes "make check" with only two UNRESOLVED GC
  3732. cases on Alpha and ia64 based machines now. Thanks to John Goerzen
  3733. for the use of a test machine, and thanks to Stefan Jahn for ia64
  3734. patches.
  3735. ** New functions: setitimer and getitimer.
  3736. These implement a fairly direct interface to the libc functions of the
  3737. same name.
  3738. ** The #. reader extension is now disabled by default.
  3739. For safety reasons, #. evaluation is disabled by default. To
  3740. re-enable it, set the fluid read-eval? to #t. For example:
  3741. (fluid-set! read-eval? #t)
  3742. but make sure you realize the potential security risks involved. With
  3743. read-eval? enabled, reading a data file from an untrusted source can
  3744. be dangerous.
  3745. ** New SRFI modules have been added:
  3746. SRFI-0 `cond-expand' is now supported in Guile, without requiring
  3747. using a module.
  3748. (srfi srfi-1) is a library containing many useful pair- and list-processing
  3749. procedures.
  3750. (srfi srfi-2) exports and-let*.
  3751. (srfi srfi-4) implements homogeneous numeric vector datatypes.
  3752. (srfi srfi-6) is a dummy module for now, since guile already provides
  3753. all of the srfi-6 procedures by default: open-input-string,
  3754. open-output-string, get-output-string.
  3755. (srfi srfi-8) exports receive.
  3756. (srfi srfi-9) exports define-record-type.
  3757. (srfi srfi-10) exports define-reader-ctor and implements the reader
  3758. extension #,().
  3759. (srfi srfi-11) exports let-values and let*-values.
  3760. (srfi srfi-13) implements the SRFI String Library.
  3761. (srfi srfi-14) implements the SRFI Character-Set Library.
  3762. (srfi srfi-17) implements setter and getter-with-setter and redefines
  3763. some accessor procedures as procedures with getters. (such as car,
  3764. cdr, vector-ref etc.)
  3765. (srfi srfi-19) implements the SRFI Time/Date Library.
  3766. ** New scripts / "executable modules"
  3767. Subdirectory "scripts" contains Scheme modules that are packaged to
  3768. also be executable as scripts. At this time, these scripts are available:
  3769. display-commentary
  3770. doc-snarf
  3771. generate-autoload
  3772. punify
  3773. read-scheme-source
  3774. use2dot
  3775. See README there for more info.
  3776. These scripts can be invoked from the shell with the new program
  3777. "guile-tools", which keeps track of installation directory for you.
  3778. For example:
  3779. $ guile-tools display-commentary srfi/*.scm
  3780. guile-tools is copied to the standard $bindir on "make install".
  3781. ** New module (ice-9 stack-catch):
  3782. stack-catch is like catch, but saves the current state of the stack in
  3783. the fluid the-last-stack. This fluid can be useful when using the
  3784. debugger and when re-throwing an error.
  3785. ** The module (ice-9 and-let*) has been renamed to (ice-9 and-let-star)
  3786. This has been done to prevent problems on lesser operating systems
  3787. that can't tolerate `*'s in file names. The exported macro continues
  3788. to be named `and-let*', of course.
  3789. On systems that support it, there is also a compatibility module named
  3790. (ice-9 and-let*). It will go away in the next release.
  3791. ** New modules (oop goops) etc.:
  3792. (oop goops)
  3793. (oop goops describe)
  3794. (oop goops save)
  3795. (oop goops active-slot)
  3796. (oop goops composite-slot)
  3797. The Guile Object Oriented Programming System (GOOPS) has been
  3798. integrated into Guile. For further information, consult the GOOPS
  3799. manual and tutorial in the `doc' directory.
  3800. ** New module (ice-9 rdelim).
  3801. This exports the following procedures which were previously defined
  3802. in the default environment:
  3803. read-line read-line! read-delimited read-delimited! %read-delimited!
  3804. %read-line write-line
  3805. For backwards compatibility the definitions are still imported into the
  3806. default environment in this version of Guile. However you should add:
  3807. (use-modules (ice-9 rdelim))
  3808. to any program which uses the definitions, since this may change in
  3809. future.
  3810. Alternatively, if guile-scsh is installed, the (scsh rdelim) module
  3811. can be used for similar functionality.
  3812. ** New module (ice-9 rw)
  3813. This is a subset of the (scsh rw) module from guile-scsh. Currently
  3814. it defines two procedures:
  3815. *** New function: read-string!/partial str [port_or_fdes [start [end]]]
  3816. Read characters from a port or file descriptor into a string STR.
  3817. A port must have an underlying file descriptor -- a so-called
  3818. fport. This procedure is scsh-compatible and can efficiently read
  3819. large strings.
  3820. *** New function: write-string/partial str [port_or_fdes [start [end]]]
  3821. Write characters from a string STR to a port or file descriptor.
  3822. A port must have an underlying file descriptor -- a so-called
  3823. fport. This procedure is mostly compatible and can efficiently
  3824. write large strings.
  3825. ** New module (ice-9 match)
  3826. This module includes Andrew K. Wright's pattern matcher. See
  3827. ice-9/match.scm for brief description or
  3828. http://www.star-lab.com/wright/code.html
  3829. for complete documentation.
  3830. ** New module (ice-9 buffered-input)
  3831. This module provides procedures to construct an input port from an
  3832. underlying source of input that reads and returns its input in chunks.
  3833. The underlying input source is a Scheme procedure, specified by the
  3834. caller, which the port invokes whenever it needs more input.
  3835. This is useful when building an input port whose back end is Readline
  3836. or a UI element such as the GtkEntry widget.
  3837. ** Documentation
  3838. The reference and tutorial documentation that was previously
  3839. distributed separately, as `guile-doc', is now included in the core
  3840. Guile distribution. The documentation consists of the following
  3841. manuals.
  3842. - The Guile Tutorial (guile-tut.texi) contains a tutorial introduction
  3843. to using Guile.
  3844. - The Guile Reference Manual (guile.texi) contains (or is intended to
  3845. contain) reference documentation on all aspects of Guile.
  3846. - The GOOPS Manual (goops.texi) contains both tutorial-style and
  3847. reference documentation for using GOOPS, Guile's Object Oriented
  3848. Programming System.
  3849. - The Revised^5 Report on the Algorithmic Language Scheme
  3850. (r5rs.texi).
  3851. See the README file in the `doc' directory for more details.
  3852. ** There are a couple of examples in the examples/ directory now.
  3853. * Changes to the stand-alone interpreter
  3854. ** New command line option `--use-srfi'
  3855. Using this option, SRFI modules can be loaded on startup and be
  3856. available right from the beginning. This makes programming portable
  3857. Scheme programs easier.
  3858. The option `--use-srfi' expects a comma-separated list of numbers,
  3859. each representing a SRFI number to be loaded into the interpreter
  3860. before starting evaluating a script file or the REPL. Additionally,
  3861. the feature identifier for the loaded SRFIs is recognized by
  3862. `cond-expand' when using this option.
  3863. Example:
  3864. $ guile --use-srfi=8,13
  3865. guile> (receive (x z) (values 1 2) (+ 1 2))
  3866. 3
  3867. guile> (string-pad "bla" 20)
  3868. " bla"
  3869. ** Guile now always starts up in the `(guile-user)' module.
  3870. Previously, scripts executed via the `-s' option would run in the
  3871. `(guile)' module and the repl would run in the `(guile-user)' module.
  3872. Now every user action takes place in the `(guile-user)' module by
  3873. default.
  3874. * Changes to Scheme functions and syntax
  3875. ** Character classifiers work for non-ASCII characters.
  3876. The predicates `char-alphabetic?', `char-numeric?',
  3877. `char-whitespace?', `char-lower?', `char-upper?' and `char-is-both?'
  3878. no longer check whether their arguments are ASCII characters.
  3879. Previously, a character would only be considered alphabetic when it
  3880. was also ASCII, for example.
  3881. ** Previously deprecated Scheme functions have been removed:
  3882. tag - no replacement.
  3883. fseek - replaced by seek.
  3884. list* - replaced by cons*.
  3885. ** It's now possible to create modules with controlled environments
  3886. Example:
  3887. (use-modules (ice-9 safe))
  3888. (define m (make-safe-module))
  3889. ;;; m will now be a module containing only a safe subset of R5RS
  3890. (eval '(+ 1 2) m) --> 3
  3891. (eval 'load m) --> ERROR: Unbound variable: load
  3892. ** Evaluation of "()", the empty list, is now an error.
  3893. Previously, the expression "()" evaluated to the empty list. This has
  3894. been changed to signal a "missing expression" error. The correct way
  3895. to write the empty list as a literal constant is to use quote: "'()".
  3896. ** New concept of `Guile Extensions'.
  3897. A Guile Extension is just a ordinary shared library that can be linked
  3898. at run-time. We found it advantageous to give this simple concept a
  3899. dedicated name to distinguish the issues related to shared libraries
  3900. from the issues related to the module system.
  3901. *** New function: load-extension
  3902. Executing (load-extension lib init) is mostly equivalent to
  3903. (dynamic-call init (dynamic-link lib))
  3904. except when scm_register_extension has been called previously.
  3905. Whenever appropriate, you should use `load-extension' instead of
  3906. dynamic-link and dynamic-call.
  3907. *** New C function: scm_c_register_extension
  3908. This function registers a initialization function for use by
  3909. `load-extension'. Use it when you don't want specific extensions to
  3910. be loaded as shared libraries (for example on platforms that don't
  3911. support dynamic linking).
  3912. ** Auto-loading of compiled-code modules is deprecated.
  3913. Guile used to be able to automatically find and link a shared
  3914. library to satisfy requests for a module. For example, the module
  3915. `(foo bar)' could be implemented by placing a shared library named
  3916. "foo/libbar.so" (or with a different extension) in a directory on the
  3917. load path of Guile.
  3918. This has been found to be too tricky, and is no longer supported. The
  3919. shared libraries are now called "extensions". You should now write a
  3920. small Scheme file that calls `load-extension' to load the shared
  3921. library and initialize it explicitly.
  3922. The shared libraries themselves should be installed in the usual
  3923. places for shared libraries, with names like "libguile-foo-bar".
  3924. For example, place this into a file "foo/bar.scm"
  3925. (define-module (foo bar))
  3926. (load-extension "libguile-foo-bar" "foobar_init")
  3927. ** Backward incompatible change: eval EXP ENVIRONMENT-SPECIFIER
  3928. `eval' is now R5RS, that is it takes two arguments.
  3929. The second argument is an environment specifier, i.e. either
  3930. (scheme-report-environment 5)
  3931. (null-environment 5)
  3932. (interaction-environment)
  3933. or
  3934. any module.
  3935. ** The module system has been made more disciplined.
  3936. The function `eval' will save and restore the current module around
  3937. the evaluation of the specified expression. While this expression is
  3938. evaluated, `(current-module)' will now return the right module, which
  3939. is the module specified as the second argument to `eval'.
  3940. A consequence of this change is that `eval' is not particularly
  3941. useful when you want allow the evaluated code to change what module is
  3942. designated as the current module and have this change persist from one
  3943. call to `eval' to the next. The read-eval-print-loop is an example
  3944. where `eval' is now inadequate. To compensate, there is a new
  3945. function `primitive-eval' that does not take a module specifier and
  3946. that does not save/restore the current module. You should use this
  3947. function together with `set-current-module', `current-module', etc
  3948. when you want to have more control over the state that is carried from
  3949. one eval to the next.
  3950. Additionally, it has been made sure that forms that are evaluated at
  3951. the top level are always evaluated with respect to the current module.
  3952. Previously, subforms of top-level forms such as `begin', `case',
  3953. etc. did not respect changes to the current module although these
  3954. subforms are at the top-level as well.
  3955. To prevent strange behavior, the forms `define-module',
  3956. `use-modules', `use-syntax', and `export' have been restricted to only
  3957. work on the top level. The forms `define-public' and
  3958. `defmacro-public' only export the new binding on the top level. They
  3959. behave just like `define' and `defmacro', respectively, when they are
  3960. used in a lexical environment.
  3961. Also, `export' will no longer silently re-export bindings imported
  3962. from a used module. It will emit a `deprecation' warning and will
  3963. cease to perform any re-export in the next version. If you actually
  3964. want to re-export bindings, use the new `re-export' in place of
  3965. `export'. The new `re-export' will not make copies of variables when
  3966. rexporting them, as `export' did wrongly.
  3967. ** Module system now allows selection and renaming of imported bindings
  3968. Previously, when using `use-modules' or the `#:use-module' clause in
  3969. the `define-module' form, all the bindings (association of symbols to
  3970. values) for imported modules were added to the "current module" on an
  3971. as-is basis. This has been changed to allow finer control through two
  3972. new facilities: selection and renaming.
  3973. You can now select which of the imported module's bindings are to be
  3974. visible in the current module by using the `:select' clause. This
  3975. clause also can be used to rename individual bindings. For example:
  3976. ;; import all bindings no questions asked
  3977. (use-modules (ice-9 common-list))
  3978. ;; import four bindings, renaming two of them;
  3979. ;; the current module sees: every some zonk-y zonk-n
  3980. (use-modules ((ice-9 common-list)
  3981. :select (every some
  3982. (remove-if . zonk-y)
  3983. (remove-if-not . zonk-n))))
  3984. You can also programmatically rename all selected bindings using the
  3985. `:renamer' clause, which specifies a proc that takes a symbol and
  3986. returns another symbol. Because it is common practice to use a prefix,
  3987. we now provide the convenience procedure `symbol-prefix-proc'. For
  3988. example:
  3989. ;; import four bindings, renaming two of them specifically,
  3990. ;; and all four w/ prefix "CL:";
  3991. ;; the current module sees: CL:every CL:some CL:zonk-y CL:zonk-n
  3992. (use-modules ((ice-9 common-list)
  3993. :select (every some
  3994. (remove-if . zonk-y)
  3995. (remove-if-not . zonk-n))
  3996. :renamer (symbol-prefix-proc 'CL:)))
  3997. ;; import four bindings, renaming two of them specifically,
  3998. ;; and all four by upcasing.
  3999. ;; the current module sees: EVERY SOME ZONK-Y ZONK-N
  4000. (define (upcase-symbol sym)
  4001. (string->symbol (string-upcase (symbol->string sym))))
  4002. (use-modules ((ice-9 common-list)
  4003. :select (every some
  4004. (remove-if . zonk-y)
  4005. (remove-if-not . zonk-n))
  4006. :renamer upcase-symbol))
  4007. Note that programmatic renaming is done *after* individual renaming.
  4008. Also, the above examples show `use-modules', but the same facilities are
  4009. available for the `#:use-module' clause of `define-module'.
  4010. See manual for more info.
  4011. ** The semantics of guardians have changed.
  4012. The changes are for the most part compatible. An important criterion
  4013. was to keep the typical usage of guardians as simple as before, but to
  4014. make the semantics safer and (as a result) more useful.
  4015. *** All objects returned from guardians are now properly alive.
  4016. It is now guaranteed that any object referenced by an object returned
  4017. from a guardian is alive. It's now impossible for a guardian to
  4018. return a "contained" object before its "containing" object.
  4019. One incompatible (but probably not very important) change resulting
  4020. from this is that it is no longer possible to guard objects that
  4021. indirectly reference themselves (i.e. are parts of cycles). If you do
  4022. so accidentally, you'll get a warning.
  4023. *** There are now two types of guardians: greedy and sharing.
  4024. If you call (make-guardian #t) or just (make-guardian), you'll get a
  4025. greedy guardian, and for (make-guardian #f) a sharing guardian.
  4026. Greedy guardians are the default because they are more "defensive".
  4027. You can only greedily guard an object once. If you guard an object
  4028. more than once, once in a greedy guardian and the rest of times in
  4029. sharing guardians, then it is guaranteed that the object won't be
  4030. returned from sharing guardians as long as it is greedily guarded
  4031. and/or alive.
  4032. Guardians returned by calls to `make-guardian' can now take one more
  4033. optional parameter, which says whether to throw an error in case an
  4034. attempt is made to greedily guard an object that is already greedily
  4035. guarded. The default is true, i.e. throw an error. If the parameter
  4036. is false, the guardian invocation returns #t if guarding was
  4037. successful and #f if it wasn't.
  4038. Also, since greedy guarding is, in effect, a side-effecting operation
  4039. on objects, a new function is introduced: `destroy-guardian!'.
  4040. Invoking this function on a guardian renders it unoperative and, if
  4041. the guardian is greedy, clears the "greedily guarded" property of the
  4042. objects that were guarded by it, thus undoing the side effect.
  4043. Note that all this hair is hardly very important, since guardian
  4044. objects are usually permanent.
  4045. ** Continuations created by call-with-current-continuation now accept
  4046. any number of arguments, as required by R5RS.
  4047. ** New function `issue-deprecation-warning'
  4048. This function is used to display the deprecation messages that are
  4049. controlled by GUILE_WARN_DEPRECATION as explained in the README.
  4050. (define (id x)
  4051. (issue-deprecation-warning "`id' is deprecated. Use `identity' instead.")
  4052. (identity x))
  4053. guile> (id 1)
  4054. ;; `id' is deprecated. Use `identity' instead.
  4055. 1
  4056. guile> (id 1)
  4057. 1
  4058. ** New syntax `begin-deprecated'
  4059. When deprecated features are included (as determined by the configure
  4060. option --enable-deprecated), `begin-deprecated' is identical to
  4061. `begin'. When deprecated features are excluded, it always evaluates
  4062. to `#f', ignoring the body forms.
  4063. ** New function `make-object-property'
  4064. This function returns a new `procedure with setter' P that can be used
  4065. to attach a property to objects. When calling P as
  4066. (set! (P obj) val)
  4067. where `obj' is any kind of object, it attaches `val' to `obj' in such
  4068. a way that it can be retrieved by calling P as
  4069. (P obj)
  4070. This function will replace procedure properties, symbol properties and
  4071. source properties eventually.
  4072. ** Module (ice-9 optargs) now uses keywords instead of `#&'.
  4073. Instead of #&optional, #&key, etc you should now use #:optional,
  4074. #:key, etc. Since #:optional is a keyword, you can write it as just
  4075. :optional when (read-set! keywords 'prefix) is active.
  4076. The old reader syntax `#&' is still supported, but deprecated. It
  4077. will be removed in the next release.
  4078. ** New define-module option: pure
  4079. Tells the module system not to include any bindings from the root
  4080. module.
  4081. Example:
  4082. (define-module (totally-empty-module)
  4083. :pure)
  4084. ** New define-module option: export NAME1 ...
  4085. Export names NAME1 ...
  4086. This option is required if you want to be able to export bindings from
  4087. a module which doesn't import one of `define-public' or `export'.
  4088. Example:
  4089. (define-module (foo)
  4090. :pure
  4091. :use-module (ice-9 r5rs)
  4092. :export (bar))
  4093. ;;; Note that we're pure R5RS below this point!
  4094. (define (bar)
  4095. ...)
  4096. ** New function: object->string OBJ
  4097. Return a Scheme string obtained by printing a given object.
  4098. ** New function: port? X
  4099. Returns a boolean indicating whether X is a port. Equivalent to
  4100. `(or (input-port? X) (output-port? X))'.
  4101. ** New function: file-port?
  4102. Determines whether a given object is a port that is related to a file.
  4103. ** New function: port-for-each proc
  4104. Apply PROC to each port in the Guile port table in turn. The return
  4105. value is unspecified. More specifically, PROC is applied exactly once
  4106. to every port that exists in the system at the time PORT-FOR-EACH is
  4107. invoked. Changes to the port table while PORT-FOR-EACH is running
  4108. have no effect as far as PORT-FOR-EACH is concerned.
  4109. ** New function: dup2 oldfd newfd
  4110. A simple wrapper for the `dup2' system call. Copies the file
  4111. descriptor OLDFD to descriptor number NEWFD, replacing the
  4112. previous meaning of NEWFD. Both OLDFD and NEWFD must be integers.
  4113. Unlike for dup->fdes or primitive-move->fdes, no attempt is made
  4114. to move away ports which are using NEWFD. The return value is
  4115. unspecified.
  4116. ** New function: close-fdes fd
  4117. A simple wrapper for the `close' system call. Close file
  4118. descriptor FD, which must be an integer. Unlike close (*note
  4119. close: Ports and File Descriptors.), the file descriptor will be
  4120. closed even if a port is using it. The return value is
  4121. unspecified.
  4122. ** New function: crypt password salt
  4123. Encrypts `password' using the standard unix password encryption
  4124. algorithm.
  4125. ** New function: chroot path
  4126. Change the root directory of the running process to `path'.
  4127. ** New functions: getlogin, cuserid
  4128. Return the login name or the user name of the current effective user
  4129. id, respectively.
  4130. ** New functions: getpriority which who, setpriority which who prio
  4131. Get or set the priority of the running process.
  4132. ** New function: getpass prompt
  4133. Read a password from the terminal, first displaying `prompt' and
  4134. disabling echoing.
  4135. ** New function: flock file operation
  4136. Set/remove an advisory shared or exclusive lock on `file'.
  4137. ** New functions: sethostname name, gethostname
  4138. Set or get the hostname of the machine the current process is running
  4139. on.
  4140. ** New function: mkstemp! tmpl
  4141. mkstemp creates a new unique file in the file system and returns a
  4142. new buffered port open for reading and writing to the file. TMPL
  4143. is a string specifying where the file should be created: it must
  4144. end with `XXXXXX' and will be changed in place to return the name
  4145. of the temporary file.
  4146. ** New function: open-input-string string
  4147. Return an input string port which delivers the characters from
  4148. `string'. This procedure, together with `open-output-string' and
  4149. `get-output-string' implements SRFI-6.
  4150. ** New function: open-output-string
  4151. Return an output string port which collects all data written to it.
  4152. The data can then be retrieved by `get-output-string'.
  4153. ** New function: get-output-string
  4154. Return the contents of an output string port.
  4155. ** New function: identity
  4156. Return the argument.
  4157. ** socket, connect, accept etc., now have support for IPv6. IPv6 addresses
  4158. are represented in Scheme as integers with normal host byte ordering.
  4159. ** New function: inet-pton family address
  4160. Convert a printable string network address into an integer. Note that
  4161. unlike the C version of this function, the result is an integer with
  4162. normal host byte ordering. FAMILY can be `AF_INET' or `AF_INET6'.
  4163. e.g.,
  4164. (inet-pton AF_INET "127.0.0.1") => 2130706433
  4165. (inet-pton AF_INET6 "::1") => 1
  4166. ** New function: inet-ntop family address
  4167. Convert an integer network address into a printable string. Note that
  4168. unlike the C version of this function, the input is an integer with
  4169. normal host byte ordering. FAMILY can be `AF_INET' or `AF_INET6'.
  4170. e.g.,
  4171. (inet-ntop AF_INET 2130706433) => "127.0.0.1"
  4172. (inet-ntop AF_INET6 (- (expt 2 128) 1)) =>
  4173. ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
  4174. ** Deprecated: id
  4175. Use `identity' instead.
  4176. ** Deprecated: -1+
  4177. Use `1-' instead.
  4178. ** Deprecated: return-it
  4179. Do without it.
  4180. ** Deprecated: string-character-length
  4181. Use `string-length' instead.
  4182. ** Deprecated: flags
  4183. Use `logior' instead.
  4184. ** Deprecated: close-all-ports-except.
  4185. This was intended for closing ports in a child process after a fork,
  4186. but it has the undesirable side effect of flushing buffers.
  4187. port-for-each is more flexible.
  4188. ** The (ice-9 popen) module now attempts to set up file descriptors in
  4189. the child process from the current Scheme ports, instead of using the
  4190. current values of file descriptors 0, 1, and 2 in the parent process.
  4191. ** Removed function: builtin-weak-bindings
  4192. There is no such concept as a weak binding any more.
  4193. ** Removed constants: bignum-radix, scm-line-incrementors
  4194. ** define-method: New syntax mandatory.
  4195. The new method syntax is now mandatory:
  4196. (define-method (NAME ARG-SPEC ...) BODY ...)
  4197. (define-method (NAME ARG-SPEC ... . REST-ARG) BODY ...)
  4198. ARG-SPEC ::= ARG-NAME | (ARG-NAME TYPE)
  4199. REST-ARG ::= ARG-NAME
  4200. If you have old code using the old syntax, import
  4201. (oop goops old-define-method) before (oop goops) as in:
  4202. (use-modules (oop goops old-define-method) (oop goops))
  4203. ** Deprecated function: builtin-variable
  4204. Removed function: builtin-bindings
  4205. There is no longer a distinction between builtin or other variables.
  4206. Use module system operations for all variables.
  4207. ** Lazy-catch handlers are no longer allowed to return.
  4208. That is, a call to `throw', `error', etc is now guaranteed to not
  4209. return.
  4210. ** Bugfixes for (ice-9 getopt-long)
  4211. This module is now tested using test-suite/tests/getopt-long.test.
  4212. The following bugs have been fixed:
  4213. *** Parsing for options that are specified to have `optional' args now checks
  4214. if the next element is an option instead of unconditionally taking it as the
  4215. option arg.
  4216. *** An error is now thrown for `--opt=val' when the option description
  4217. does not specify `(value #t)' or `(value optional)'. This condition used to
  4218. be accepted w/o error, contrary to the documentation.
  4219. *** The error message for unrecognized options is now more informative.
  4220. It used to be "not a record", an artifact of the implementation.
  4221. *** The error message for `--opt' terminating the arg list (no value), when
  4222. `(value #t)' is specified, is now more informative. It used to be "not enough
  4223. args".
  4224. *** "Clumped" single-char args now preserve trailing string, use it as arg.
  4225. The expansion used to be like so:
  4226. ("-abc5d" "--xyz") => ("-a" "-b" "-c" "--xyz")
  4227. Note that the "5d" is dropped. Now it is like so:
  4228. ("-abc5d" "--xyz") => ("-a" "-b" "-c" "5d" "--xyz")
  4229. This enables single-char options to have adjoining arguments as long as their
  4230. constituent characters are not potential single-char options.
  4231. ** (ice-9 session) procedure `arity' now works with (ice-9 optargs) `lambda*'
  4232. The `lambda*' and derivative forms in (ice-9 optargs) now set a procedure
  4233. property `arglist', which can be retrieved by `arity'. The result is that
  4234. `arity' can give more detailed information than before:
  4235. Before:
  4236. guile> (use-modules (ice-9 optargs))
  4237. guile> (define* (foo #:optional a b c) a)
  4238. guile> (arity foo)
  4239. 0 or more arguments in `lambda*:G0'.
  4240. After:
  4241. guile> (arity foo)
  4242. 3 optional arguments: `a', `b' and `c'.
  4243. guile> (define* (bar a b #:key c d #:allow-other-keys) a)
  4244. guile> (arity bar)
  4245. 2 required arguments: `a' and `b', 2 keyword arguments: `c'
  4246. and `d', other keywords allowed.
  4247. guile> (define* (baz a b #:optional c #:rest r) a)
  4248. guile> (arity baz)
  4249. 2 required arguments: `a' and `b', 1 optional argument: `c',
  4250. the rest in `r'.
  4251. * Changes to the C interface
  4252. ** Types have been renamed from scm_*_t to scm_t_*.
  4253. This has been done for POSIX sake. It reserves identifiers ending
  4254. with "_t". What a concept.
  4255. The old names are still available with status `deprecated'.
  4256. ** scm_t_bits (former scm_bits_t) is now a unsigned type.
  4257. ** Deprecated features have been removed.
  4258. *** Macros removed
  4259. SCM_INPORTP, SCM_OUTPORTP SCM_ICHRP, SCM_ICHR, SCM_MAKICHR
  4260. SCM_SETJMPBUF SCM_NSTRINGP SCM_NRWSTRINGP SCM_NVECTORP SCM_DOUBLE_CELLP
  4261. *** C Functions removed
  4262. scm_sysmissing scm_tag scm_tc16_flo scm_tc_flo
  4263. scm_fseek - replaced by scm_seek.
  4264. gc-thunk - replaced by after-gc-hook.
  4265. gh_int2scmb - replaced by gh_bool2scm.
  4266. scm_tc_dblr - replaced by scm_tc16_real.
  4267. scm_tc_dblc - replaced by scm_tc16_complex.
  4268. scm_list_star - replaced by scm_cons_star.
  4269. ** Deprecated: scm_makfromstr
  4270. Use scm_mem2string instead.
  4271. ** Deprecated: scm_make_shared_substring
  4272. Explicit shared substrings will disappear from Guile.
  4273. Instead, "normal" strings will be implemented using sharing
  4274. internally, combined with a copy-on-write strategy.
  4275. ** Deprecated: scm_read_only_string_p
  4276. The concept of read-only strings will disappear in next release of
  4277. Guile.
  4278. ** Deprecated: scm_sloppy_memq, scm_sloppy_memv, scm_sloppy_member
  4279. Instead, use scm_c_memq or scm_memq, scm_memv, scm_member.
  4280. ** New functions: scm_call_0, scm_call_1, scm_call_2, scm_call_3
  4281. Call a procedure with the indicated number of arguments. See "Fly
  4282. Evaluation" in the manual.
  4283. ** New functions: scm_apply_0, scm_apply_1, scm_apply_2, scm_apply_3
  4284. Call a procedure with the indicated number of arguments and a list of
  4285. further arguments. See "Fly Evaluation" in the manual.
  4286. ** New functions: scm_list_1, scm_list_2, scm_list_3, scm_list_4, scm_list_5
  4287. Create a list of the given number of elements. See "List
  4288. Constructors" in the manual.
  4289. ** Renamed function: scm_listify has been replaced by scm_list_n.
  4290. ** Deprecated macros: SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4,
  4291. SCM_LIST5, SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9.
  4292. Use functions scm_list_N instead.
  4293. ** New function: scm_c_read (SCM port, void *buffer, scm_sizet size)
  4294. Used by an application to read arbitrary number of bytes from a port.
  4295. Same semantics as libc read, except that scm_c_read only returns less
  4296. than SIZE bytes if at end-of-file.
  4297. Warning: Doesn't update port line and column counts!
  4298. ** New function: scm_c_write (SCM port, const void *ptr, scm_sizet size)
  4299. Used by an application to write arbitrary number of bytes to an SCM
  4300. port. Similar semantics as libc write. However, unlike libc
  4301. write, scm_c_write writes the requested number of bytes and has no
  4302. return value.
  4303. Warning: Doesn't update port line and column counts!
  4304. ** New function: scm_init_guile ()
  4305. In contrast to scm_boot_guile, scm_init_guile will return normally
  4306. after initializing Guile. It is not available on all systems, tho.
  4307. ** New functions: scm_str2symbol, scm_mem2symbol
  4308. The function scm_str2symbol takes a const char* pointing to a zero-terminated
  4309. field of characters and creates a scheme symbol object from that C string.
  4310. The function scm_mem2symbol takes a const char* and a number of characters and
  4311. creates a symbol from the characters in that memory area.
  4312. ** New functions: scm_primitive_make_property
  4313. scm_primitive_property_ref
  4314. scm_primitive_property_set_x
  4315. scm_primitive_property_del_x
  4316. These functions implement a new way to deal with object properties.
  4317. See libguile/properties.c for their documentation.
  4318. ** New function: scm_done_free (long size)
  4319. This function is the inverse of scm_done_malloc. Use it to report the
  4320. amount of smob memory you free. The previous method, which involved
  4321. calling scm_done_malloc with negative argument, was somewhat
  4322. unintuitive (and is still available, of course).
  4323. ** New function: scm_c_memq (SCM obj, SCM list)
  4324. This function provides a fast C level alternative for scm_memq for the case
  4325. that the list parameter is known to be a proper list. The function is a
  4326. replacement for scm_sloppy_memq, but is stricter in its requirements on its
  4327. list input parameter, since for anything else but a proper list the function's
  4328. behaviour is undefined - it may even crash or loop endlessly. Further, for
  4329. the case that the object is not found in the list, scm_c_memq returns #f which
  4330. is similar to scm_memq, but different from scm_sloppy_memq's behaviour.
  4331. ** New functions: scm_remember_upto_here_1, scm_remember_upto_here_2,
  4332. scm_remember_upto_here
  4333. These functions replace the function scm_remember.
  4334. ** Deprecated function: scm_remember
  4335. Use one of the new functions scm_remember_upto_here_1,
  4336. scm_remember_upto_here_2 or scm_remember_upto_here instead.
  4337. ** New function: scm_allocate_string
  4338. This function replaces the function scm_makstr.
  4339. ** Deprecated function: scm_makstr
  4340. Use the new function scm_allocate_string instead.
  4341. ** New global variable scm_gc_running_p introduced.
  4342. Use this variable to find out if garbage collection is being executed. Up to
  4343. now applications have used scm_gc_heap_lock to test if garbage collection was
  4344. running, which also works because of the fact that up to know only the garbage
  4345. collector has set this variable. But, this is an implementation detail that
  4346. may change. Further, scm_gc_heap_lock is not set throughout gc, thus the use
  4347. of this variable is (and has been) not fully safe anyway.
  4348. ** New macros: SCM_BITVECTOR_MAX_LENGTH, SCM_UVECTOR_MAX_LENGTH
  4349. Use these instead of SCM_LENGTH_MAX.
  4350. ** New macros: SCM_CONTINUATION_LENGTH, SCM_CCLO_LENGTH, SCM_STACK_LENGTH,
  4351. SCM_STRING_LENGTH, SCM_SYMBOL_LENGTH, SCM_UVECTOR_LENGTH,
  4352. SCM_BITVECTOR_LENGTH, SCM_VECTOR_LENGTH.
  4353. Use these instead of SCM_LENGTH.
  4354. ** New macros: SCM_SET_CONTINUATION_LENGTH, SCM_SET_STRING_LENGTH,
  4355. SCM_SET_SYMBOL_LENGTH, SCM_SET_VECTOR_LENGTH, SCM_SET_UVECTOR_LENGTH,
  4356. SCM_SET_BITVECTOR_LENGTH
  4357. Use these instead of SCM_SETLENGTH
  4358. ** New macros: SCM_STRING_CHARS, SCM_SYMBOL_CHARS, SCM_CCLO_BASE,
  4359. SCM_VECTOR_BASE, SCM_UVECTOR_BASE, SCM_BITVECTOR_BASE, SCM_COMPLEX_MEM,
  4360. SCM_ARRAY_MEM
  4361. Use these instead of SCM_CHARS, SCM_UCHARS, SCM_ROCHARS, SCM_ROUCHARS or
  4362. SCM_VELTS.
  4363. ** New macros: SCM_SET_BIGNUM_BASE, SCM_SET_STRING_CHARS,
  4364. SCM_SET_SYMBOL_CHARS, SCM_SET_UVECTOR_BASE, SCM_SET_BITVECTOR_BASE,
  4365. SCM_SET_VECTOR_BASE
  4366. Use these instead of SCM_SETCHARS.
  4367. ** New macro: SCM_BITVECTOR_P
  4368. ** New macro: SCM_STRING_COERCE_0TERMINATION_X
  4369. Use instead of SCM_COERCE_SUBSTR.
  4370. ** New macros: SCM_DIR_OPEN_P, SCM_DIR_FLAG_OPEN
  4371. For directory objects, use these instead of SCM_OPDIRP and SCM_OPN.
  4372. ** Deprecated macros: SCM_OUTOFRANGE, SCM_NALLOC, SCM_HUP_SIGNAL,
  4373. SCM_INT_SIGNAL, SCM_FPE_SIGNAL, SCM_BUS_SIGNAL, SCM_SEGV_SIGNAL,
  4374. SCM_ALRM_SIGNAL, SCM_GC_SIGNAL, SCM_TICK_SIGNAL, SCM_SIG_ORD,
  4375. SCM_ORD_SIG, SCM_NUM_SIGS, SCM_SYMBOL_SLOTS, SCM_SLOTS, SCM_SLOPPY_STRINGP,
  4376. SCM_VALIDATE_STRINGORSUBSTR, SCM_FREEP, SCM_NFREEP, SCM_CHARS, SCM_UCHARS,
  4377. SCM_VALIDATE_ROSTRING, SCM_VALIDATE_ROSTRING_COPY,
  4378. SCM_VALIDATE_NULLORROSTRING_COPY, SCM_ROLENGTH, SCM_LENGTH, SCM_HUGE_LENGTH,
  4379. SCM_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET, SCM_COERCE_SUBSTR,
  4380. SCM_ROSTRINGP, SCM_RWSTRINGP, SCM_VALIDATE_RWSTRING, SCM_ROCHARS,
  4381. SCM_ROUCHARS, SCM_SETLENGTH, SCM_SETCHARS, SCM_LENGTH_MAX, SCM_GC8MARKP,
  4382. SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16, SCM_GCCDR, SCM_SUBR_DOC,
  4383. SCM_OPDIRP, SCM_VALIDATE_OPDIR, SCM_WTA, RETURN_SCM_WTA, SCM_CONST_LONG,
  4384. SCM_WNA, SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY,
  4385. SCM_VALIDATE_NUMBER_DEF_COPY, SCM_SLOPPY_CONSP, SCM_SLOPPY_NCONSP,
  4386. SCM_SETAND_CDR, SCM_SETOR_CDR, SCM_SETAND_CAR, SCM_SETOR_CAR
  4387. Use SCM_ASSERT_RANGE or SCM_VALIDATE_XXX_RANGE instead of SCM_OUTOFRANGE.
  4388. Use scm_memory_error instead of SCM_NALLOC.
  4389. Use SCM_STRINGP instead of SCM_SLOPPY_STRINGP.
  4390. Use SCM_VALIDATE_STRING instead of SCM_VALIDATE_STRINGORSUBSTR.
  4391. Use SCM_FREE_CELL_P instead of SCM_FREEP/SCM_NFREEP
  4392. Use a type specific accessor macro instead of SCM_CHARS/SCM_UCHARS.
  4393. Use a type specific accessor instead of SCM(_|_RO|_HUGE_)LENGTH.
  4394. Use SCM_VALIDATE_(SYMBOL|STRING) instead of SCM_VALIDATE_ROSTRING.
  4395. Use SCM_STRING_COERCE_0TERMINATION_X instead of SCM_COERCE_SUBSTR.
  4396. Use SCM_STRINGP or SCM_SYMBOLP instead of SCM_ROSTRINGP.
  4397. Use SCM_STRINGP instead of SCM_RWSTRINGP.
  4398. Use SCM_VALIDATE_STRING instead of SCM_VALIDATE_RWSTRING.
  4399. Use SCM_STRING_CHARS instead of SCM_ROCHARS.
  4400. Use SCM_STRING_UCHARS instead of SCM_ROUCHARS.
  4401. Use a type specific setter macro instead of SCM_SETLENGTH.
  4402. Use a type specific setter macro instead of SCM_SETCHARS.
  4403. Use a type specific length macro instead of SCM_LENGTH_MAX.
  4404. Use SCM_GCMARKP instead of SCM_GC8MARKP.
  4405. Use SCM_SETGCMARK instead of SCM_SETGC8MARK.
  4406. Use SCM_CLRGCMARK instead of SCM_CLRGC8MARK.
  4407. Use SCM_TYP16 instead of SCM_GCTYP16.
  4408. Use SCM_CDR instead of SCM_GCCDR.
  4409. Use SCM_DIR_OPEN_P instead of SCM_OPDIRP.
  4410. Use SCM_MISC_ERROR or SCM_WRONG_TYPE_ARG instead of SCM_WTA.
  4411. Use SCM_MISC_ERROR or SCM_WRONG_TYPE_ARG instead of RETURN_SCM_WTA.
  4412. Use SCM_VCELL_INIT instead of SCM_CONST_LONG.
  4413. Use SCM_WRONG_NUM_ARGS instead of SCM_WNA.
  4414. Use SCM_CONSP instead of SCM_SLOPPY_CONSP.
  4415. Use !SCM_CONSP instead of SCM_SLOPPY_NCONSP.
  4416. ** Removed function: scm_struct_init
  4417. ** Removed variable: scm_symhash_dim
  4418. ** Renamed function: scm_make_cont has been replaced by
  4419. scm_make_continuation, which has a different interface.
  4420. ** Deprecated function: scm_call_catching_errors
  4421. Use scm_catch or scm_lazy_catch from throw.[ch] instead.
  4422. ** Deprecated function: scm_strhash
  4423. Use scm_string_hash instead.
  4424. ** Deprecated function: scm_vector_set_length_x
  4425. Instead, create a fresh vector of the desired size and copy the contents.
  4426. ** scm_gensym has changed prototype
  4427. scm_gensym now only takes one argument.
  4428. ** Deprecated type tags: scm_tc7_ssymbol, scm_tc7_msymbol, scm_tcs_symbols,
  4429. scm_tc7_lvector
  4430. There is now only a single symbol type scm_tc7_symbol.
  4431. The tag scm_tc7_lvector was not used anyway.
  4432. ** Deprecated function: scm_make_smob_type_mfpe, scm_set_smob_mfpe.
  4433. Use scm_make_smob_type and scm_set_smob_XXX instead.
  4434. ** New function scm_set_smob_apply.
  4435. This can be used to set an apply function to a smob type.
  4436. ** Deprecated function: scm_strprint_obj
  4437. Use scm_object_to_string instead.
  4438. ** Deprecated function: scm_wta
  4439. Use scm_wrong_type_arg, or another appropriate error signalling function
  4440. instead.
  4441. ** Explicit support for obarrays has been deprecated.
  4442. Use `scm_str2symbol' and the generic hashtable functions instead.
  4443. ** The concept of `vcells' has been deprecated.
  4444. The data type `variable' is now used exclusively. `Vcells' have been
  4445. a low-level concept so you are likely not affected by this change.
  4446. *** Deprecated functions: scm_sym2vcell, scm_sysintern,
  4447. scm_sysintern0, scm_symbol_value0, scm_intern, scm_intern0.
  4448. Use scm_c_define or scm_c_lookup instead, as appropriate.
  4449. *** New functions: scm_c_module_lookup, scm_c_lookup,
  4450. scm_c_module_define, scm_c_define, scm_module_lookup, scm_lookup,
  4451. scm_module_define, scm_define.
  4452. These functions work with variables instead of with vcells.
  4453. ** New functions for creating and defining `subr's and `gsubr's.
  4454. The new functions more clearly distinguish between creating a subr (or
  4455. gsubr) object and adding it to the current module.
  4456. These new functions are available: scm_c_make_subr, scm_c_define_subr,
  4457. scm_c_make_subr_with_generic, scm_c_define_subr_with_generic,
  4458. scm_c_make_gsubr, scm_c_define_gsubr, scm_c_make_gsubr_with_generic,
  4459. scm_c_define_gsubr_with_generic.
  4460. ** Deprecated functions: scm_make_subr, scm_make_subr_opt,
  4461. scm_make_subr_with_generic, scm_make_gsubr,
  4462. scm_make_gsubr_with_generic.
  4463. Use the new ones from above instead.
  4464. ** C interface to the module system has changed.
  4465. While we suggest that you avoid as many explicit module system
  4466. operations from C as possible for the time being, the C interface has
  4467. been made more similar to the high-level Scheme module system.
  4468. *** New functions: scm_c_define_module, scm_c_use_module,
  4469. scm_c_export, scm_c_resolve_module.
  4470. They mostly work like their Scheme namesakes. scm_c_define_module
  4471. takes a function that is called a context where the new module is
  4472. current.
  4473. *** Deprecated functions: scm_the_root_module, scm_make_module,
  4474. scm_ensure_user_module, scm_load_scheme_module.
  4475. Use the new functions instead.
  4476. ** Renamed function: scm_internal_with_fluids becomes
  4477. scm_c_with_fluids.
  4478. scm_internal_with_fluids is available as a deprecated function.
  4479. ** New function: scm_c_with_fluid.
  4480. Just like scm_c_with_fluids, but takes one fluid and one value instead
  4481. of lists of same.
  4482. ** Deprecated typedefs: long_long, ulong_long.
  4483. They are of questionable utility and they pollute the global
  4484. namespace.
  4485. ** Deprecated typedef: scm_sizet
  4486. It is of questionable utility now that Guile requires ANSI C, and is
  4487. oddly named.
  4488. ** Deprecated typedefs: scm_port_rw_active, scm_port,
  4489. scm_ptob_descriptor, scm_debug_info, scm_debug_frame, scm_fport,
  4490. scm_option, scm_rstate, scm_rng, scm_array, scm_array_dim.
  4491. Made more compliant with the naming policy by adding a _t at the end.
  4492. ** Deprecated functions: scm_mkbig, scm_big2num, scm_adjbig,
  4493. scm_normbig, scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl
  4494. With the exception of the mysterious scm_2ulong2big, they are still
  4495. available under new names (scm_i_mkbig etc). These functions are not
  4496. intended to be used in user code. You should avoid dealing with
  4497. bignums directly, and should deal with numbers in general (which can
  4498. be bignums).
  4499. ** Change in behavior: scm_num2long, scm_num2ulong
  4500. The scm_num2[u]long functions don't any longer accept an inexact
  4501. argument. This change in behavior is motivated by concordance with
  4502. R5RS: It is more common that a primitive doesn't want to accept an
  4503. inexact for an exact.
  4504. ** New functions: scm_short2num, scm_ushort2num, scm_int2num,
  4505. scm_uint2num, scm_size2num, scm_ptrdiff2num, scm_num2short,
  4506. scm_num2ushort, scm_num2int, scm_num2uint, scm_num2ptrdiff,
  4507. scm_num2size.
  4508. These are conversion functions between the various ANSI C integral
  4509. types and Scheme numbers. NOTE: The scm_num2xxx functions don't
  4510. accept an inexact argument.
  4511. ** New functions: scm_float2num, scm_double2num,
  4512. scm_num2float, scm_num2double.
  4513. These are conversion functions between the two ANSI C float types and
  4514. Scheme numbers.
  4515. ** New number validation macros:
  4516. SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,INT,UINT}[_DEF]
  4517. See above.
  4518. ** New functions: scm_gc_protect_object, scm_gc_unprotect_object
  4519. These are just nicer-named old scm_protect_object and
  4520. scm_unprotect_object.
  4521. ** Deprecated functions: scm_protect_object, scm_unprotect_object
  4522. ** New functions: scm_gc_[un]register_root, scm_gc_[un]register_roots
  4523. These functions can be used to register pointers to locations that
  4524. hold SCM values.
  4525. ** Deprecated function: scm_create_hook.
  4526. Its sins are: misleading name, non-modularity and lack of general
  4527. usefulness.
  4528. Changes since Guile 1.3.4:
  4529. * Changes to the distribution
  4530. ** Trees from nightly snapshots and CVS now require you to run autogen.sh.
  4531. We've changed the way we handle generated files in the Guile source
  4532. repository. As a result, the procedure for building trees obtained
  4533. from the nightly FTP snapshots or via CVS has changed:
  4534. - You must have appropriate versions of autoconf, automake, and
  4535. libtool installed on your system. See README for info on how to
  4536. obtain these programs.
  4537. - Before configuring the tree, you must first run the script
  4538. `autogen.sh' at the top of the source tree.
  4539. The Guile repository used to contain not only source files, written by
  4540. humans, but also some generated files, like configure scripts and
  4541. Makefile.in files. Even though the contents of these files could be
  4542. derived mechanically from other files present, we thought it would
  4543. make the tree easier to build if we checked them into CVS.
  4544. However, this approach means that minor differences between
  4545. developer's installed tools and habits affected the whole team.
  4546. So we have removed the generated files from the repository, and
  4547. added the autogen.sh script, which will reconstruct them
  4548. appropriately.
  4549. ** configure now has experimental options to remove support for certain
  4550. features:
  4551. --disable-arrays omit array and uniform array support
  4552. --disable-posix omit posix interfaces
  4553. --disable-networking omit networking interfaces
  4554. --disable-regex omit regular expression interfaces
  4555. These are likely to become separate modules some day.
  4556. ** New configure option --enable-debug-freelist
  4557. This enables a debugging version of SCM_NEWCELL(), and also registers
  4558. an extra primitive, the setter `gc-set-debug-check-freelist!'.
  4559. Configure with the --enable-debug-freelist option to enable
  4560. the gc-set-debug-check-freelist! primitive, and then use:
  4561. (gc-set-debug-check-freelist! #t) # turn on checking of the freelist
  4562. (gc-set-debug-check-freelist! #f) # turn off checking
  4563. Checking of the freelist forces a traversal of the freelist and
  4564. a garbage collection before each allocation of a cell. This can
  4565. slow down the interpreter dramatically, so the setter should be used to
  4566. turn on this extra processing only when necessary.
  4567. ** New configure option --enable-debug-malloc
  4568. Include code for debugging of calls to scm_must_malloc/realloc/free.
  4569. Checks that
  4570. 1. objects freed by scm_must_free has been mallocated by scm_must_malloc
  4571. 2. objects reallocated by scm_must_realloc has been allocated by
  4572. scm_must_malloc
  4573. 3. reallocated objects are reallocated with the same what string
  4574. But, most importantly, it records the number of allocated objects of
  4575. each kind. This is useful when searching for memory leaks.
  4576. A Guile compiled with this option provides the primitive
  4577. `malloc-stats' which returns an alist with pairs of kind and the
  4578. number of objects of that kind.
  4579. ** All includes are now referenced relative to the root directory
  4580. Since some users have had problems with mixups between Guile and
  4581. system headers, we have decided to always refer to Guile headers via
  4582. their parent directories. This essentially creates a "private name
  4583. space" for Guile headers. This means that the compiler only is given
  4584. -I options for the root build and root source directory.
  4585. ** Header files kw.h and genio.h have been removed.
  4586. ** The module (ice-9 getopt-gnu-style) has been removed.
  4587. ** New module (ice-9 documentation)
  4588. Implements the interface to documentation strings associated with
  4589. objects.
  4590. ** New module (ice-9 time)
  4591. Provides a macro `time', which displays execution time of a given form.
  4592. ** New module (ice-9 history)
  4593. Loading this module enables value history in the repl.
  4594. * Changes to the stand-alone interpreter
  4595. ** New command line option --debug
  4596. Start Guile with debugging evaluator and backtraces enabled.
  4597. This is useful when debugging your .guile init file or scripts.
  4598. ** New help facility
  4599. Usage: (help NAME) gives documentation about objects named NAME (a symbol)
  4600. (help REGEXP) ditto for objects with names matching REGEXP (a string)
  4601. (help 'NAME) gives documentation for NAME, even if it is not an object
  4602. (help ,EXPR) gives documentation for object returned by EXPR
  4603. (help (my module)) gives module commentary for `(my module)'
  4604. (help) gives this text
  4605. `help' searches among bindings exported from loaded modules, while
  4606. `apropos' searches among bindings visible from the "current" module.
  4607. Examples: (help help)
  4608. (help cons)
  4609. (help "output-string")
  4610. ** `help' and `apropos' now prints full module names
  4611. ** Dynamic linking now uses libltdl from the libtool package.
  4612. The old system dependent code for doing dynamic linking has been
  4613. replaced with calls to the libltdl functions which do all the hairy
  4614. details for us.
  4615. The major improvement is that you can now directly pass libtool
  4616. library names like "libfoo.la" to `dynamic-link' and `dynamic-link'
  4617. will be able to do the best shared library job you can get, via
  4618. libltdl.
  4619. The way dynamic libraries are found has changed and is not really
  4620. portable across platforms, probably. It is therefore recommended to
  4621. use absolute filenames when possible.
  4622. If you pass a filename without an extension to `dynamic-link', it will
  4623. try a few appropriate ones. Thus, the most platform ignorant way is
  4624. to specify a name like "libfoo", without any directories and
  4625. extensions.
  4626. ** Guile COOP threads are now compatible with LinuxThreads
  4627. Previously, COOP threading wasn't possible in applications linked with
  4628. Linux POSIX threads due to their use of the stack pointer to find the
  4629. thread context. This has now been fixed with a workaround which uses
  4630. the pthreads to allocate the stack.
  4631. ** New primitives: `pkgdata-dir', `site-dir', `library-dir'
  4632. ** Positions of erring expression in scripts
  4633. With version 1.3.4, the location of the erring expression in Guile
  4634. scipts is no longer automatically reported. (This should have been
  4635. documented before the 1.3.4 release.)
  4636. You can get this information by enabling recording of positions of
  4637. source expressions and running the debugging evaluator. Put this at
  4638. the top of your script (or in your "site" file):
  4639. (read-enable 'positions)
  4640. (debug-enable 'debug)
  4641. ** Backtraces in scripts
  4642. It is now possible to get backtraces in scripts.
  4643. Put
  4644. (debug-enable 'debug 'backtrace)
  4645. at the top of the script.
  4646. (The first options enables the debugging evaluator.
  4647. The second enables backtraces.)
  4648. ** Part of module system symbol lookup now implemented in C
  4649. The eval closure of most modules is now implemented in C. Since this
  4650. was one of the bottlenecks for loading speed, Guile now loads code
  4651. substantially faster than before.
  4652. ** Attempting to get the value of an unbound variable now produces
  4653. an exception with a key of 'unbound-variable instead of 'misc-error.
  4654. ** The initial default output port is now unbuffered if it's using a
  4655. tty device. Previously in this situation it was line-buffered.
  4656. ** New hook: after-gc-hook
  4657. after-gc-hook takes over the role of gc-thunk. This hook is run at
  4658. the first SCM_TICK after a GC. (Thus, the code is run at the same
  4659. point during evaluation as signal handlers.)
  4660. Note that this hook should be used only for diagnostic and debugging
  4661. purposes. It is not certain that it will continue to be well-defined
  4662. when this hook is run in the future.
  4663. C programmers: Note the new C level hooks scm_before_gc_c_hook,
  4664. scm_before_sweep_c_hook, scm_after_gc_c_hook.
  4665. ** Improvements to garbage collector
  4666. Guile 1.4 has a new policy for triggering heap allocation and
  4667. determining the sizes of heap segments. It fixes a number of problems
  4668. in the old GC.
  4669. 1. The new policy can handle two separate pools of cells
  4670. (2-word/4-word) better. (The old policy would run wild, allocating
  4671. more and more memory for certain programs.)
  4672. 2. The old code would sometimes allocate far too much heap so that the
  4673. Guile process became gigantic. The new code avoids this.
  4674. 3. The old code would sometimes allocate too little so that few cells
  4675. were freed at GC so that, in turn, too much time was spent in GC.
  4676. 4. The old code would often trigger heap allocation several times in a
  4677. row. (The new scheme predicts how large the segments needs to be
  4678. in order not to need further allocation.)
  4679. All in all, the new GC policy will make larger applications more
  4680. efficient.
  4681. The new GC scheme also is prepared for POSIX threading. Threads can
  4682. allocate private pools of cells ("clusters") with just a single
  4683. function call. Allocation of single cells from such a cluster can
  4684. then proceed without any need of inter-thread synchronization.
  4685. ** New environment variables controlling GC parameters
  4686. GUILE_MAX_SEGMENT_SIZE Maximal segment size
  4687. (default = 2097000)
  4688. Allocation of 2-word cell heaps:
  4689. GUILE_INIT_SEGMENT_SIZE_1 Size of initial heap segment in bytes
  4690. (default = 360000)
  4691. GUILE_MIN_YIELD_1 Minimum number of freed cells at each
  4692. GC in percent of total heap size
  4693. (default = 40)
  4694. Allocation of 4-word cell heaps
  4695. (used for real numbers and misc other objects):
  4696. GUILE_INIT_SEGMENT_SIZE_2, GUILE_MIN_YIELD_2
  4697. (See entry "Way for application to customize GC parameters" under
  4698. section "Changes to the scm_ interface" below.)
  4699. ** Guile now implements reals using 4-word cells
  4700. This speeds up computation with reals. (They were earlier allocated
  4701. with `malloc'.) There is still some room for optimizations, however.
  4702. ** Some further steps toward POSIX thread support have been taken
  4703. *** Guile's critical sections (SCM_DEFER/ALLOW_INTS)
  4704. don't have much effect any longer, and many of them will be removed in
  4705. next release.
  4706. *** Signals
  4707. are only handled at the top of the evaluator loop, immediately after
  4708. I/O, and in scm_equalp.
  4709. *** The GC can allocate thread private pools of pairs.
  4710. * Changes to Scheme functions and syntax
  4711. ** close-input-port and close-output-port are now R5RS
  4712. These procedures have been turned into primitives and have R5RS behaviour.
  4713. ** New procedure: simple-format PORT MESSAGE ARG1 ...
  4714. (ice-9 boot) makes `format' an alias for `simple-format' until possibly
  4715. extended by the more sophisticated version in (ice-9 format)
  4716. (simple-format port message . args)
  4717. Write MESSAGE to DESTINATION, defaulting to `current-output-port'.
  4718. MESSAGE can contain ~A (was %s) and ~S (was %S) escapes. When printed,
  4719. the escapes are replaced with corresponding members of ARGS:
  4720. ~A formats using `display' and ~S formats using `write'.
  4721. If DESTINATION is #t, then use the `current-output-port',
  4722. if DESTINATION is #f, then return a string containing the formatted text.
  4723. Does not add a trailing newline."
  4724. ** string-ref: the second argument is no longer optional.
  4725. ** string, list->string: no longer accept strings in their arguments,
  4726. only characters, for compatibility with R5RS.
  4727. ** New procedure: port-closed? PORT
  4728. Returns #t if PORT is closed or #f if it is open.
  4729. ** Deprecated: list*
  4730. The list* functionality is now provided by cons* (SRFI-1 compliant)
  4731. ** New procedure: cons* ARG1 ARG2 ... ARGn
  4732. Like `list', but the last arg provides the tail of the constructed list,
  4733. returning (cons ARG1 (cons ARG2 (cons ... ARGn))).
  4734. Requires at least one argument. If given one argument, that argument
  4735. is returned as result.
  4736. This function is called `list*' in some other Schemes and in Common LISP.
  4737. ** Removed deprecated: serial-map, serial-array-copy!, serial-array-map!
  4738. ** New procedure: object-documentation OBJECT
  4739. Returns the documentation string associated with OBJECT. The
  4740. procedure uses a caching mechanism so that subsequent lookups are
  4741. faster.
  4742. Exported by (ice-9 documentation).
  4743. ** module-name now returns full names of modules
  4744. Previously, only the last part of the name was returned (`session' for
  4745. `(ice-9 session)'). Ex: `(ice-9 session)'.
  4746. * Changes to the gh_ interface
  4747. ** Deprecated: gh_int2scmb
  4748. Use gh_bool2scm instead.
  4749. * Changes to the scm_ interface
  4750. ** Guile primitives now carry docstrings!
  4751. Thanks to Greg Badros!
  4752. ** Guile primitives are defined in a new way: SCM_DEFINE/SCM_DEFINE1/SCM_PROC
  4753. Now Guile primitives are defined using the SCM_DEFINE/SCM_DEFINE1/SCM_PROC
  4754. macros and must contain a docstring that is extracted into foo.doc using a new
  4755. guile-doc-snarf script (that uses guile-doc-snarf.awk).
  4756. However, a major overhaul of these macros is scheduled for the next release of
  4757. guile.
  4758. ** Guile primitives use a new technique for validation of arguments
  4759. SCM_VALIDATE_* macros are defined to ease the redundancy and improve
  4760. the readability of argument checking.
  4761. ** All (nearly?) K&R prototypes for functions replaced with ANSI C equivalents.
  4762. ** New macros: SCM_PACK, SCM_UNPACK
  4763. Compose/decompose an SCM value.
  4764. The SCM type is now treated as an abstract data type and may be defined as a
  4765. long, a void* or as a struct, depending on the architecture and compile time
  4766. options. This makes it easier to find several types of bugs, for example when
  4767. SCM values are treated as integers without conversion. Values of the SCM type
  4768. should be treated as "atomic" values. These macros are used when
  4769. composing/decomposing an SCM value, either because you want to access
  4770. individual bits, or because you want to treat it as an integer value.
  4771. E.g., in order to set bit 7 in an SCM value x, use the expression
  4772. SCM_PACK (SCM_UNPACK (x) | 0x80)
  4773. ** The name property of hooks is deprecated.
  4774. Thus, the use of SCM_HOOK_NAME and scm_make_hook_with_name is deprecated.
  4775. You can emulate this feature by using object properties.
  4776. ** Deprecated macros: SCM_INPORTP, SCM_OUTPORTP, SCM_CRDY, SCM_ICHRP,
  4777. SCM_ICHR, SCM_MAKICHR, SCM_SETJMPBUF, SCM_NSTRINGP, SCM_NRWSTRINGP,
  4778. SCM_NVECTORP
  4779. These macros will be removed in a future release of Guile.
  4780. ** The following types, functions and macros from numbers.h are deprecated:
  4781. scm_dblproc, SCM_UNEGFIXABLE, SCM_FLOBUFLEN, SCM_INEXP, SCM_CPLXP, SCM_REAL,
  4782. SCM_IMAG, SCM_REALPART, scm_makdbl, SCM_SINGP, SCM_NUM2DBL, SCM_NO_BIGDIG
  4783. ** Port internals: the rw_random variable in the scm_port structure
  4784. must be set to non-zero in any random access port. In recent Guile
  4785. releases it was only set for bidirectional random-access ports.
  4786. ** Port internals: the seek ptob procedure is now responsible for
  4787. resetting the buffers if required. The change was made so that in the
  4788. special case of reading the current position (i.e., seek p 0 SEEK_CUR)
  4789. the fport and strport ptobs can avoid resetting the buffers,
  4790. in particular to avoid discarding unread chars. An existing port
  4791. type can be fixed by adding something like the following to the
  4792. beginning of the ptob seek procedure:
  4793. if (pt->rw_active == SCM_PORT_READ)
  4794. scm_end_input (object);
  4795. else if (pt->rw_active == SCM_PORT_WRITE)
  4796. ptob->flush (object);
  4797. although to actually avoid resetting the buffers and discard unread
  4798. chars requires further hacking that depends on the characteristics
  4799. of the ptob.
  4800. ** Deprecated functions: scm_fseek, scm_tag
  4801. These functions are no longer used and will be removed in a future version.
  4802. ** The scm_sysmissing procedure is no longer used in libguile.
  4803. Unless it turns out to be unexpectedly useful to somebody, it will be
  4804. removed in a future version.
  4805. ** The format of error message strings has changed
  4806. The two C procedures: scm_display_error and scm_error, as well as the
  4807. primitive `scm-error', now use scm_simple_format to do their work.
  4808. This means that the message strings of all code must be updated to use
  4809. ~A where %s was used before, and ~S where %S was used before.
  4810. During the period when there still are a lot of old Guiles out there,
  4811. you might want to support both old and new versions of Guile.
  4812. There are basically two methods to achieve this. Both methods use
  4813. autoconf. Put
  4814. AC_CHECK_FUNCS(scm_simple_format)
  4815. in your configure.in.
  4816. Method 1: Use the string concatenation features of ANSI C's
  4817. preprocessor.
  4818. In C:
  4819. #ifdef HAVE_SCM_SIMPLE_FORMAT
  4820. #define FMT_S "~S"
  4821. #else
  4822. #define FMT_S "%S"
  4823. #endif
  4824. Then represent each of your error messages using a preprocessor macro:
  4825. #define E_SPIDER_ERROR "There's a spider in your " ## FMT_S ## "!!!"
  4826. In Scheme:
  4827. (define fmt-s (if (defined? 'simple-format) "~S" "%S"))
  4828. (define make-message string-append)
  4829. (define e-spider-error (make-message "There's a spider in your " fmt-s "!!!"))
  4830. Method 2: Use the oldfmt function found in doc/oldfmt.c.
  4831. In C:
  4832. scm_misc_error ("picnic", scm_c_oldfmt0 ("There's a spider in your ~S!!!"),
  4833. ...);
  4834. In Scheme:
  4835. (scm-error 'misc-error "picnic" (oldfmt "There's a spider in your ~S!!!")
  4836. ...)
  4837. ** Deprecated: coop_mutex_init, coop_condition_variable_init
  4838. Don't use the functions coop_mutex_init and
  4839. coop_condition_variable_init. They will change.
  4840. Use scm_mutex_init and scm_cond_init instead.
  4841. ** New function: int scm_cond_timedwait (scm_cond_t *COND, scm_mutex_t *MUTEX, const struct timespec *ABSTIME)
  4842. `scm_cond_timedwait' atomically unlocks MUTEX and waits on
  4843. COND, as `scm_cond_wait' does, but it also bounds the duration
  4844. of the wait. If COND has not been signaled before time ABSTIME,
  4845. the mutex MUTEX is re-acquired and `scm_cond_timedwait'
  4846. returns the error code `ETIMEDOUT'.
  4847. The ABSTIME parameter specifies an absolute time, with the same
  4848. origin as `time' and `gettimeofday': an ABSTIME of 0 corresponds
  4849. to 00:00:00 GMT, January 1, 1970.
  4850. ** New function: scm_cond_broadcast (scm_cond_t *COND)
  4851. `scm_cond_broadcast' restarts all the threads that are waiting
  4852. on the condition variable COND. Nothing happens if no threads are
  4853. waiting on COND.
  4854. ** New function: scm_key_create (scm_key_t *KEY, void (*destr_function) (void *))
  4855. `scm_key_create' allocates a new TSD key. The key is stored in
  4856. the location pointed to by KEY. There is no limit on the number
  4857. of keys allocated at a given time. The value initially associated
  4858. with the returned key is `NULL' in all currently executing threads.
  4859. The DESTR_FUNCTION argument, if not `NULL', specifies a destructor
  4860. function associated with the key. When a thread terminates,
  4861. DESTR_FUNCTION is called on the value associated with the key in
  4862. that thread. The DESTR_FUNCTION is not called if a key is deleted
  4863. with `scm_key_delete' or a value is changed with
  4864. `scm_setspecific'. The order in which destructor functions are
  4865. called at thread termination time is unspecified.
  4866. Destructors are not yet implemented.
  4867. ** New function: scm_setspecific (scm_key_t KEY, const void *POINTER)
  4868. `scm_setspecific' changes the value associated with KEY in the
  4869. calling thread, storing the given POINTER instead.
  4870. ** New function: scm_getspecific (scm_key_t KEY)
  4871. `scm_getspecific' returns the value currently associated with
  4872. KEY in the calling thread.
  4873. ** New function: scm_key_delete (scm_key_t KEY)
  4874. `scm_key_delete' deallocates a TSD key. It does not check
  4875. whether non-`NULL' values are associated with that key in the
  4876. currently executing threads, nor call the destructor function
  4877. associated with the key.
  4878. ** New function: scm_c_hook_init (scm_c_hook_t *HOOK, void *HOOK_DATA, scm_c_hook_type_t TYPE)
  4879. Initialize a C level hook HOOK with associated HOOK_DATA and type
  4880. TYPE. (See scm_c_hook_run ().)
  4881. ** New function: scm_c_hook_add (scm_c_hook_t *HOOK, scm_c_hook_function_t FUNC, void *FUNC_DATA, int APPENDP)
  4882. Add hook function FUNC with associated FUNC_DATA to HOOK. If APPENDP
  4883. is true, add it last, otherwise first. The same FUNC can be added
  4884. multiple times if FUNC_DATA differ and vice versa.
  4885. ** New function: scm_c_hook_remove (scm_c_hook_t *HOOK, scm_c_hook_function_t FUNC, void *FUNC_DATA)
  4886. Remove hook function FUNC with associated FUNC_DATA from HOOK. A
  4887. function is only removed if both FUNC and FUNC_DATA matches.
  4888. ** New function: void *scm_c_hook_run (scm_c_hook_t *HOOK, void *DATA)
  4889. Run hook HOOK passing DATA to the hook functions.
  4890. If TYPE is SCM_C_HOOK_NORMAL, all hook functions are run. The value
  4891. returned is undefined.
  4892. If TYPE is SCM_C_HOOK_OR, hook functions are run until a function
  4893. returns a non-NULL value. This value is returned as the result of
  4894. scm_c_hook_run. If all functions return NULL, NULL is returned.
  4895. If TYPE is SCM_C_HOOK_AND, hook functions are run until a function
  4896. returns a NULL value, and NULL is returned. If all functions returns
  4897. a non-NULL value, the last value is returned.
  4898. ** New C level GC hooks
  4899. Five new C level hooks has been added to the garbage collector.
  4900. scm_before_gc_c_hook
  4901. scm_after_gc_c_hook
  4902. are run before locking and after unlocking the heap. The system is
  4903. thus in a mode where evaluation can take place. (Except that
  4904. scm_before_gc_c_hook must not allocate new cells.)
  4905. scm_before_mark_c_hook
  4906. scm_before_sweep_c_hook
  4907. scm_after_sweep_c_hook
  4908. are run when the heap is locked. These are intended for extension of
  4909. the GC in a modular fashion. Examples are the weaks and guardians
  4910. modules.
  4911. ** Way for application to customize GC parameters
  4912. The application can set up other default values for the GC heap
  4913. allocation parameters
  4914. GUILE_INIT_HEAP_SIZE_1, GUILE_MIN_YIELD_1,
  4915. GUILE_INIT_HEAP_SIZE_2, GUILE_MIN_YIELD_2,
  4916. GUILE_MAX_SEGMENT_SIZE,
  4917. by setting
  4918. scm_default_init_heap_size_1, scm_default_min_yield_1,
  4919. scm_default_init_heap_size_2, scm_default_min_yield_2,
  4920. scm_default_max_segment_size
  4921. respectively before callong scm_boot_guile.
  4922. (See entry "New environment variables ..." in section
  4923. "Changes to the stand-alone interpreter" above.)
  4924. ** scm_protect_object/scm_unprotect_object now nest
  4925. This means that you can call scm_protect_object multiple times on an
  4926. object and count on the object being protected until
  4927. scm_unprotect_object has been call the same number of times.
  4928. The functions also have better time complexity.
  4929. Still, it is usually possible to structure the application in a way
  4930. that you don't need to use these functions. For example, if you use a
  4931. protected standard Guile list to keep track of live objects rather
  4932. than some custom data type, objects will die a natural death when they
  4933. are no longer needed.
  4934. ** Deprecated type tags: scm_tc16_flo, scm_tc_flo, scm_tc_dblr, scm_tc_dblc
  4935. Guile does not provide the float representation for inexact real numbers any
  4936. more. Now, only doubles are used to represent inexact real numbers. Further,
  4937. the tag names scm_tc_dblr and scm_tc_dblc have been changed to scm_tc16_real
  4938. and scm_tc16_complex, respectively.
  4939. ** Removed deprecated type scm_smobfuns
  4940. ** Removed deprecated function scm_newsmob
  4941. ** Warning: scm_make_smob_type_mfpe might become deprecated in a future release
  4942. There is an ongoing discussion among the developers whether to
  4943. deprecate `scm_make_smob_type_mfpe' or not. Please use the current
  4944. standard interface (scm_make_smob_type, scm_set_smob_XXX) in new code
  4945. until this issue has been settled.
  4946. ** Removed deprecated type tag scm_tc16_kw
  4947. ** Added type tag scm_tc16_keyword
  4948. (This was introduced already in release 1.3.4 but was not documented
  4949. until now.)
  4950. ** gdb_print now prints "*** Guile not initialized ***" until Guile initialized
  4951. * Changes to system call interfaces:
  4952. ** The "select" procedure now tests port buffers for the ability to
  4953. provide input or accept output. Previously only the underlying file
  4954. descriptors were checked.
  4955. ** New variable PIPE_BUF: the maximum number of bytes that can be
  4956. atomically written to a pipe.
  4957. ** If a facility is not available on the system when Guile is
  4958. compiled, the corresponding primitive procedure will not be defined.
  4959. Previously it would have been defined but would throw a system-error
  4960. exception if called. Exception handlers which catch this case may
  4961. need minor modification: an error will be thrown with key
  4962. 'unbound-variable instead of 'system-error. Alternatively it's
  4963. now possible to use `defined?' to check whether the facility is
  4964. available.
  4965. ** Procedures which depend on the timezone should now give the correct
  4966. result on systems which cache the TZ environment variable, even if TZ
  4967. is changed without calling tzset.
  4968. * Changes to the networking interfaces:
  4969. ** New functions: htons, ntohs, htonl, ntohl: for converting short and
  4970. long integers between network and host format. For now, it's not
  4971. particularly convenient to do this kind of thing, but consider:
  4972. (define write-network-long
  4973. (lambda (value port)
  4974. (let ((v (make-uniform-vector 1 1 0)))
  4975. (uniform-vector-set! v 0 (htonl value))
  4976. (uniform-vector-write v port))))
  4977. (define read-network-long
  4978. (lambda (port)
  4979. (let ((v (make-uniform-vector 1 1 0)))
  4980. (uniform-vector-read! v port)
  4981. (ntohl (uniform-vector-ref v 0)))))
  4982. ** If inet-aton fails, it now throws an error with key 'misc-error
  4983. instead of 'system-error, since errno is not relevant.
  4984. ** Certain gethostbyname/gethostbyaddr failures now throw errors with
  4985. specific keys instead of 'system-error. The latter is inappropriate
  4986. since errno will not have been set. The keys are:
  4987. 'host-not-found, 'try-again, 'no-recovery and 'no-data.
  4988. ** sethostent, setnetent, setprotoent, setservent: now take an
  4989. optional argument STAYOPEN, which specifies whether the database
  4990. remains open after a database entry is accessed randomly (e.g., using
  4991. gethostbyname for the hosts database.) The default is #f. Previously
  4992. #t was always used.
  4993. Changes since Guile 1.3.2:
  4994. * Changes to the stand-alone interpreter
  4995. ** Debugger
  4996. An initial version of the Guile debugger written by Chris Hanson has
  4997. been added. The debugger is still under development but is included
  4998. in the distribution anyway since it is already quite useful.
  4999. Type
  5000. (debug)
  5001. after an error to enter the debugger. Type `help' inside the debugger
  5002. for a description of available commands.
  5003. If you prefer to have stack frames numbered and printed in
  5004. anti-chronological order and prefer up in the stack to be down on the
  5005. screen as is the case in gdb, you can put
  5006. (debug-enable 'backwards)
  5007. in your .guile startup file. (However, this means that Guile can't
  5008. use indentation to indicate stack level.)
  5009. The debugger is autoloaded into Guile at the first use.
  5010. ** Further enhancements to backtraces
  5011. There is a new debug option `width' which controls the maximum width
  5012. on the screen of printed stack frames. Fancy printing parameters
  5013. ("level" and "length" as in Common LISP) are adaptively adjusted for
  5014. each stack frame to give maximum information while still fitting
  5015. within the bounds. If the stack frame can't be made to fit by
  5016. adjusting parameters, it is simply cut off at the end. This is marked
  5017. with a `$'.
  5018. ** Some modules are now only loaded when the repl is started
  5019. The modules (ice-9 debug), (ice-9 session), (ice-9 threads) and (ice-9
  5020. regex) are now loaded into (guile-user) only if the repl has been
  5021. started. The effect is that the startup time for scripts has been
  5022. reduced to 30% of what it was previously.
  5023. Correctly written scripts load the modules they require at the top of
  5024. the file and should not be affected by this change.
  5025. ** Hooks are now represented as smobs
  5026. * Changes to Scheme functions and syntax
  5027. ** Readline support has changed again.
  5028. The old (readline-activator) module is gone. Use (ice-9 readline)
  5029. instead, which now contains all readline functionality. So the code
  5030. to activate readline is now
  5031. (use-modules (ice-9 readline))
  5032. (activate-readline)
  5033. This should work at any time, including from the guile prompt.
  5034. To avoid confusion about the terms of Guile's license, please only
  5035. enable readline for your personal use; please don't make it the
  5036. default for others. Here is why we make this rather odd-sounding
  5037. request:
  5038. Guile is normally licensed under a weakened form of the GNU General
  5039. Public License, which allows you to link code with Guile without
  5040. placing that code under the GPL. This exception is important to some
  5041. people.
  5042. However, since readline is distributed under the GNU General Public
  5043. License, when you link Guile with readline, either statically or
  5044. dynamically, you effectively change Guile's license to the strict GPL.
  5045. Whenever you link any strictly GPL'd code into Guile, uses of Guile
  5046. which are normally permitted become forbidden. This is a rather
  5047. non-obvious consequence of the licensing terms.
  5048. So, to make sure things remain clear, please let people choose for
  5049. themselves whether to link GPL'd libraries like readline with Guile.
  5050. ** regexp-substitute/global has changed slightly, but incompatibly.
  5051. If you include a function in the item list, the string of the match
  5052. object it receives is the same string passed to
  5053. regexp-substitute/global, not some suffix of that string.
  5054. Correspondingly, the match's positions are relative to the entire
  5055. string, not the suffix.
  5056. If the regexp can match the empty string, the way matches are chosen
  5057. from the string has changed. regexp-substitute/global recognizes the
  5058. same set of matches that list-matches does; see below.
  5059. ** New function: list-matches REGEXP STRING [FLAGS]
  5060. Return a list of match objects, one for every non-overlapping, maximal
  5061. match of REGEXP in STRING. The matches appear in left-to-right order.
  5062. list-matches only reports matches of the empty string if there are no
  5063. other matches which begin on, end at, or include the empty match's
  5064. position.
  5065. If present, FLAGS is passed as the FLAGS argument to regexp-exec.
  5066. ** New function: fold-matches REGEXP STRING INIT PROC [FLAGS]
  5067. For each match of REGEXP in STRING, apply PROC to the match object,
  5068. and the last value PROC returned, or INIT for the first call. Return
  5069. the last value returned by PROC. We apply PROC to the matches as they
  5070. appear from left to right.
  5071. This function recognizes matches according to the same criteria as
  5072. list-matches.
  5073. Thus, you could define list-matches like this:
  5074. (define (list-matches regexp string . flags)
  5075. (reverse! (apply fold-matches regexp string '() cons flags)))
  5076. If present, FLAGS is passed as the FLAGS argument to regexp-exec.
  5077. ** Hooks
  5078. *** New function: hook? OBJ
  5079. Return #t if OBJ is a hook, otherwise #f.
  5080. *** New function: make-hook-with-name NAME [ARITY]
  5081. Return a hook with name NAME and arity ARITY. The default value for
  5082. ARITY is 0. The only effect of NAME is that it will appear when the
  5083. hook object is printed to ease debugging.
  5084. *** New function: hook-empty? HOOK
  5085. Return #t if HOOK doesn't contain any procedures, otherwise #f.
  5086. *** New function: hook->list HOOK
  5087. Return a list of the procedures that are called when run-hook is
  5088. applied to HOOK.
  5089. ** `map' signals an error if its argument lists are not all the same length.
  5090. This is the behavior required by R5RS, so this change is really a bug
  5091. fix. But it seems to affect a lot of people's code, so we're
  5092. mentioning it here anyway.
  5093. ** Print-state handling has been made more transparent
  5094. Under certain circumstances, ports are represented as a port with an
  5095. associated print state. Earlier, this pair was represented as a pair
  5096. (see "Some magic has been added to the printer" below). It is now
  5097. indistinguishable (almost; see `get-print-state') from a port on the
  5098. user level.
  5099. *** New function: port-with-print-state OUTPUT-PORT PRINT-STATE
  5100. Return a new port with the associated print state PRINT-STATE.
  5101. *** New function: get-print-state OUTPUT-PORT
  5102. Return the print state associated with this port if it exists,
  5103. otherwise return #f.
  5104. *** New function: directory-stream? OBJECT
  5105. Returns true iff OBJECT is a directory stream --- the sort of object
  5106. returned by `opendir'.
  5107. ** New function: using-readline?
  5108. Return #t if readline is in use in the current repl.
  5109. ** structs will be removed in 1.4
  5110. Structs will be replaced in Guile 1.4. We will merge GOOPS into Guile
  5111. and use GOOPS objects as the fundamental record type.
  5112. * Changes to the scm_ interface
  5113. ** structs will be removed in 1.4
  5114. The entire current struct interface (struct.c, struct.h) will be
  5115. replaced in Guile 1.4. We will merge GOOPS into libguile and use
  5116. GOOPS objects as the fundamental record type.
  5117. ** The internal representation of subr's has changed
  5118. Instead of giving a hint to the subr name, the CAR field of the subr
  5119. now contains an index to a subr entry in scm_subr_table.
  5120. *** New variable: scm_subr_table
  5121. An array of subr entries. A subr entry contains the name, properties
  5122. and documentation associated with the subr. The properties and
  5123. documentation slots are not yet used.
  5124. ** A new scheme for "forwarding" calls to a builtin to a generic function
  5125. It is now possible to extend the functionality of some Guile
  5126. primitives by letting them defer a call to a GOOPS generic function on
  5127. argument mismatch. This means that there is no loss of efficiency in
  5128. normal evaluation.
  5129. Example:
  5130. (use-modules (oop goops)) ; Must be GOOPS version 0.2.
  5131. (define-method + ((x <string>) (y <string>))
  5132. (string-append x y))
  5133. + will still be as efficient as usual in numerical calculations, but
  5134. can also be used for concatenating strings.
  5135. Who will be the first one to extend Guile's numerical tower to
  5136. rationals? :) [OK, there a few other things to fix before this can
  5137. be made in a clean way.]
  5138. *** New snarf macros for defining primitives: SCM_GPROC, SCM_GPROC1
  5139. New macro: SCM_GPROC (CNAME, SNAME, REQ, OPT, VAR, CFUNC, GENERIC)
  5140. New macro: SCM_GPROC1 (CNAME, SNAME, TYPE, CFUNC, GENERIC)
  5141. These do the same job as SCM_PROC and SCM_PROC1, but they also define
  5142. a variable GENERIC which can be used by the dispatch macros below.
  5143. [This is experimental code which may change soon.]
  5144. *** New macros for forwarding control to a generic on arg type error
  5145. New macro: SCM_WTA_DISPATCH_1 (GENERIC, ARG1, POS, SUBR)
  5146. New macro: SCM_WTA_DISPATCH_2 (GENERIC, ARG1, ARG2, POS, SUBR)
  5147. These correspond to the scm_wta function call, and have the same
  5148. behaviour until the user has called the GOOPS primitive
  5149. `enable-primitive-generic!'. After that, these macros will apply the
  5150. generic function GENERIC to the argument(s) instead of calling
  5151. scm_wta.
  5152. [This is experimental code which may change soon.]
  5153. *** New macros for argument testing with generic dispatch
  5154. New macro: SCM_GASSERT1 (COND, GENERIC, ARG1, POS, SUBR)
  5155. New macro: SCM_GASSERT2 (COND, GENERIC, ARG1, ARG2, POS, SUBR)
  5156. These correspond to the SCM_ASSERT macro, but will defer control to
  5157. GENERIC on error after `enable-primitive-generic!' has been called.
  5158. [This is experimental code which may change soon.]
  5159. ** New function: SCM scm_eval_body (SCM body, SCM env)
  5160. Evaluates the body of a special form.
  5161. ** The internal representation of struct's has changed
  5162. Previously, four slots were allocated for the procedure(s) of entities
  5163. and operators. The motivation for this representation had to do with
  5164. the structure of the evaluator, the wish to support tail-recursive
  5165. generic functions, and efficiency. Since the generic function
  5166. dispatch mechanism has changed, there is no longer a need for such an
  5167. expensive representation, and the representation has been simplified.
  5168. This should not make any difference for most users.
  5169. ** GOOPS support has been cleaned up.
  5170. Some code has been moved from eval.c to objects.c and code in both of
  5171. these compilation units has been cleaned up and better structured.
  5172. *** New functions for applying generic functions
  5173. New function: SCM scm_apply_generic (GENERIC, ARGS)
  5174. New function: SCM scm_call_generic_0 (GENERIC)
  5175. New function: SCM scm_call_generic_1 (GENERIC, ARG1)
  5176. New function: SCM scm_call_generic_2 (GENERIC, ARG1, ARG2)
  5177. New function: SCM scm_call_generic_3 (GENERIC, ARG1, ARG2, ARG3)
  5178. ** Deprecated function: scm_make_named_hook
  5179. It is now replaced by:
  5180. ** New function: SCM scm_create_hook (const char *name, int arity)
  5181. Creates a hook in the same way as make-hook above but also
  5182. binds a variable named NAME to it.
  5183. This is the typical way of creating a hook from C code.
  5184. Currently, the variable is created in the "current" module.
  5185. This might change when we get the new module system.
  5186. [The behaviour is identical to scm_make_named_hook.]
  5187. Changes since Guile 1.3:
  5188. * Changes to mailing lists
  5189. ** Some of the Guile mailing lists have moved to sourceware.cygnus.com.
  5190. See the README file to find current addresses for all the Guile
  5191. mailing lists.
  5192. * Changes to the distribution
  5193. ** Readline support is no longer included with Guile by default.
  5194. Based on the different license terms of Guile and Readline, we
  5195. concluded that Guile should not *by default* cause the linking of
  5196. Readline into an application program. Readline support is now offered
  5197. as a separate module, which is linked into an application only when
  5198. you explicitly specify it.
  5199. Although Guile is GNU software, its distribution terms add a special
  5200. exception to the usual GNU General Public License (GPL). Guile's
  5201. license includes a clause that allows you to link Guile with non-free
  5202. programs. We add this exception so as not to put Guile at a
  5203. disadvantage vis-a-vis other extensibility packages that support other
  5204. languages.
  5205. In contrast, the GNU Readline library is distributed under the GNU
  5206. General Public License pure and simple. This means that you may not
  5207. link Readline, even dynamically, into an application unless it is
  5208. distributed under a free software license that is compatible the GPL.
  5209. Because of this difference in distribution terms, an application that
  5210. can use Guile may not be able to use Readline. Now users will be
  5211. explicitly offered two independent decisions about the use of these
  5212. two packages.
  5213. You can activate the readline support by issuing
  5214. (use-modules (readline-activator))
  5215. (activate-readline)
  5216. from your ".guile" file, for example.
  5217. * Changes to the stand-alone interpreter
  5218. ** All builtins now print as primitives.
  5219. Previously builtin procedures not belonging to the fundamental subr
  5220. types printed as #<compiled closure #<primitive-procedure gsubr-apply>>.
  5221. Now, they print as #<primitive-procedure NAME>.
  5222. ** Backtraces slightly more intelligible.
  5223. gsubr-apply and macro transformer application frames no longer appear
  5224. in backtraces.
  5225. * Changes to Scheme functions and syntax
  5226. ** Guile now correctly handles internal defines by rewriting them into
  5227. their equivalent letrec. Previously, internal defines would
  5228. incrementally add to the innermost environment, without checking
  5229. whether the restrictions specified in RnRS were met. This lead to the
  5230. correct behaviour when these restriction actually were met, but didn't
  5231. catch all illegal uses. Such an illegal use could lead to crashes of
  5232. the Guile interpreter or other unwanted results. An example of
  5233. incorrect internal defines that made Guile behave erratically:
  5234. (let ()
  5235. (define a 1)
  5236. (define (b) a)
  5237. (define c (1+ (b)))
  5238. (define d 3)
  5239. (b))
  5240. => 2
  5241. The problem with this example is that the definition of `c' uses the
  5242. value of `b' directly. This confuses the meoization machine of Guile
  5243. so that the second call of `b' (this time in a larger environment that
  5244. also contains bindings for `c' and `d') refers to the binding of `c'
  5245. instead of `a'. You could also make Guile crash with a variation on
  5246. this theme:
  5247. (define (foo flag)
  5248. (define a 1)
  5249. (define (b flag) (if flag a 1))
  5250. (define c (1+ (b flag)))
  5251. (define d 3)
  5252. (b #t))
  5253. (foo #f)
  5254. (foo #t)
  5255. From now on, Guile will issue an `Unbound variable: b' error message
  5256. for both examples.
  5257. ** Hooks
  5258. A hook contains a list of functions which should be called on
  5259. particular occasions in an existing program. Hooks are used for
  5260. customization.
  5261. A window manager might have a hook before-window-map-hook. The window
  5262. manager uses the function run-hooks to call all functions stored in
  5263. before-window-map-hook each time a window is mapped. The user can
  5264. store functions in the hook using add-hook!.
  5265. In Guile, hooks are first class objects.
  5266. *** New function: make-hook [N_ARGS]
  5267. Return a hook for hook functions which can take N_ARGS arguments.
  5268. The default value for N_ARGS is 0.
  5269. (See also scm_make_named_hook below.)
  5270. *** New function: add-hook! HOOK PROC [APPEND_P]
  5271. Put PROC at the beginning of the list of functions stored in HOOK.
  5272. If APPEND_P is supplied, and non-false, put PROC at the end instead.
  5273. PROC must be able to take the number of arguments specified when the
  5274. hook was created.
  5275. If PROC already exists in HOOK, then remove it first.
  5276. *** New function: remove-hook! HOOK PROC
  5277. Remove PROC from the list of functions in HOOK.
  5278. *** New function: reset-hook! HOOK
  5279. Clear the list of hook functions stored in HOOK.
  5280. *** New function: run-hook HOOK ARG1 ...
  5281. Run all hook functions stored in HOOK with arguments ARG1 ... .
  5282. The number of arguments supplied must correspond to the number given
  5283. when the hook was created.
  5284. ** The function `dynamic-link' now takes optional keyword arguments.
  5285. The only keyword argument that is currently defined is `:global
  5286. BOOL'. With it, you can control whether the shared library will be
  5287. linked in global mode or not. In global mode, the symbols from the
  5288. linked library can be used to resolve references from other
  5289. dynamically linked libraries. In non-global mode, the linked
  5290. library is essentially invisible and can only be accessed via
  5291. `dynamic-func', etc. The default is now to link in global mode.
  5292. Previously, the default has been non-global mode.
  5293. The `#:global' keyword is only effective on platforms that support
  5294. the dlopen family of functions.
  5295. ** New function `provided?'
  5296. - Function: provided? FEATURE
  5297. Return true iff FEATURE is supported by this installation of
  5298. Guile. FEATURE must be a symbol naming a feature; the global
  5299. variable `*features*' is a list of available features.
  5300. ** Changes to the module (ice-9 expect):
  5301. *** The expect-strings macro now matches `$' in a regular expression
  5302. only at a line-break or end-of-file by default. Previously it would
  5303. match the end of the string accumulated so far. The old behaviour
  5304. can be obtained by setting the variable `expect-strings-exec-flags'
  5305. to 0.
  5306. *** The expect-strings macro now uses a variable `expect-strings-exec-flags'
  5307. for the regexp-exec flags. If `regexp/noteol' is included, then `$'
  5308. in a regular expression will still match before a line-break or
  5309. end-of-file. The default is `regexp/noteol'.
  5310. *** The expect-strings macro now uses a variable
  5311. `expect-strings-compile-flags' for the flags to be supplied to
  5312. `make-regexp'. The default is `regexp/newline', which was previously
  5313. hard-coded.
  5314. *** The expect macro now supplies two arguments to a match procedure:
  5315. the current accumulated string and a flag to indicate whether
  5316. end-of-file has been reached. Previously only the string was supplied.
  5317. If end-of-file is reached, the match procedure will be called an
  5318. additional time with the same accumulated string as the previous call
  5319. but with the flag set.
  5320. ** New module (ice-9 format), implementing the Common Lisp `format' function.
  5321. This code, and the documentation for it that appears here, was
  5322. borrowed from SLIB, with minor adaptations for Guile.
  5323. - Function: format DESTINATION FORMAT-STRING . ARGUMENTS
  5324. An almost complete implementation of Common LISP format description
  5325. according to the CL reference book `Common LISP' from Guy L.
  5326. Steele, Digital Press. Backward compatible to most of the
  5327. available Scheme format implementations.
  5328. Returns `#t', `#f' or a string; has side effect of printing
  5329. according to FORMAT-STRING. If DESTINATION is `#t', the output is
  5330. to the current output port and `#t' is returned. If DESTINATION
  5331. is `#f', a formatted string is returned as the result of the call.
  5332. NEW: If DESTINATION is a string, DESTINATION is regarded as the
  5333. format string; FORMAT-STRING is then the first argument and the
  5334. output is returned as a string. If DESTINATION is a number, the
  5335. output is to the current error port if available by the
  5336. implementation. Otherwise DESTINATION must be an output port and
  5337. `#t' is returned.
  5338. FORMAT-STRING must be a string. In case of a formatting error
  5339. format returns `#f' and prints a message on the current output or
  5340. error port. Characters are output as if the string were output by
  5341. the `display' function with the exception of those prefixed by a
  5342. tilde (~). For a detailed description of the FORMAT-STRING syntax
  5343. please consult a Common LISP format reference manual. For a test
  5344. suite to verify this format implementation load `formatst.scm'.
  5345. Please send bug reports to `lutzeb@cs.tu-berlin.de'.
  5346. Note: `format' is not reentrant, i.e. only one `format'-call may
  5347. be executed at a time.
  5348. *** Format Specification (Format version 3.0)
  5349. Please consult a Common LISP format reference manual for a detailed
  5350. description of the format string syntax. For a demonstration of the
  5351. implemented directives see `formatst.scm'.
  5352. This implementation supports directive parameters and modifiers (`:'
  5353. and `@' characters). Multiple parameters must be separated by a comma
  5354. (`,'). Parameters can be numerical parameters (positive or negative),
  5355. character parameters (prefixed by a quote character (`''), variable
  5356. parameters (`v'), number of rest arguments parameter (`#'), empty and
  5357. default parameters. Directive characters are case independent. The
  5358. general form of a directive is:
  5359. DIRECTIVE ::= ~{DIRECTIVE-PARAMETER,}[:][@]DIRECTIVE-CHARACTER
  5360. DIRECTIVE-PARAMETER ::= [ [-|+]{0-9}+ | 'CHARACTER | v | # ]
  5361. *** Implemented CL Format Control Directives
  5362. Documentation syntax: Uppercase characters represent the
  5363. corresponding control directive characters. Lowercase characters
  5364. represent control directive parameter descriptions.
  5365. `~A'
  5366. Any (print as `display' does).
  5367. `~@A'
  5368. left pad.
  5369. `~MINCOL,COLINC,MINPAD,PADCHARA'
  5370. full padding.
  5371. `~S'
  5372. S-expression (print as `write' does).
  5373. `~@S'
  5374. left pad.
  5375. `~MINCOL,COLINC,MINPAD,PADCHARS'
  5376. full padding.
  5377. `~D'
  5378. Decimal.
  5379. `~@D'
  5380. print number sign always.
  5381. `~:D'
  5382. print comma separated.
  5383. `~MINCOL,PADCHAR,COMMACHARD'
  5384. padding.
  5385. `~X'
  5386. Hexadecimal.
  5387. `~@X'
  5388. print number sign always.
  5389. `~:X'
  5390. print comma separated.
  5391. `~MINCOL,PADCHAR,COMMACHARX'
  5392. padding.
  5393. `~O'
  5394. Octal.
  5395. `~@O'
  5396. print number sign always.
  5397. `~:O'
  5398. print comma separated.
  5399. `~MINCOL,PADCHAR,COMMACHARO'
  5400. padding.
  5401. `~B'
  5402. Binary.
  5403. `~@B'
  5404. print number sign always.
  5405. `~:B'
  5406. print comma separated.
  5407. `~MINCOL,PADCHAR,COMMACHARB'
  5408. padding.
  5409. `~NR'
  5410. Radix N.
  5411. `~N,MINCOL,PADCHAR,COMMACHARR'
  5412. padding.
  5413. `~@R'
  5414. print a number as a Roman numeral.
  5415. `~:@R'
  5416. print a number as an "old fashioned" Roman numeral.
  5417. `~:R'
  5418. print a number as an ordinal English number.
  5419. `~:@R'
  5420. print a number as a cardinal English number.
  5421. `~P'
  5422. Plural.
  5423. `~@P'
  5424. prints `y' and `ies'.
  5425. `~:P'
  5426. as `~P but jumps 1 argument backward.'
  5427. `~:@P'
  5428. as `~@P but jumps 1 argument backward.'
  5429. `~C'
  5430. Character.
  5431. `~@C'
  5432. prints a character as the reader can understand it (i.e. `#\'
  5433. prefixing).
  5434. `~:C'
  5435. prints a character as emacs does (eg. `^C' for ASCII 03).
  5436. `~F'
  5437. Fixed-format floating-point (prints a flonum like MMM.NNN).
  5438. `~WIDTH,DIGITS,SCALE,OVERFLOWCHAR,PADCHARF'
  5439. `~@F'
  5440. If the number is positive a plus sign is printed.
  5441. `~E'
  5442. Exponential floating-point (prints a flonum like MMM.NNN`E'EE).
  5443. `~WIDTH,DIGITS,EXPONENTDIGITS,SCALE,OVERFLOWCHAR,PADCHAR,EXPONENTCHARE'
  5444. `~@E'
  5445. If the number is positive a plus sign is printed.
  5446. `~G'
  5447. General floating-point (prints a flonum either fixed or
  5448. exponential).
  5449. `~WIDTH,DIGITS,EXPONENTDIGITS,SCALE,OVERFLOWCHAR,PADCHAR,EXPONENTCHARG'
  5450. `~@G'
  5451. If the number is positive a plus sign is printed.
  5452. `~$'
  5453. Dollars floating-point (prints a flonum in fixed with signs
  5454. separated).
  5455. `~DIGITS,SCALE,WIDTH,PADCHAR$'
  5456. `~@$'
  5457. If the number is positive a plus sign is printed.
  5458. `~:@$'
  5459. A sign is always printed and appears before the padding.
  5460. `~:$'
  5461. The sign appears before the padding.
  5462. `~%'
  5463. Newline.
  5464. `~N%'
  5465. print N newlines.
  5466. `~&'
  5467. print newline if not at the beginning of the output line.
  5468. `~N&'
  5469. prints `~&' and then N-1 newlines.
  5470. `~|'
  5471. Page Separator.
  5472. `~N|'
  5473. print N page separators.
  5474. `~~'
  5475. Tilde.
  5476. `~N~'
  5477. print N tildes.
  5478. `~'<newline>
  5479. Continuation Line.
  5480. `~:'<newline>
  5481. newline is ignored, white space left.
  5482. `~@'<newline>
  5483. newline is left, white space ignored.
  5484. `~T'
  5485. Tabulation.
  5486. `~@T'
  5487. relative tabulation.
  5488. `~COLNUM,COLINCT'
  5489. full tabulation.
  5490. `~?'
  5491. Indirection (expects indirect arguments as a list).
  5492. `~@?'
  5493. extracts indirect arguments from format arguments.
  5494. `~(STR~)'
  5495. Case conversion (converts by `string-downcase').
  5496. `~:(STR~)'
  5497. converts by `string-capitalize'.
  5498. `~@(STR~)'
  5499. converts by `string-capitalize-first'.
  5500. `~:@(STR~)'
  5501. converts by `string-upcase'.
  5502. `~*'
  5503. Argument Jumping (jumps 1 argument forward).
  5504. `~N*'
  5505. jumps N arguments forward.
  5506. `~:*'
  5507. jumps 1 argument backward.
  5508. `~N:*'
  5509. jumps N arguments backward.
  5510. `~@*'
  5511. jumps to the 0th argument.
  5512. `~N@*'
  5513. jumps to the Nth argument (beginning from 0)
  5514. `~[STR0~;STR1~;...~;STRN~]'
  5515. Conditional Expression (numerical clause conditional).
  5516. `~N['
  5517. take argument from N.
  5518. `~@['
  5519. true test conditional.
  5520. `~:['
  5521. if-else-then conditional.
  5522. `~;'
  5523. clause separator.
  5524. `~:;'
  5525. default clause follows.
  5526. `~{STR~}'
  5527. Iteration (args come from the next argument (a list)).
  5528. `~N{'
  5529. at most N iterations.
  5530. `~:{'
  5531. args from next arg (a list of lists).
  5532. `~@{'
  5533. args from the rest of arguments.
  5534. `~:@{'
  5535. args from the rest args (lists).
  5536. `~^'
  5537. Up and out.
  5538. `~N^'
  5539. aborts if N = 0
  5540. `~N,M^'
  5541. aborts if N = M
  5542. `~N,M,K^'
  5543. aborts if N <= M <= K
  5544. *** Not Implemented CL Format Control Directives
  5545. `~:A'
  5546. print `#f' as an empty list (see below).
  5547. `~:S'
  5548. print `#f' as an empty list (see below).
  5549. `~<~>'
  5550. Justification.
  5551. `~:^'
  5552. (sorry I don't understand its semantics completely)
  5553. *** Extended, Replaced and Additional Control Directives
  5554. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHD'
  5555. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHX'
  5556. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHO'
  5557. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHB'
  5558. `~N,MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHR'
  5559. COMMAWIDTH is the number of characters between two comma
  5560. characters.
  5561. `~I'
  5562. print a R4RS complex number as `~F~@Fi' with passed parameters for
  5563. `~F'.
  5564. `~Y'
  5565. Pretty print formatting of an argument for scheme code lists.
  5566. `~K'
  5567. Same as `~?.'
  5568. `~!'
  5569. Flushes the output if format DESTINATION is a port.
  5570. `~_'
  5571. Print a `#\space' character
  5572. `~N_'
  5573. print N `#\space' characters.
  5574. `~/'
  5575. Print a `#\tab' character
  5576. `~N/'
  5577. print N `#\tab' characters.
  5578. `~NC'
  5579. Takes N as an integer representation for a character. No arguments
  5580. are consumed. N is converted to a character by `integer->char'. N
  5581. must be a positive decimal number.
  5582. `~:S'
  5583. Print out readproof. Prints out internal objects represented as
  5584. `#<...>' as strings `"#<...>"' so that the format output can always
  5585. be processed by `read'.
  5586. `~:A'
  5587. Print out readproof. Prints out internal objects represented as
  5588. `#<...>' as strings `"#<...>"' so that the format output can always
  5589. be processed by `read'.
  5590. `~Q'
  5591. Prints information and a copyright notice on the format
  5592. implementation.
  5593. `~:Q'
  5594. prints format version.
  5595. `~F, ~E, ~G, ~$'
  5596. may also print number strings, i.e. passing a number as a string
  5597. and format it accordingly.
  5598. *** Configuration Variables
  5599. The format module exports some configuration variables to suit the
  5600. systems and users needs. There should be no modification necessary for
  5601. the configuration that comes with Guile. Format detects automatically
  5602. if the running scheme system implements floating point numbers and
  5603. complex numbers.
  5604. format:symbol-case-conv
  5605. Symbols are converted by `symbol->string' so the case type of the
  5606. printed symbols is implementation dependent.
  5607. `format:symbol-case-conv' is a one arg closure which is either
  5608. `#f' (no conversion), `string-upcase', `string-downcase' or
  5609. `string-capitalize'. (default `#f')
  5610. format:iobj-case-conv
  5611. As FORMAT:SYMBOL-CASE-CONV but applies for the representation of
  5612. implementation internal objects. (default `#f')
  5613. format:expch
  5614. The character prefixing the exponent value in `~E' printing.
  5615. (default `#\E')
  5616. *** Compatibility With Other Format Implementations
  5617. SLIB format 2.x:
  5618. See `format.doc'.
  5619. SLIB format 1.4:
  5620. Downward compatible except for padding support and `~A', `~S',
  5621. `~P', `~X' uppercase printing. SLIB format 1.4 uses C-style
  5622. `printf' padding support which is completely replaced by the CL
  5623. `format' padding style.
  5624. MIT C-Scheme 7.1:
  5625. Downward compatible except for `~', which is not documented
  5626. (ignores all characters inside the format string up to a newline
  5627. character). (7.1 implements `~a', `~s', ~NEWLINE, `~~', `~%',
  5628. numerical and variable parameters and `:/@' modifiers in the CL
  5629. sense).
  5630. Elk 1.5/2.0:
  5631. Downward compatible except for `~A' and `~S' which print in
  5632. uppercase. (Elk implements `~a', `~s', `~~', and `~%' (no
  5633. directive parameters or modifiers)).
  5634. Scheme->C 01nov91:
  5635. Downward compatible except for an optional destination parameter:
  5636. S2C accepts a format call without a destination which returns a
  5637. formatted string. This is equivalent to a #f destination in S2C.
  5638. (S2C implements `~a', `~s', `~c', `~%', and `~~' (no directive
  5639. parameters or modifiers)).
  5640. ** Changes to string-handling functions.
  5641. These functions were added to support the (ice-9 format) module, above.
  5642. *** New function: string-upcase STRING
  5643. *** New function: string-downcase STRING
  5644. These are non-destructive versions of the existing string-upcase! and
  5645. string-downcase! functions.
  5646. *** New function: string-capitalize! STRING
  5647. *** New function: string-capitalize STRING
  5648. These functions convert the first letter of each word in the string to
  5649. upper case. Thus:
  5650. (string-capitalize "howdy there")
  5651. => "Howdy There"
  5652. As with the other functions, string-capitalize! modifies the string in
  5653. place, while string-capitalize returns a modified copy of its argument.
  5654. *** New function: string-ci->symbol STRING
  5655. Return a symbol whose name is STRING, but having the same case as if
  5656. the symbol had be read by `read'.
  5657. Guile can be configured to be sensitive or insensitive to case
  5658. differences in Scheme identifiers. If Guile is case-insensitive, all
  5659. symbols are converted to lower case on input. The `string-ci->symbol'
  5660. function returns a symbol whose name in STRING, transformed as Guile
  5661. would if STRING were input.
  5662. *** New function: substring-move! STRING1 START END STRING2 START
  5663. Copy the substring of STRING1 from START (inclusive) to END
  5664. (exclusive) to STRING2 at START. STRING1 and STRING2 may be the same
  5665. string, and the source and destination areas may overlap; in all
  5666. cases, the function behaves as if all the characters were copied
  5667. simultanously.
  5668. *** Extended functions: substring-move-left! substring-move-right!
  5669. These functions now correctly copy arbitrarily overlapping substrings;
  5670. they are both synonyms for substring-move!.
  5671. ** New module (ice-9 getopt-long), with the function `getopt-long'.
  5672. getopt-long is a function for parsing command-line arguments in a
  5673. manner consistent with other GNU programs.
  5674. (getopt-long ARGS GRAMMAR)
  5675. Parse the arguments ARGS according to the argument list grammar GRAMMAR.
  5676. ARGS should be a list of strings. Its first element should be the
  5677. name of the program; subsequent elements should be the arguments
  5678. that were passed to the program on the command line. The
  5679. `program-arguments' procedure returns a list of this form.
  5680. GRAMMAR is a list of the form:
  5681. ((OPTION (PROPERTY VALUE) ...) ...)
  5682. Each OPTION should be a symbol. `getopt-long' will accept a
  5683. command-line option named `--OPTION'.
  5684. Each option can have the following (PROPERTY VALUE) pairs:
  5685. (single-char CHAR) --- Accept `-CHAR' as a single-character
  5686. equivalent to `--OPTION'. This is how to specify traditional
  5687. Unix-style flags.
  5688. (required? BOOL) --- If BOOL is true, the option is required.
  5689. getopt-long will raise an error if it is not found in ARGS.
  5690. (value BOOL) --- If BOOL is #t, the option accepts a value; if
  5691. it is #f, it does not; and if it is the symbol
  5692. `optional', the option may appear in ARGS with or
  5693. without a value.
  5694. (predicate FUNC) --- If the option accepts a value (i.e. you
  5695. specified `(value #t)' for this option), then getopt
  5696. will apply FUNC to the value, and throw an exception
  5697. if it returns #f. FUNC should be a procedure which
  5698. accepts a string and returns a boolean value; you may
  5699. need to use quasiquotes to get it into GRAMMAR.
  5700. The (PROPERTY VALUE) pairs may occur in any order, but each
  5701. property may occur only once. By default, options do not have
  5702. single-character equivalents, are not required, and do not take
  5703. values.
  5704. In ARGS, single-character options may be combined, in the usual
  5705. Unix fashion: ("-x" "-y") is equivalent to ("-xy"). If an option
  5706. accepts values, then it must be the last option in the
  5707. combination; the value is the next argument. So, for example, using
  5708. the following grammar:
  5709. ((apples (single-char #\a))
  5710. (blimps (single-char #\b) (value #t))
  5711. (catalexis (single-char #\c) (value #t)))
  5712. the following argument lists would be acceptable:
  5713. ("-a" "-b" "bang" "-c" "couth") ("bang" and "couth" are the values
  5714. for "blimps" and "catalexis")
  5715. ("-ab" "bang" "-c" "couth") (same)
  5716. ("-ac" "couth" "-b" "bang") (same)
  5717. ("-abc" "couth" "bang") (an error, since `-b' is not the
  5718. last option in its combination)
  5719. If an option's value is optional, then `getopt-long' decides
  5720. whether it has a value by looking at what follows it in ARGS. If
  5721. the next element is a string, and it does not appear to be an
  5722. option itself, then that string is the option's value.
  5723. The value of a long option can appear as the next element in ARGS,
  5724. or it can follow the option name, separated by an `=' character.
  5725. Thus, using the same grammar as above, the following argument lists
  5726. are equivalent:
  5727. ("--apples" "Braeburn" "--blimps" "Goodyear")
  5728. ("--apples=Braeburn" "--blimps" "Goodyear")
  5729. ("--blimps" "Goodyear" "--apples=Braeburn")
  5730. If the option "--" appears in ARGS, argument parsing stops there;
  5731. subsequent arguments are returned as ordinary arguments, even if
  5732. they resemble options. So, in the argument list:
  5733. ("--apples" "Granny Smith" "--" "--blimp" "Goodyear")
  5734. `getopt-long' will recognize the `apples' option as having the
  5735. value "Granny Smith", but it will not recognize the `blimp'
  5736. option; it will return the strings "--blimp" and "Goodyear" as
  5737. ordinary argument strings.
  5738. The `getopt-long' function returns the parsed argument list as an
  5739. assocation list, mapping option names --- the symbols from GRAMMAR
  5740. --- onto their values, or #t if the option does not accept a value.
  5741. Unused options do not appear in the alist.
  5742. All arguments that are not the value of any option are returned
  5743. as a list, associated with the empty list.
  5744. `getopt-long' throws an exception if:
  5745. - it finds an unrecognized option in ARGS
  5746. - a required option is omitted
  5747. - an option that requires an argument doesn't get one
  5748. - an option that doesn't accept an argument does get one (this can
  5749. only happen using the long option `--opt=value' syntax)
  5750. - an option predicate fails
  5751. So, for example:
  5752. (define grammar
  5753. `((lockfile-dir (required? #t)
  5754. (value #t)
  5755. (single-char #\k)
  5756. (predicate ,file-is-directory?))
  5757. (verbose (required? #f)
  5758. (single-char #\v)
  5759. (value #f))
  5760. (x-includes (single-char #\x))
  5761. (rnet-server (single-char #\y)
  5762. (predicate ,string?))))
  5763. (getopt-long '("my-prog" "-vk" "/tmp" "foo1" "--x-includes=/usr/include"
  5764. "--rnet-server=lamprod" "--" "-fred" "foo2" "foo3")
  5765. grammar)
  5766. => ((() "foo1" "-fred" "foo2" "foo3")
  5767. (rnet-server . "lamprod")
  5768. (x-includes . "/usr/include")
  5769. (lockfile-dir . "/tmp")
  5770. (verbose . #t))
  5771. ** The (ice-9 getopt-gnu-style) module is obsolete; use (ice-9 getopt-long).
  5772. It will be removed in a few releases.
  5773. ** New syntax: lambda*
  5774. ** New syntax: define*
  5775. ** New syntax: define*-public
  5776. ** New syntax: defmacro*
  5777. ** New syntax: defmacro*-public
  5778. Guile now supports optional arguments.
  5779. `lambda*', `define*', `define*-public', `defmacro*' and
  5780. `defmacro*-public' are identical to the non-* versions except that
  5781. they use an extended type of parameter list that has the following BNF
  5782. syntax (parentheses are literal, square brackets indicate grouping,
  5783. and `*', `+' and `?' have the usual meaning):
  5784. ext-param-list ::= ( [identifier]* [#&optional [ext-var-decl]+]?
  5785. [#&key [ext-var-decl]+ [#&allow-other-keys]?]?
  5786. [[#&rest identifier]|[. identifier]]? ) | [identifier]
  5787. ext-var-decl ::= identifier | ( identifier expression )
  5788. The semantics are best illustrated with the following documentation
  5789. and examples for `lambda*':
  5790. lambda* args . body
  5791. lambda extended for optional and keyword arguments
  5792. lambda* creates a procedure that takes optional arguments. These
  5793. are specified by putting them inside brackets at the end of the
  5794. paramater list, but before any dotted rest argument. For example,
  5795. (lambda* (a b #&optional c d . e) '())
  5796. creates a procedure with fixed arguments a and b, optional arguments c
  5797. and d, and rest argument e. If the optional arguments are omitted
  5798. in a call, the variables for them are unbound in the procedure. This
  5799. can be checked with the bound? macro.
  5800. lambda* can also take keyword arguments. For example, a procedure
  5801. defined like this:
  5802. (lambda* (#&key xyzzy larch) '())
  5803. can be called with any of the argument lists (#:xyzzy 11)
  5804. (#:larch 13) (#:larch 42 #:xyzzy 19) (). Whichever arguments
  5805. are given as keywords are bound to values.
  5806. Optional and keyword arguments can also be given default values
  5807. which they take on when they are not present in a call, by giving a
  5808. two-item list in place of an optional argument, for example in:
  5809. (lambda* (foo #&optional (bar 42) #&key (baz 73)) (list foo bar baz))
  5810. foo is a fixed argument, bar is an optional argument with default
  5811. value 42, and baz is a keyword argument with default value 73.
  5812. Default value expressions are not evaluated unless they are needed
  5813. and until the procedure is called.
  5814. lambda* now supports two more special parameter list keywords.
  5815. lambda*-defined procedures now throw an error by default if a
  5816. keyword other than one of those specified is found in the actual
  5817. passed arguments. However, specifying #&allow-other-keys
  5818. immediately after the kyword argument declarations restores the
  5819. previous behavior of ignoring unknown keywords. lambda* also now
  5820. guarantees that if the same keyword is passed more than once, the
  5821. last one passed is the one that takes effect. For example,
  5822. ((lambda* (#&key (heads 0) (tails 0)) (display (list heads tails)))
  5823. #:heads 37 #:tails 42 #:heads 99)
  5824. would result in (99 47) being displayed.
  5825. #&rest is also now provided as a synonym for the dotted syntax rest
  5826. argument. The argument lists (a . b) and (a #&rest b) are equivalent in
  5827. all respects to lambda*. This is provided for more similarity to DSSSL,
  5828. MIT-Scheme and Kawa among others, as well as for refugees from other
  5829. Lisp dialects.
  5830. Further documentation may be found in the optargs.scm file itself.
  5831. The optional argument module also exports the macros `let-optional',
  5832. `let-optional*', `let-keywords', `let-keywords*' and `bound?'. These
  5833. are not documented here because they may be removed in the future, but
  5834. full documentation is still available in optargs.scm.
  5835. ** New syntax: and-let*
  5836. Guile now supports the `and-let*' form, described in the draft SRFI-2.
  5837. Syntax: (land* (<clause> ...) <body> ...)
  5838. Each <clause> should have one of the following forms:
  5839. (<variable> <expression>)
  5840. (<expression>)
  5841. <bound-variable>
  5842. Each <variable> or <bound-variable> should be an identifier. Each
  5843. <expression> should be a valid expression. The <body> should be a
  5844. possibly empty sequence of expressions, like the <body> of a
  5845. lambda form.
  5846. Semantics: A LAND* expression is evaluated by evaluating the
  5847. <expression> or <bound-variable> of each of the <clause>s from
  5848. left to right. The value of the first <expression> or
  5849. <bound-variable> that evaluates to a false value is returned; the
  5850. remaining <expression>s and <bound-variable>s are not evaluated.
  5851. The <body> forms are evaluated iff all the <expression>s and
  5852. <bound-variable>s evaluate to true values.
  5853. The <expression>s and the <body> are evaluated in an environment
  5854. binding each <variable> of the preceding (<variable> <expression>)
  5855. clauses to the value of the <expression>. Later bindings
  5856. shadow earlier bindings.
  5857. Guile's and-let* macro was contributed by Michael Livshin.
  5858. ** New sorting functions
  5859. *** New function: sorted? SEQUENCE LESS?
  5860. Returns `#t' when the sequence argument is in non-decreasing order
  5861. according to LESS? (that is, there is no adjacent pair `... x y
  5862. ...' for which `(less? y x)').
  5863. Returns `#f' when the sequence contains at least one out-of-order
  5864. pair. It is an error if the sequence is neither a list nor a
  5865. vector.
  5866. *** New function: merge LIST1 LIST2 LESS?
  5867. LIST1 and LIST2 are sorted lists.
  5868. Returns the sorted list of all elements in LIST1 and LIST2.
  5869. Assume that the elements a and b1 in LIST1 and b2 in LIST2 are "equal"
  5870. in the sense that (LESS? x y) --> #f for x, y in {a, b1, b2},
  5871. and that a < b1 in LIST1. Then a < b1 < b2 in the result.
  5872. (Here "<" should read "comes before".)
  5873. *** New procedure: merge! LIST1 LIST2 LESS?
  5874. Merges two lists, re-using the pairs of LIST1 and LIST2 to build
  5875. the result. If the code is compiled, and LESS? constructs no new
  5876. pairs, no pairs at all will be allocated. The first pair of the
  5877. result will be either the first pair of LIST1 or the first pair of
  5878. LIST2.
  5879. *** New function: sort SEQUENCE LESS?
  5880. Accepts either a list or a vector, and returns a new sequence
  5881. which is sorted. The new sequence is the same type as the input.
  5882. Always `(sorted? (sort sequence less?) less?)'. The original
  5883. sequence is not altered in any way. The new sequence shares its
  5884. elements with the old one; no elements are copied.
  5885. *** New procedure: sort! SEQUENCE LESS
  5886. Returns its sorted result in the original boxes. No new storage is
  5887. allocated at all. Proper usage: (set! slist (sort! slist <))
  5888. *** New function: stable-sort SEQUENCE LESS?
  5889. Similar to `sort' but stable. That is, if "equal" elements are
  5890. ordered a < b in the original sequence, they will have the same order
  5891. in the result.
  5892. *** New function: stable-sort! SEQUENCE LESS?
  5893. Similar to `sort!' but stable.
  5894. Uses temporary storage when sorting vectors.
  5895. *** New functions: sort-list, sort-list!
  5896. Added for compatibility with scsh.
  5897. ** New built-in random number support
  5898. *** New function: random N [STATE]
  5899. Accepts a positive integer or real N and returns a number of the
  5900. same type between zero (inclusive) and N (exclusive). The values
  5901. returned have a uniform distribution.
  5902. The optional argument STATE must be of the type produced by
  5903. `copy-random-state' or `seed->random-state'. It defaults to the value
  5904. of the variable `*random-state*'. This object is used to maintain the
  5905. state of the pseudo-random-number generator and is altered as a side
  5906. effect of the `random' operation.
  5907. *** New variable: *random-state*
  5908. Holds a data structure that encodes the internal state of the
  5909. random-number generator that `random' uses by default. The nature
  5910. of this data structure is implementation-dependent. It may be
  5911. printed out and successfully read back in, but may or may not
  5912. function correctly as a random-number state object in another
  5913. implementation.
  5914. *** New function: copy-random-state [STATE]
  5915. Returns a new object of type suitable for use as the value of the
  5916. variable `*random-state*' and as a second argument to `random'.
  5917. If argument STATE is given, a copy of it is returned. Otherwise a
  5918. copy of `*random-state*' is returned.
  5919. *** New function: seed->random-state SEED
  5920. Returns a new object of type suitable for use as the value of the
  5921. variable `*random-state*' and as a second argument to `random'.
  5922. SEED is a string or a number. A new state is generated and
  5923. initialized using SEED.
  5924. *** New function: random:uniform [STATE]
  5925. Returns an uniformly distributed inexact real random number in the
  5926. range between 0 and 1.
  5927. *** New procedure: random:solid-sphere! VECT [STATE]
  5928. Fills VECT with inexact real random numbers the sum of whose
  5929. squares is less than 1.0. Thinking of VECT as coordinates in
  5930. space of dimension N = `(vector-length VECT)', the coordinates are
  5931. uniformly distributed within the unit N-shere. The sum of the
  5932. squares of the numbers is returned. VECT can be either a vector
  5933. or a uniform vector of doubles.
  5934. *** New procedure: random:hollow-sphere! VECT [STATE]
  5935. Fills VECT with inexact real random numbers the sum of whose squares
  5936. is equal to 1.0. Thinking of VECT as coordinates in space of
  5937. dimension n = `(vector-length VECT)', the coordinates are uniformly
  5938. distributed over the surface of the unit n-shere. VECT can be either
  5939. a vector or a uniform vector of doubles.
  5940. *** New function: random:normal [STATE]
  5941. Returns an inexact real in a normal distribution with mean 0 and
  5942. standard deviation 1. For a normal distribution with mean M and
  5943. standard deviation D use `(+ M (* D (random:normal)))'.
  5944. *** New procedure: random:normal-vector! VECT [STATE]
  5945. Fills VECT with inexact real random numbers which are independent and
  5946. standard normally distributed (i.e., with mean 0 and variance 1).
  5947. VECT can be either a vector or a uniform vector of doubles.
  5948. *** New function: random:exp STATE
  5949. Returns an inexact real in an exponential distribution with mean 1.
  5950. For an exponential distribution with mean U use (* U (random:exp)).
  5951. ** The range of logand, logior, logxor, logtest, and logbit? have changed.
  5952. These functions now operate on numbers in the range of a C unsigned
  5953. long.
  5954. These functions used to operate on numbers in the range of a C signed
  5955. long; however, this seems inappropriate, because Guile integers don't
  5956. overflow.
  5957. ** New function: make-guardian
  5958. This is an implementation of guardians as described in
  5959. R. Kent Dybvig, Carl Bruggeman, and David Eby (1993) "Guardians in a
  5960. Generation-Based Garbage Collector" ACM SIGPLAN Conference on
  5961. Programming Language Design and Implementation, June 1993
  5962. ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/pubs/guardians.ps.gz
  5963. ** New functions: delq1!, delv1!, delete1!
  5964. These procedures behave similar to delq! and friends but delete only
  5965. one object if at all.
  5966. ** New function: unread-string STRING PORT
  5967. Unread STRING to PORT, that is, push it back onto the port so that
  5968. next read operation will work on the pushed back characters.
  5969. ** unread-char can now be called multiple times
  5970. If unread-char is called multiple times, the unread characters will be
  5971. read again in last-in first-out order.
  5972. ** the procedures uniform-array-read! and uniform-array-write! now
  5973. work on any kind of port, not just ports which are open on a file.
  5974. ** Now 'l' in a port mode requests line buffering.
  5975. ** The procedure truncate-file now works on string ports as well
  5976. as file ports. If the size argument is omitted, the current
  5977. file position is used.
  5978. ** new procedure: seek PORT/FDES OFFSET WHENCE
  5979. The arguments are the same as for the old fseek procedure, but it
  5980. works on string ports as well as random-access file ports.
  5981. ** the fseek procedure now works on string ports, since it has been
  5982. redefined using seek.
  5983. ** the setvbuf procedure now uses a default size if mode is _IOFBF and
  5984. size is not supplied.
  5985. ** the newline procedure no longer flushes the port if it's not
  5986. line-buffered: previously it did if it was the current output port.
  5987. ** open-pipe and close-pipe are no longer primitive procedures, but
  5988. an emulation can be obtained using `(use-modules (ice-9 popen))'.
  5989. ** the freopen procedure has been removed.
  5990. ** new procedure: drain-input PORT
  5991. Drains PORT's read buffers (including any pushed-back characters)
  5992. and returns the contents as a single string.
  5993. ** New function: map-in-order PROC LIST1 LIST2 ...
  5994. Version of `map' which guarantees that the procedure is applied to the
  5995. lists in serial order.
  5996. ** Renamed `serial-array-copy!' and `serial-array-map!' to
  5997. `array-copy-in-order!' and `array-map-in-order!'. The old names are
  5998. now obsolete and will go away in release 1.5.
  5999. ** New syntax: collect BODY1 ...
  6000. Version of `begin' which returns a list of the results of the body
  6001. forms instead of the result of the last body form. In contrast to
  6002. `begin', `collect' allows an empty body.
  6003. ** New functions: read-history FILENAME, write-history FILENAME
  6004. Read/write command line history from/to file. Returns #t on success
  6005. and #f if an error occured.
  6006. ** `ls' and `lls' in module (ice-9 ls) now handle no arguments.
  6007. These procedures return a list of definitions available in the specified
  6008. argument, a relative module reference. In the case of no argument,
  6009. `(current-module)' is now consulted for definitions to return, instead
  6010. of simply returning #f, the former behavior.
  6011. ** The #/ syntax for lists is no longer supported.
  6012. Earlier versions of Scheme accepted this syntax, but printed a
  6013. warning.
  6014. ** Guile no longer consults the SCHEME_LOAD_PATH environment variable.
  6015. Instead, you should set GUILE_LOAD_PATH to tell Guile where to find
  6016. modules.
  6017. * Changes to the gh_ interface
  6018. ** gh_scm2doubles
  6019. Now takes a second argument which is the result array. If this
  6020. pointer is NULL, a new array is malloced (the old behaviour).
  6021. ** gh_chars2byvect, gh_shorts2svect, gh_floats2fvect, gh_scm2chars,
  6022. gh_scm2shorts, gh_scm2longs, gh_scm2floats
  6023. New functions.
  6024. * Changes to the scm_ interface
  6025. ** Function: scm_make_named_hook (char* name, int n_args)
  6026. Creates a hook in the same way as make-hook above but also
  6027. binds a variable named NAME to it.
  6028. This is the typical way of creating a hook from C code.
  6029. Currently, the variable is created in the "current" module. This
  6030. might change when we get the new module system.
  6031. ** The smob interface
  6032. The interface for creating smobs has changed. For documentation, see
  6033. data-rep.info (made from guile-core/doc/data-rep.texi).
  6034. *** Deprecated function: SCM scm_newsmob (scm_smobfuns *)
  6035. >>> This function will be removed in 1.3.4. <<<
  6036. It is replaced by:
  6037. *** Function: SCM scm_make_smob_type (const char *name, scm_sizet size)
  6038. This function adds a new smob type, named NAME, with instance size
  6039. SIZE to the system. The return value is a tag that is used in
  6040. creating instances of the type. If SIZE is 0, then no memory will
  6041. be allocated when instances of the smob are created, and nothing
  6042. will be freed by the default free function.
  6043. *** Function: void scm_set_smob_mark (long tc, SCM (*mark) (SCM))
  6044. This function sets the smob marking procedure for the smob type
  6045. specified by the tag TC. TC is the tag returned by
  6046. `scm_make_smob_type'.
  6047. *** Function: void scm_set_smob_free (long tc, SCM (*mark) (SCM))
  6048. This function sets the smob freeing procedure for the smob type
  6049. specified by the tag TC. TC is the tag returned by
  6050. `scm_make_smob_type'.
  6051. *** Function: void scm_set_smob_print (tc, print)
  6052. - Function: void scm_set_smob_print (long tc,
  6053. scm_sizet (*print) (SCM,
  6054. SCM,
  6055. scm_print_state *))
  6056. This function sets the smob printing procedure for the smob type
  6057. specified by the tag TC. TC is the tag returned by
  6058. `scm_make_smob_type'.
  6059. *** Function: void scm_set_smob_equalp (long tc, SCM (*equalp) (SCM, SCM))
  6060. This function sets the smob equality-testing predicate for the
  6061. smob type specified by the tag TC. TC is the tag returned by
  6062. `scm_make_smob_type'.
  6063. *** Macro: void SCM_NEWSMOB (SCM var, long tc, void *data)
  6064. Make VALUE contain a smob instance of the type with type code TC and
  6065. smob data DATA. VALUE must be previously declared as C type `SCM'.
  6066. *** Macro: fn_returns SCM_RETURN_NEWSMOB (long tc, void *data)
  6067. This macro expands to a block of code that creates a smob instance
  6068. of the type with type code TC and smob data DATA, and returns that
  6069. `SCM' value. It should be the last piece of code in a block.
  6070. ** The interfaces for using I/O ports and implementing port types
  6071. (ptobs) have changed significantly. The new interface is based on
  6072. shared access to buffers and a new set of ptob procedures.
  6073. *** scm_newptob has been removed
  6074. It is replaced by:
  6075. *** Function: SCM scm_make_port_type (type_name, fill_buffer, write_flush)
  6076. - Function: SCM scm_make_port_type (char *type_name,
  6077. int (*fill_buffer) (SCM port),
  6078. void (*write_flush) (SCM port));
  6079. Similarly to the new smob interface, there is a set of function
  6080. setters by which the user can customize the behaviour of his port
  6081. type. See ports.h (scm_set_port_XXX).
  6082. ** scm_strport_to_string: New function: creates a new string from
  6083. a string port's buffer.
  6084. ** Plug in interface for random number generators
  6085. The variable `scm_the_rng' in random.c contains a value and three
  6086. function pointers which together define the current random number
  6087. generator being used by the Scheme level interface and the random
  6088. number library functions.
  6089. The user is free to replace the default generator with the generator
  6090. of his own choice.
  6091. *** Variable: size_t scm_the_rng.rstate_size
  6092. The size of the random state type used by the current RNG
  6093. measured in chars.
  6094. *** Function: unsigned long scm_the_rng.random_bits (scm_rstate *STATE)
  6095. Given the random STATE, return 32 random bits.
  6096. *** Function: void scm_the_rng.init_rstate (scm_rstate *STATE, chars *S, int N)
  6097. Seed random state STATE using string S of length N.
  6098. *** Function: scm_rstate *scm_the_rng.copy_rstate (scm_rstate *STATE)
  6099. Given random state STATE, return a malloced copy.
  6100. ** Default RNG
  6101. The default RNG is the MWC (Multiply With Carry) random number
  6102. generator described by George Marsaglia at the Department of
  6103. Statistics and Supercomputer Computations Research Institute, The
  6104. Florida State University (http://stat.fsu.edu/~geo).
  6105. It uses 64 bits, has a period of 4578426017172946943 (4.6e18), and
  6106. passes all tests in the DIEHARD test suite
  6107. (http://stat.fsu.edu/~geo/diehard.html). The generation of 32 bits
  6108. costs one multiply and one add on platforms which either supports long
  6109. longs (gcc does this on most systems) or have 64 bit longs. The cost
  6110. is four multiply on other systems but this can be optimized by writing
  6111. scm_i_uniform32 in assembler.
  6112. These functions are provided through the scm_the_rng interface for use
  6113. by libguile and the application.
  6114. *** Function: unsigned long scm_i_uniform32 (scm_i_rstate *STATE)
  6115. Given the random STATE, return 32 random bits.
  6116. Don't use this function directly. Instead go through the plugin
  6117. interface (see "Plug in interface" above).
  6118. *** Function: void scm_i_init_rstate (scm_i_rstate *STATE, char *SEED, int N)
  6119. Initialize STATE using SEED of length N.
  6120. *** Function: scm_i_rstate *scm_i_copy_rstate (scm_i_rstate *STATE)
  6121. Return a malloc:ed copy of STATE. This function can easily be re-used
  6122. in the interfaces to other RNGs.
  6123. ** Random number library functions
  6124. These functions use the current RNG through the scm_the_rng interface.
  6125. It might be a good idea to use these functions from your C code so
  6126. that only one random generator is used by all code in your program.
  6127. The default random state is stored in:
  6128. *** Variable: SCM scm_var_random_state
  6129. Contains the vcell of the Scheme variable "*random-state*" which is
  6130. used as default state by all random number functions in the Scheme
  6131. level interface.
  6132. Example:
  6133. double x = scm_c_uniform01 (SCM_RSTATE (SCM_CDR (scm_var_random_state)));
  6134. *** Function: scm_rstate *scm_c_default_rstate (void)
  6135. This is a convenience function which returns the value of
  6136. scm_var_random_state. An error message is generated if this value
  6137. isn't a random state.
  6138. *** Function: scm_rstate *scm_c_make_rstate (char *SEED, int LENGTH)
  6139. Make a new random state from the string SEED of length LENGTH.
  6140. It is generally not a good idea to use multiple random states in a
  6141. program. While subsequent random numbers generated from one random
  6142. state are guaranteed to be reasonably independent, there is no such
  6143. guarantee for numbers generated from different random states.
  6144. *** Macro: unsigned long scm_c_uniform32 (scm_rstate *STATE)
  6145. Return 32 random bits.
  6146. *** Function: double scm_c_uniform01 (scm_rstate *STATE)
  6147. Return a sample from the uniform(0,1) distribution.
  6148. *** Function: double scm_c_normal01 (scm_rstate *STATE)
  6149. Return a sample from the normal(0,1) distribution.
  6150. *** Function: double scm_c_exp1 (scm_rstate *STATE)
  6151. Return a sample from the exp(1) distribution.
  6152. *** Function: unsigned long scm_c_random (scm_rstate *STATE, unsigned long M)
  6153. Return a sample from the discrete uniform(0,M) distribution.
  6154. *** Function: SCM scm_c_random_bignum (scm_rstate *STATE, SCM M)
  6155. Return a sample from the discrete uniform(0,M) distribution.
  6156. M must be a bignum object. The returned value may be an INUM.
  6157. Changes in Guile 1.3 (released Monday, October 19, 1998):
  6158. * Changes to the distribution
  6159. ** We renamed the SCHEME_LOAD_PATH environment variable to GUILE_LOAD_PATH.
  6160. To avoid conflicts, programs should name environment variables after
  6161. themselves, except when there's a common practice establishing some
  6162. other convention.
  6163. For now, Guile supports both GUILE_LOAD_PATH and SCHEME_LOAD_PATH,
  6164. giving the former precedence, and printing a warning message if the
  6165. latter is set. Guile 1.4 will not recognize SCHEME_LOAD_PATH at all.
  6166. ** The header files related to multi-byte characters have been removed.
  6167. They were: libguile/extchrs.h and libguile/mbstrings.h. Any C code
  6168. which referred to these explicitly will probably need to be rewritten,
  6169. since the support for the variant string types has been removed; see
  6170. below.
  6171. ** The header files append.h and sequences.h have been removed. These
  6172. files implemented non-R4RS operations which would encourage
  6173. non-portable programming style and less easy-to-read code.
  6174. * Changes to the stand-alone interpreter
  6175. ** New procedures have been added to implement a "batch mode":
  6176. *** Function: batch-mode?
  6177. Returns a boolean indicating whether the interpreter is in batch
  6178. mode.
  6179. *** Function: set-batch-mode?! ARG
  6180. If ARG is true, switches the interpreter to batch mode. The `#f'
  6181. case has not been implemented.
  6182. ** Guile now provides full command-line editing, when run interactively.
  6183. To use this feature, you must have the readline library installed.
  6184. The Guile build process will notice it, and automatically include
  6185. support for it.
  6186. The readline library is available via anonymous FTP from any GNU
  6187. mirror site; the canonical location is "ftp://prep.ai.mit.edu/pub/gnu".
  6188. ** the-last-stack is now a fluid.
  6189. * Changes to the procedure for linking libguile with your programs
  6190. ** You can now use the `guile-config' utility to build programs that use Guile.
  6191. Guile now includes a command-line utility called `guile-config', which
  6192. can provide information about how to compile and link programs that
  6193. use Guile.
  6194. *** `guile-config compile' prints any C compiler flags needed to use Guile.
  6195. You should include this command's output on the command line you use
  6196. to compile C or C++ code that #includes the Guile header files. It's
  6197. usually just a `-I' flag to help the compiler find the Guile headers.
  6198. *** `guile-config link' prints any linker flags necessary to link with Guile.
  6199. This command writes to its standard output a list of flags which you
  6200. must pass to the linker to link your code against the Guile library.
  6201. The flags include '-lguile' itself, any other libraries the Guile
  6202. library depends upon, and any `-L' flags needed to help the linker
  6203. find those libraries.
  6204. For example, here is a Makefile rule that builds a program named 'foo'
  6205. from the object files ${FOO_OBJECTS}, and links them against Guile:
  6206. foo: ${FOO_OBJECTS}
  6207. ${CC} ${CFLAGS} ${FOO_OBJECTS} `guile-config link` -o foo
  6208. Previous Guile releases recommended that you use autoconf to detect
  6209. which of a predefined set of libraries were present on your system.
  6210. It is more robust to use `guile-config', since it records exactly which
  6211. libraries the installed Guile library requires.
  6212. This was originally called `build-guile', but was renamed to
  6213. `guile-config' before Guile 1.3 was released, to be consistent with
  6214. the analogous script for the GTK+ GUI toolkit, which is called
  6215. `gtk-config'.
  6216. ** Use the GUILE_FLAGS macro in your configure.in file to find Guile.
  6217. If you are using the GNU autoconf package to configure your program,
  6218. you can use the GUILE_FLAGS autoconf macro to call `guile-config'
  6219. (described above) and gather the necessary values for use in your
  6220. Makefiles.
  6221. The GUILE_FLAGS macro expands to configure script code which runs the
  6222. `guile-config' script, to find out where Guile's header files and
  6223. libraries are installed. It sets two variables, marked for
  6224. substitution, as by AC_SUBST.
  6225. GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
  6226. code that uses Guile header files. This is almost always just a
  6227. -I flag.
  6228. GUILE_LDFLAGS --- flags to pass to the linker to link a
  6229. program against Guile. This includes `-lguile' for the Guile
  6230. library itself, any libraries that Guile itself requires (like
  6231. -lqthreads), and so on. It may also include a -L flag to tell the
  6232. compiler where to find the libraries.
  6233. GUILE_FLAGS is defined in the file guile.m4, in the top-level
  6234. directory of the Guile distribution. You can copy it into your
  6235. package's aclocal.m4 file, and then use it in your configure.in file.
  6236. If you are using the `aclocal' program, distributed with GNU automake,
  6237. to maintain your aclocal.m4 file, the Guile installation process
  6238. installs guile.m4 where aclocal will find it. All you need to do is
  6239. use GUILE_FLAGS in your configure.in file, and then run `aclocal';
  6240. this will copy the definition of GUILE_FLAGS into your aclocal.m4
  6241. file.
  6242. * Changes to Scheme functions and syntax
  6243. ** Multi-byte strings have been removed, as have multi-byte and wide
  6244. ports. We felt that these were the wrong approach to
  6245. internationalization support.
  6246. ** New function: readline [PROMPT]
  6247. Read a line from the terminal, and allow the user to edit it,
  6248. prompting with PROMPT. READLINE provides a large set of Emacs-like
  6249. editing commands, lets the user recall previously typed lines, and
  6250. works on almost every kind of terminal, including dumb terminals.
  6251. READLINE assumes that the cursor is at the beginning of the line when
  6252. it is invoked. Thus, you can't print a prompt yourself, and then call
  6253. READLINE; you need to package up your prompt as a string, pass it to
  6254. the function, and let READLINE print the prompt itself. This is
  6255. because READLINE needs to know the prompt's screen width.
  6256. For Guile to provide this function, you must have the readline
  6257. library, version 2.1 or later, installed on your system. Readline is
  6258. available via anonymous FTP from prep.ai.mit.edu in pub/gnu, or from
  6259. any GNU mirror site.
  6260. See also ADD-HISTORY function.
  6261. ** New function: add-history STRING
  6262. Add STRING as the most recent line in the history used by the READLINE
  6263. command. READLINE does not add lines to the history itself; you must
  6264. call ADD-HISTORY to make previous input available to the user.
  6265. ** The behavior of the read-line function has changed.
  6266. This function now uses standard C library functions to read the line,
  6267. for speed. This means that it doesn not respect the value of
  6268. scm-line-incrementors; it assumes that lines are delimited with
  6269. #\newline.
  6270. (Note that this is read-line, the function that reads a line of text
  6271. from a port, not readline, the function that reads a line from a
  6272. terminal, providing full editing capabilities.)
  6273. ** New module (ice-9 getopt-gnu-style): Parse command-line arguments.
  6274. This module provides some simple argument parsing. It exports one
  6275. function:
  6276. Function: getopt-gnu-style ARG-LS
  6277. Parse a list of program arguments into an alist of option
  6278. descriptions.
  6279. Each item in the list of program arguments is examined to see if
  6280. it meets the syntax of a GNU long-named option. An argument like
  6281. `--MUMBLE' produces an element of the form (MUMBLE . #t) in the
  6282. returned alist, where MUMBLE is a keyword object with the same
  6283. name as the argument. An argument like `--MUMBLE=FROB' produces
  6284. an element of the form (MUMBLE . FROB), where FROB is a string.
  6285. As a special case, the returned alist also contains a pair whose
  6286. car is the symbol `rest'. The cdr of this pair is a list
  6287. containing all the items in the argument list that are not options
  6288. of the form mentioned above.
  6289. The argument `--' is treated specially: all items in the argument
  6290. list appearing after such an argument are not examined, and are
  6291. returned in the special `rest' list.
  6292. This function does not parse normal single-character switches.
  6293. You will need to parse them out of the `rest' list yourself.
  6294. ** The read syntax for byte vectors and short vectors has changed.
  6295. Instead of #bytes(...), write #y(...).
  6296. Instead of #short(...), write #h(...).
  6297. This may seem nutty, but, like the other uniform vectors, byte vectors
  6298. and short vectors want to have the same print and read syntax (and,
  6299. more basic, want to have read syntax!). Changing the read syntax to
  6300. use multiple characters after the hash sign breaks with the
  6301. conventions used in R5RS and the conventions used for the other
  6302. uniform vectors. It also introduces complexity in the current reader,
  6303. both on the C and Scheme levels. (The Right solution is probably to
  6304. change the syntax and prototypes for uniform vectors entirely.)
  6305. ** The new module (ice-9 session) provides useful interactive functions.
  6306. *** New procedure: (apropos REGEXP OPTION ...)
  6307. Display a list of top-level variables whose names match REGEXP, and
  6308. the modules they are imported from. Each OPTION should be one of the
  6309. following symbols:
  6310. value --- Show the value of each matching variable.
  6311. shadow --- Show bindings shadowed by subsequently imported modules.
  6312. full --- Same as both `shadow' and `value'.
  6313. For example:
  6314. guile> (apropos "trace" 'full)
  6315. debug: trace #<procedure trace args>
  6316. debug: untrace #<procedure untrace args>
  6317. the-scm-module: display-backtrace #<compiled-closure #<primitive-procedure gsubr-apply>>
  6318. the-scm-module: before-backtrace-hook ()
  6319. the-scm-module: backtrace #<primitive-procedure backtrace>
  6320. the-scm-module: after-backtrace-hook ()
  6321. the-scm-module: has-shown-backtrace-hint? #f
  6322. guile>
  6323. ** There are new functions and syntax for working with macros.
  6324. Guile implements macros as a special object type. Any variable whose
  6325. top-level binding is a macro object acts as a macro. The macro object
  6326. specifies how the expression should be transformed before evaluation.
  6327. *** Macro objects now print in a reasonable way, resembling procedures.
  6328. *** New function: (macro? OBJ)
  6329. True iff OBJ is a macro object.
  6330. *** New function: (primitive-macro? OBJ)
  6331. Like (macro? OBJ), but true only if OBJ is one of the Guile primitive
  6332. macro transformers, implemented in eval.c rather than Scheme code.
  6333. Why do we have this function?
  6334. - For symmetry with procedure? and primitive-procedure?,
  6335. - to allow custom print procedures to tell whether a macro is
  6336. primitive, and display it differently, and
  6337. - to allow compilers and user-written evaluators to distinguish
  6338. builtin special forms from user-defined ones, which could be
  6339. compiled.
  6340. *** New function: (macro-type OBJ)
  6341. Return a value indicating what kind of macro OBJ is. Possible return
  6342. values are:
  6343. The symbol `syntax' --- a macro created by procedure->syntax.
  6344. The symbol `macro' --- a macro created by procedure->macro.
  6345. The symbol `macro!' --- a macro created by procedure->memoizing-macro.
  6346. The boolean #f --- if OBJ is not a macro object.
  6347. *** New function: (macro-name MACRO)
  6348. Return the name of the macro object MACRO's procedure, as returned by
  6349. procedure-name.
  6350. *** New function: (macro-transformer MACRO)
  6351. Return the transformer procedure for MACRO.
  6352. *** New syntax: (use-syntax MODULE ... TRANSFORMER)
  6353. Specify a new macro expander to use in the current module. Each
  6354. MODULE is a module name, with the same meaning as in the `use-modules'
  6355. form; each named module's exported bindings are added to the current
  6356. top-level environment. TRANSFORMER is an expression evaluated in the
  6357. resulting environment which must yield a procedure to use as the
  6358. module's eval transformer: every expression evaluated in this module
  6359. is passed to this function, and the result passed to the Guile
  6360. interpreter.
  6361. *** macro-eval! is removed. Use local-eval instead.
  6362. ** Some magic has been added to the printer to better handle user
  6363. written printing routines (like record printers, closure printers).
  6364. The problem is that these user written routines must have access to
  6365. the current `print-state' to be able to handle fancy things like
  6366. detection of circular references. These print-states have to be
  6367. passed to the builtin printing routines (display, write, etc) to
  6368. properly continue the print chain.
  6369. We didn't want to change all existing print code so that it
  6370. explicitly passes thru a print state in addition to a port. Instead,
  6371. we extented the possible values that the builtin printing routines
  6372. accept as a `port'. In addition to a normal port, they now also take
  6373. a pair of a normal port and a print-state. Printing will go to the
  6374. port and the print-state will be used to control the detection of
  6375. circular references, etc. If the builtin function does not care for a
  6376. print-state, it is simply ignored.
  6377. User written callbacks are now called with such a pair as their
  6378. `port', but because every function now accepts this pair as a PORT
  6379. argument, you don't have to worry about that. In fact, it is probably
  6380. safest to not check for these pairs.
  6381. However, it is sometimes necessary to continue a print chain on a
  6382. different port, for example to get a intermediate string
  6383. representation of the printed value, mangle that string somehow, and
  6384. then to finally print the mangled string. Use the new function
  6385. inherit-print-state OLD-PORT NEW-PORT
  6386. for this. It constructs a new `port' that prints to NEW-PORT but
  6387. inherits the print-state of OLD-PORT.
  6388. ** struct-vtable-offset renamed to vtable-offset-user
  6389. ** New constants: vtable-index-layout, vtable-index-vtable, vtable-index-printer
  6390. ** There is now a third optional argument to make-vtable-vtable
  6391. (and fourth to make-struct) when constructing new types (vtables).
  6392. This argument initializes field vtable-index-printer of the vtable.
  6393. ** The detection of circular references has been extended to structs.
  6394. That is, a structure that -- in the process of being printed -- prints
  6395. itself does not lead to infinite recursion.
  6396. ** There is now some basic support for fluids. Please read
  6397. "libguile/fluid.h" to find out more. It is accessible from Scheme with
  6398. the following functions and macros:
  6399. Function: make-fluid
  6400. Create a new fluid object. Fluids are not special variables or
  6401. some other extension to the semantics of Scheme, but rather
  6402. ordinary Scheme objects. You can store them into variables (that
  6403. are still lexically scoped, of course) or into any other place you
  6404. like. Every fluid has a initial value of `#f'.
  6405. Function: fluid? OBJ
  6406. Test whether OBJ is a fluid.
  6407. Function: fluid-ref FLUID
  6408. Function: fluid-set! FLUID VAL
  6409. Access/modify the fluid FLUID. Modifications are only visible
  6410. within the current dynamic root (that includes threads).
  6411. Function: with-fluids* FLUIDS VALUES THUNK
  6412. FLUIDS is a list of fluids and VALUES a corresponding list of
  6413. values for these fluids. Before THUNK gets called the values are
  6414. installed in the fluids and the old values of the fluids are
  6415. saved in the VALUES list. When the flow of control leaves THUNK
  6416. or reenters it, the values get swapped again. You might think of
  6417. this as a `safe-fluid-excursion'. Note that the VALUES list is
  6418. modified by `with-fluids*'.
  6419. Macro: with-fluids ((FLUID VALUE) ...) FORM ...
  6420. The same as `with-fluids*' but with a different syntax. It looks
  6421. just like `let', but both FLUID and VALUE are evaluated. Remember,
  6422. fluids are not special variables but ordinary objects. FLUID
  6423. should evaluate to a fluid.
  6424. ** Changes to system call interfaces:
  6425. *** close-port, close-input-port and close-output-port now return a
  6426. boolean instead of an `unspecified' object. #t means that the port
  6427. was successfully closed, while #f means it was already closed. It is
  6428. also now possible for these procedures to raise an exception if an
  6429. error occurs (some errors from write can be delayed until close.)
  6430. *** the first argument to chmod, fcntl, ftell and fseek can now be a
  6431. file descriptor.
  6432. *** the third argument to fcntl is now optional.
  6433. *** the first argument to chown can now be a file descriptor or a port.
  6434. *** the argument to stat can now be a port.
  6435. *** The following new procedures have been added (most use scsh
  6436. interfaces):
  6437. *** procedure: close PORT/FD
  6438. Similar to close-port (*note close-port: Closing Ports.), but also
  6439. works on file descriptors. A side effect of closing a file
  6440. descriptor is that any ports using that file descriptor are moved
  6441. to a different file descriptor and have their revealed counts set
  6442. to zero.
  6443. *** procedure: port->fdes PORT
  6444. Returns the integer file descriptor underlying PORT. As a side
  6445. effect the revealed count of PORT is incremented.
  6446. *** procedure: fdes->ports FDES
  6447. Returns a list of existing ports which have FDES as an underlying
  6448. file descriptor, without changing their revealed counts.
  6449. *** procedure: fdes->inport FDES
  6450. Returns an existing input port which has FDES as its underlying
  6451. file descriptor, if one exists, and increments its revealed count.
  6452. Otherwise, returns a new input port with a revealed count of 1.
  6453. *** procedure: fdes->outport FDES
  6454. Returns an existing output port which has FDES as its underlying
  6455. file descriptor, if one exists, and increments its revealed count.
  6456. Otherwise, returns a new output port with a revealed count of 1.
  6457. The next group of procedures perform a `dup2' system call, if NEWFD
  6458. (an integer) is supplied, otherwise a `dup'. The file descriptor to be
  6459. duplicated can be supplied as an integer or contained in a port. The
  6460. type of value returned varies depending on which procedure is used.
  6461. All procedures also have the side effect when performing `dup2' that
  6462. any ports using NEWFD are moved to a different file descriptor and have
  6463. their revealed counts set to zero.
  6464. *** procedure: dup->fdes PORT/FD [NEWFD]
  6465. Returns an integer file descriptor.
  6466. *** procedure: dup->inport PORT/FD [NEWFD]
  6467. Returns a new input port using the new file descriptor.
  6468. *** procedure: dup->outport PORT/FD [NEWFD]
  6469. Returns a new output port using the new file descriptor.
  6470. *** procedure: dup PORT/FD [NEWFD]
  6471. Returns a new port if PORT/FD is a port, with the same mode as the
  6472. supplied port, otherwise returns an integer file descriptor.
  6473. *** procedure: dup->port PORT/FD MODE [NEWFD]
  6474. Returns a new port using the new file descriptor. MODE supplies a
  6475. mode string for the port (*note open-file: File Ports.).
  6476. *** procedure: setenv NAME VALUE
  6477. Modifies the environment of the current process, which is also the
  6478. default environment inherited by child processes.
  6479. If VALUE is `#f', then NAME is removed from the environment.
  6480. Otherwise, the string NAME=VALUE is added to the environment,
  6481. replacing any existing string with name matching NAME.
  6482. The return value is unspecified.
  6483. *** procedure: truncate-file OBJ SIZE
  6484. Truncates the file referred to by OBJ to at most SIZE bytes. OBJ
  6485. can be a string containing a file name or an integer file
  6486. descriptor or port open for output on the file. The underlying
  6487. system calls are `truncate' and `ftruncate'.
  6488. The return value is unspecified.
  6489. *** procedure: setvbuf PORT MODE [SIZE]
  6490. Set the buffering mode for PORT. MODE can be:
  6491. `_IONBF'
  6492. non-buffered
  6493. `_IOLBF'
  6494. line buffered
  6495. `_IOFBF'
  6496. block buffered, using a newly allocated buffer of SIZE bytes.
  6497. However if SIZE is zero or unspecified, the port will be made
  6498. non-buffered.
  6499. This procedure should not be used after I/O has been performed with
  6500. the port.
  6501. Ports are usually block buffered by default, with a default buffer
  6502. size. Procedures e.g., *Note open-file: File Ports, which accept a
  6503. mode string allow `0' to be added to request an unbuffered port.
  6504. *** procedure: fsync PORT/FD
  6505. Copies any unwritten data for the specified output file descriptor
  6506. to disk. If PORT/FD is a port, its buffer is flushed before the
  6507. underlying file descriptor is fsync'd. The return value is
  6508. unspecified.
  6509. *** procedure: open-fdes PATH FLAGS [MODES]
  6510. Similar to `open' but returns a file descriptor instead of a port.
  6511. *** procedure: execle PATH ENV [ARG] ...
  6512. Similar to `execl', but the environment of the new process is
  6513. specified by ENV, which must be a list of strings as returned by
  6514. the `environ' procedure.
  6515. This procedure is currently implemented using the `execve' system
  6516. call, but we call it `execle' because of its Scheme calling
  6517. interface.
  6518. *** procedure: strerror ERRNO
  6519. Returns the Unix error message corresponding to ERRNO, an integer.
  6520. *** procedure: primitive-exit [STATUS]
  6521. Terminate the current process without unwinding the Scheme stack.
  6522. This is would typically be useful after a fork. The exit status
  6523. is STATUS if supplied, otherwise zero.
  6524. *** procedure: times
  6525. Returns an object with information about real and processor time.
  6526. The following procedures accept such an object as an argument and
  6527. return a selected component:
  6528. `tms:clock'
  6529. The current real time, expressed as time units relative to an
  6530. arbitrary base.
  6531. `tms:utime'
  6532. The CPU time units used by the calling process.
  6533. `tms:stime'
  6534. The CPU time units used by the system on behalf of the
  6535. calling process.
  6536. `tms:cutime'
  6537. The CPU time units used by terminated child processes of the
  6538. calling process, whose status has been collected (e.g., using
  6539. `waitpid').
  6540. `tms:cstime'
  6541. Similarly, the CPU times units used by the system on behalf of
  6542. terminated child processes.
  6543. ** Removed: list-length
  6544. ** Removed: list-append, list-append!
  6545. ** Removed: list-reverse, list-reverse!
  6546. ** array-map renamed to array-map!
  6547. ** serial-array-map renamed to serial-array-map!
  6548. ** catch doesn't take #f as first argument any longer
  6549. Previously, it was possible to pass #f instead of a key to `catch'.
  6550. That would cause `catch' to pass a jump buffer object to the procedure
  6551. passed as second argument. The procedure could then use this jump
  6552. buffer objekt as an argument to throw.
  6553. This mechanism has been removed since its utility doesn't motivate the
  6554. extra complexity it introduces.
  6555. ** The `#/' notation for lists now provokes a warning message from Guile.
  6556. This syntax will be removed from Guile in the near future.
  6557. To disable the warning message, set the GUILE_HUSH environment
  6558. variable to any non-empty value.
  6559. ** The newline character now prints as `#\newline', following the
  6560. normal Scheme notation, not `#\nl'.
  6561. * Changes to the gh_ interface
  6562. ** The gh_enter function now takes care of loading the Guile startup files.
  6563. gh_enter works by calling scm_boot_guile; see the remarks below.
  6564. ** Function: void gh_write (SCM x)
  6565. Write the printed representation of the scheme object x to the current
  6566. output port. Corresponds to the scheme level `write'.
  6567. ** gh_list_length renamed to gh_length.
  6568. ** vector handling routines
  6569. Several major changes. In particular, gh_vector() now resembles
  6570. (vector ...) (with a caveat -- see manual), and gh_make_vector() now
  6571. exists and behaves like (make-vector ...). gh_vset() and gh_vref()
  6572. have been renamed gh_vector_set_x() and gh_vector_ref(). Some missing
  6573. vector-related gh_ functions have been implemented.
  6574. ** pair and list routines
  6575. Implemented several of the R4RS pair and list functions that were
  6576. missing.
  6577. ** gh_scm2doubles, gh_doubles2scm, gh_doubles2dvect
  6578. New function. Converts double arrays back and forth between Scheme
  6579. and C.
  6580. * Changes to the scm_ interface
  6581. ** The function scm_boot_guile now takes care of loading the startup files.
  6582. Guile's primary initialization function, scm_boot_guile, now takes
  6583. care of loading `boot-9.scm', in the `ice-9' module, to initialize
  6584. Guile, define the module system, and put together some standard
  6585. bindings. It also loads `init.scm', which is intended to hold
  6586. site-specific initialization code.
  6587. Since Guile cannot operate properly until boot-9.scm is loaded, there
  6588. is no reason to separate loading boot-9.scm from Guile's other
  6589. initialization processes.
  6590. This job used to be done by scm_compile_shell_switches, which didn't
  6591. make much sense; in particular, it meant that people using Guile for
  6592. non-shell-like applications had to jump through hoops to get Guile
  6593. initialized properly.
  6594. ** The function scm_compile_shell_switches no longer loads the startup files.
  6595. Now, Guile always loads the startup files, whenever it is initialized;
  6596. see the notes above for scm_boot_guile and scm_load_startup_files.
  6597. ** Function: scm_load_startup_files
  6598. This new function takes care of loading Guile's initialization file
  6599. (`boot-9.scm'), and the site initialization file, `init.scm'. Since
  6600. this is always called by the Guile initialization process, it's
  6601. probably not too useful to call this yourself, but it's there anyway.
  6602. ** The semantics of smob marking have changed slightly.
  6603. The smob marking function (the `mark' member of the scm_smobfuns
  6604. structure) is no longer responsible for setting the mark bit on the
  6605. smob. The generic smob handling code in the garbage collector will
  6606. set this bit. The mark function need only ensure that any other
  6607. objects the smob refers to get marked.
  6608. Note that this change means that the smob's GC8MARK bit is typically
  6609. already set upon entry to the mark function. Thus, marking functions
  6610. which look like this:
  6611. {
  6612. if (SCM_GC8MARKP (ptr))
  6613. return SCM_BOOL_F;
  6614. SCM_SETGC8MARK (ptr);
  6615. ... mark objects to which the smob refers ...
  6616. }
  6617. are now incorrect, since they will return early, and fail to mark any
  6618. other objects the smob refers to. Some code in the Guile library used
  6619. to work this way.
  6620. ** The semantics of the I/O port functions in scm_ptobfuns have changed.
  6621. If you have implemented your own I/O port type, by writing the
  6622. functions required by the scm_ptobfuns and then calling scm_newptob,
  6623. you will need to change your functions slightly.
  6624. The functions in a scm_ptobfuns structure now expect the port itself
  6625. as their argument; they used to expect the `stream' member of the
  6626. port's scm_port_table structure. This allows functions in an
  6627. scm_ptobfuns structure to easily access the port's cell (and any flags
  6628. it its CAR), and the port's scm_port_table structure.
  6629. Guile now passes the I/O port itself as the `port' argument in the
  6630. following scm_ptobfuns functions:
  6631. int (*free) (SCM port);
  6632. int (*fputc) (int, SCM port);
  6633. int (*fputs) (char *, SCM port);
  6634. scm_sizet (*fwrite) SCM_P ((char *ptr,
  6635. scm_sizet size,
  6636. scm_sizet nitems,
  6637. SCM port));
  6638. int (*fflush) (SCM port);
  6639. int (*fgetc) (SCM port);
  6640. int (*fclose) (SCM port);
  6641. The interfaces to the `mark', `print', `equalp', and `fgets' methods
  6642. are unchanged.
  6643. If you have existing code which defines its own port types, it is easy
  6644. to convert your code to the new interface; simply apply SCM_STREAM to
  6645. the port argument to yield the value you code used to expect.
  6646. Note that since both the port and the stream have the same type in the
  6647. C code --- they are both SCM values --- the C compiler will not remind
  6648. you if you forget to update your scm_ptobfuns functions.
  6649. ** Function: int scm_internal_select (int fds,
  6650. SELECT_TYPE *rfds,
  6651. SELECT_TYPE *wfds,
  6652. SELECT_TYPE *efds,
  6653. struct timeval *timeout);
  6654. This is a replacement for the `select' function provided by the OS.
  6655. It enables I/O blocking and sleeping to happen for one cooperative
  6656. thread without blocking other threads. It also avoids busy-loops in
  6657. these situations. It is intended that all I/O blocking and sleeping
  6658. will finally go through this function. Currently, this function is
  6659. only available on systems providing `gettimeofday' and `select'.
  6660. ** Function: SCM scm_internal_stack_catch (SCM tag,
  6661. scm_catch_body_t body,
  6662. void *body_data,
  6663. scm_catch_handler_t handler,
  6664. void *handler_data)
  6665. A new sibling to the other two C level `catch' functions
  6666. scm_internal_catch and scm_internal_lazy_catch. Use it if you want
  6667. the stack to be saved automatically into the variable `the-last-stack'
  6668. (scm_the_last_stack_var) on error. This is necessary if you want to
  6669. use advanced error reporting, such as calling scm_display_error and
  6670. scm_display_backtrace. (They both take a stack object as argument.)
  6671. ** Function: SCM scm_spawn_thread (scm_catch_body_t body,
  6672. void *body_data,
  6673. scm_catch_handler_t handler,
  6674. void *handler_data)
  6675. Spawns a new thread. It does a job similar to
  6676. scm_call_with_new_thread but takes arguments more suitable when
  6677. spawning threads from application C code.
  6678. ** The hook scm_error_callback has been removed. It was originally
  6679. intended as a way for the user to install his own error handler. But
  6680. that method works badly since it intervenes between throw and catch,
  6681. thereby changing the semantics of expressions like (catch #t ...).
  6682. The correct way to do it is to use one of the C level catch functions
  6683. in throw.c: scm_internal_catch/lazy_catch/stack_catch.
  6684. ** Removed functions:
  6685. scm_obj_length, scm_list_length, scm_list_append, scm_list_append_x,
  6686. scm_list_reverse, scm_list_reverse_x
  6687. ** New macros: SCM_LISTn where n is one of the integers 0-9.
  6688. These can be used for pretty list creation from C. The idea is taken
  6689. from Erick Gallesio's STk.
  6690. ** scm_array_map renamed to scm_array_map_x
  6691. ** mbstrings are now removed
  6692. This means that the type codes scm_tc7_mb_string and
  6693. scm_tc7_mb_substring has been removed.
  6694. ** scm_gen_putc, scm_gen_puts, scm_gen_write, and scm_gen_getc have changed.
  6695. Since we no longer support multi-byte strings, these I/O functions
  6696. have been simplified, and renamed. Here are their old names, and
  6697. their new names and arguments:
  6698. scm_gen_putc -> void scm_putc (int c, SCM port);
  6699. scm_gen_puts -> void scm_puts (char *s, SCM port);
  6700. scm_gen_write -> void scm_lfwrite (char *ptr, scm_sizet size, SCM port);
  6701. scm_gen_getc -> void scm_getc (SCM port);
  6702. ** The macros SCM_TYP7D and SCM_TYP7SD has been removed.
  6703. ** The macro SCM_TYP7S has taken the role of the old SCM_TYP7D
  6704. SCM_TYP7S now masks away the bit which distinguishes substrings from
  6705. strings.
  6706. ** scm_catch_body_t: Backward incompatible change!
  6707. Body functions to scm_internal_catch and friends do not any longer
  6708. take a second argument. This is because it is no longer possible to
  6709. pass a #f arg to catch.
  6710. ** Calls to scm_protect_object and scm_unprotect now nest properly.
  6711. The function scm_protect_object protects its argument from being freed
  6712. by the garbage collector. scm_unprotect_object removes that
  6713. protection.
  6714. These functions now nest properly. That is, for every object O, there
  6715. is a counter which scm_protect_object(O) increments and
  6716. scm_unprotect_object(O) decrements, if the counter is greater than
  6717. zero. Every object's counter is zero when it is first created. If an
  6718. object's counter is greater than zero, the garbage collector will not
  6719. reclaim its storage.
  6720. This allows you to use scm_protect_object in your code without
  6721. worrying that some other function you call will call
  6722. scm_unprotect_object, and allow it to be freed. Assuming that the
  6723. functions you call are well-behaved, and unprotect only those objects
  6724. they protect, you can follow the same rule and have confidence that
  6725. objects will be freed only at appropriate times.
  6726. Changes in Guile 1.2 (released Tuesday, June 24 1997):
  6727. * Changes to the distribution
  6728. ** Nightly snapshots are now available from ftp.red-bean.com.
  6729. The old server, ftp.cyclic.com, has been relinquished to its rightful
  6730. owner.
  6731. Nightly snapshots of the Guile development sources are now available via
  6732. anonymous FTP from ftp.red-bean.com, as /pub/guile/guile-snap.tar.gz.
  6733. Via the web, that's: ftp://ftp.red-bean.com/pub/guile/guile-snap.tar.gz
  6734. For getit, that's: ftp.red-bean.com:/pub/guile/guile-snap.tar.gz
  6735. ** To run Guile without installing it, the procedure has changed a bit.
  6736. If you used a separate build directory to compile Guile, you'll need
  6737. to include the build directory in SCHEME_LOAD_PATH, as well as the
  6738. source directory. See the `INSTALL' file for examples.
  6739. * Changes to the procedure for linking libguile with your programs
  6740. ** The standard Guile load path for Scheme code now includes
  6741. $(datadir)/guile (usually /usr/local/share/guile). This means that
  6742. you can install your own Scheme files there, and Guile will find them.
  6743. (Previous versions of Guile only checked a directory whose name
  6744. contained the Guile version number, so you had to re-install or move
  6745. your Scheme sources each time you installed a fresh version of Guile.)
  6746. The load path also includes $(datadir)/guile/site; we recommend
  6747. putting individual Scheme files there. If you want to install a
  6748. package with multiple source files, create a directory for them under
  6749. $(datadir)/guile.
  6750. ** Guile 1.2 will now use the Rx regular expression library, if it is
  6751. installed on your system. When you are linking libguile into your own
  6752. programs, this means you will have to link against -lguile, -lqt (if
  6753. you configured Guile with thread support), and -lrx.
  6754. If you are using autoconf to generate configuration scripts for your
  6755. application, the following lines should suffice to add the appropriate
  6756. libraries to your link command:
  6757. ### Find Rx, quickthreads and libguile.
  6758. AC_CHECK_LIB(rx, main)
  6759. AC_CHECK_LIB(qt, main)
  6760. AC_CHECK_LIB(guile, scm_shell)
  6761. The Guile 1.2 distribution does not contain sources for the Rx
  6762. library, as Guile 1.0 did. If you want to use Rx, you'll need to
  6763. retrieve it from a GNU FTP site and install it separately.
  6764. * Changes to Scheme functions and syntax
  6765. ** The dynamic linking features of Guile are now enabled by default.
  6766. You can disable them by giving the `--disable-dynamic-linking' option
  6767. to configure.
  6768. (dynamic-link FILENAME)
  6769. Find the object file denoted by FILENAME (a string) and link it
  6770. into the running Guile application. When everything works out,
  6771. return a Scheme object suitable for representing the linked object
  6772. file. Otherwise an error is thrown. How object files are
  6773. searched is system dependent.
  6774. (dynamic-object? VAL)
  6775. Determine whether VAL represents a dynamically linked object file.
  6776. (dynamic-unlink DYNOBJ)
  6777. Unlink the indicated object file from the application. DYNOBJ
  6778. should be one of the values returned by `dynamic-link'.
  6779. (dynamic-func FUNCTION DYNOBJ)
  6780. Search the C function indicated by FUNCTION (a string or symbol)
  6781. in DYNOBJ and return some Scheme object that can later be used
  6782. with `dynamic-call' to actually call this function. Right now,
  6783. these Scheme objects are formed by casting the address of the
  6784. function to `long' and converting this number to its Scheme
  6785. representation.
  6786. (dynamic-call FUNCTION DYNOBJ)
  6787. Call the C function indicated by FUNCTION and DYNOBJ. The
  6788. function is passed no arguments and its return value is ignored.
  6789. When FUNCTION is something returned by `dynamic-func', call that
  6790. function and ignore DYNOBJ. When FUNCTION is a string (or symbol,
  6791. etc.), look it up in DYNOBJ; this is equivalent to
  6792. (dynamic-call (dynamic-func FUNCTION DYNOBJ) #f)
  6793. Interrupts are deferred while the C function is executing (with
  6794. SCM_DEFER_INTS/SCM_ALLOW_INTS).
  6795. (dynamic-args-call FUNCTION DYNOBJ ARGS)
  6796. Call the C function indicated by FUNCTION and DYNOBJ, but pass it
  6797. some arguments and return its return value. The C function is
  6798. expected to take two arguments and return an `int', just like
  6799. `main':
  6800. int c_func (int argc, char **argv);
  6801. ARGS must be a list of strings and is converted into an array of
  6802. `char *'. The array is passed in ARGV and its size in ARGC. The
  6803. return value is converted to a Scheme number and returned from the
  6804. call to `dynamic-args-call'.
  6805. When dynamic linking is disabled or not supported on your system,
  6806. the above functions throw errors, but they are still available.
  6807. Here is a small example that works on GNU/Linux:
  6808. (define libc-obj (dynamic-link "libc.so"))
  6809. (dynamic-args-call 'rand libc-obj '())
  6810. See the file `libguile/DYNAMIC-LINKING' for additional comments.
  6811. ** The #/ syntax for module names is depreciated, and will be removed
  6812. in a future version of Guile. Instead of
  6813. #/foo/bar/baz
  6814. instead write
  6815. (foo bar baz)
  6816. The latter syntax is more consistent with existing Lisp practice.
  6817. ** Guile now does fancier printing of structures. Structures are the
  6818. underlying implementation for records, which in turn are used to
  6819. implement modules, so all of these object now print differently and in
  6820. a more informative way.
  6821. The Scheme printer will examine the builtin variable *struct-printer*
  6822. whenever it needs to print a structure object. When this variable is
  6823. not `#f' it is deemed to be a procedure and will be applied to the
  6824. structure object and the output port. When *struct-printer* is `#f'
  6825. or the procedure return `#f' the structure object will be printed in
  6826. the boring #<struct 80458270> form.
  6827. This hook is used by some routines in ice-9/boot-9.scm to implement
  6828. type specific printing routines. Please read the comments there about
  6829. "printing structs".
  6830. One of the more specific uses of structs are records. The printing
  6831. procedure that could be passed to MAKE-RECORD-TYPE is now actually
  6832. called. It should behave like a *struct-printer* procedure (described
  6833. above).
  6834. ** Guile now supports a new R4RS-compliant syntax for keywords. A
  6835. token of the form #:NAME, where NAME has the same syntax as a Scheme
  6836. symbol, is the external representation of the keyword named NAME.
  6837. Keyword objects print using this syntax as well, so values containing
  6838. keyword objects can be read back into Guile. When used in an
  6839. expression, keywords are self-quoting objects.
  6840. Guile suports this read syntax, and uses this print syntax, regardless
  6841. of the current setting of the `keyword' read option. The `keyword'
  6842. read option only controls whether Guile recognizes the `:NAME' syntax,
  6843. which is incompatible with R4RS. (R4RS says such token represent
  6844. symbols.)
  6845. ** Guile has regular expression support again. Guile 1.0 included
  6846. functions for matching regular expressions, based on the Rx library.
  6847. In Guile 1.1, the Guile/Rx interface was removed to simplify the
  6848. distribution, and thus Guile had no regular expression support. Guile
  6849. 1.2 again supports the most commonly used functions, and supports all
  6850. of SCSH's regular expression functions.
  6851. If your system does not include a POSIX regular expression library,
  6852. and you have not linked Guile with a third-party regexp library such as
  6853. Rx, these functions will not be available. You can tell whether your
  6854. Guile installation includes regular expression support by checking
  6855. whether the `*features*' list includes the `regex' symbol.
  6856. *** regexp functions
  6857. By default, Guile supports POSIX extended regular expressions. That
  6858. means that the characters `(', `)', `+' and `?' are special, and must
  6859. be escaped if you wish to match the literal characters.
  6860. This regular expression interface was modeled after that implemented
  6861. by SCSH, the Scheme Shell. It is intended to be upwardly compatible
  6862. with SCSH regular expressions.
  6863. **** Function: string-match PATTERN STR [START]
  6864. Compile the string PATTERN into a regular expression and compare
  6865. it with STR. The optional numeric argument START specifies the
  6866. position of STR at which to begin matching.
  6867. `string-match' returns a "match structure" which describes what,
  6868. if anything, was matched by the regular expression. *Note Match
  6869. Structures::. If STR does not match PATTERN at all,
  6870. `string-match' returns `#f'.
  6871. Each time `string-match' is called, it must compile its PATTERN
  6872. argument into a regular expression structure. This operation is
  6873. expensive, which makes `string-match' inefficient if the same regular
  6874. expression is used several times (for example, in a loop). For better
  6875. performance, you can compile a regular expression in advance and then
  6876. match strings against the compiled regexp.
  6877. **** Function: make-regexp STR [FLAGS]
  6878. Compile the regular expression described by STR, and return the
  6879. compiled regexp structure. If STR does not describe a legal
  6880. regular expression, `make-regexp' throws a
  6881. `regular-expression-syntax' error.
  6882. FLAGS may be the bitwise-or of one or more of the following:
  6883. **** Constant: regexp/extended
  6884. Use POSIX Extended Regular Expression syntax when interpreting
  6885. STR. If not set, POSIX Basic Regular Expression syntax is used.
  6886. If the FLAGS argument is omitted, we assume regexp/extended.
  6887. **** Constant: regexp/icase
  6888. Do not differentiate case. Subsequent searches using the
  6889. returned regular expression will be case insensitive.
  6890. **** Constant: regexp/newline
  6891. Match-any-character operators don't match a newline.
  6892. A non-matching list ([^...]) not containing a newline matches a
  6893. newline.
  6894. Match-beginning-of-line operator (^) matches the empty string
  6895. immediately after a newline, regardless of whether the FLAGS
  6896. passed to regexp-exec contain regexp/notbol.
  6897. Match-end-of-line operator ($) matches the empty string
  6898. immediately before a newline, regardless of whether the FLAGS
  6899. passed to regexp-exec contain regexp/noteol.
  6900. **** Function: regexp-exec REGEXP STR [START [FLAGS]]
  6901. Match the compiled regular expression REGEXP against `str'. If
  6902. the optional integer START argument is provided, begin matching
  6903. from that position in the string. Return a match structure
  6904. describing the results of the match, or `#f' if no match could be
  6905. found.
  6906. FLAGS may be the bitwise-or of one or more of the following:
  6907. **** Constant: regexp/notbol
  6908. The match-beginning-of-line operator always fails to match (but
  6909. see the compilation flag regexp/newline above) This flag may be
  6910. used when different portions of a string are passed to
  6911. regexp-exec and the beginning of the string should not be
  6912. interpreted as the beginning of the line.
  6913. **** Constant: regexp/noteol
  6914. The match-end-of-line operator always fails to match (but see the
  6915. compilation flag regexp/newline above)
  6916. **** Function: regexp? OBJ
  6917. Return `#t' if OBJ is a compiled regular expression, or `#f'
  6918. otherwise.
  6919. Regular expressions are commonly used to find patterns in one string
  6920. and replace them with the contents of another string.
  6921. **** Function: regexp-substitute PORT MATCH [ITEM...]
  6922. Write to the output port PORT selected contents of the match
  6923. structure MATCH. Each ITEM specifies what should be written, and
  6924. may be one of the following arguments:
  6925. * A string. String arguments are written out verbatim.
  6926. * An integer. The submatch with that number is written.
  6927. * The symbol `pre'. The portion of the matched string preceding
  6928. the regexp match is written.
  6929. * The symbol `post'. The portion of the matched string
  6930. following the regexp match is written.
  6931. PORT may be `#f', in which case nothing is written; instead,
  6932. `regexp-substitute' constructs a string from the specified ITEMs
  6933. and returns that.
  6934. **** Function: regexp-substitute/global PORT REGEXP TARGET [ITEM...]
  6935. Similar to `regexp-substitute', but can be used to perform global
  6936. substitutions on STR. Instead of taking a match structure as an
  6937. argument, `regexp-substitute/global' takes two string arguments: a
  6938. REGEXP string describing a regular expression, and a TARGET string
  6939. which should be matched against this regular expression.
  6940. Each ITEM behaves as in REGEXP-SUBSTITUTE, with the following
  6941. exceptions:
  6942. * A function may be supplied. When this function is called, it
  6943. will be passed one argument: a match structure for a given
  6944. regular expression match. It should return a string to be
  6945. written out to PORT.
  6946. * The `post' symbol causes `regexp-substitute/global' to recurse
  6947. on the unmatched portion of STR. This *must* be supplied in
  6948. order to perform global search-and-replace on STR; if it is
  6949. not present among the ITEMs, then `regexp-substitute/global'
  6950. will return after processing a single match.
  6951. *** Match Structures
  6952. A "match structure" is the object returned by `string-match' and
  6953. `regexp-exec'. It describes which portion of a string, if any, matched
  6954. the given regular expression. Match structures include: a reference to
  6955. the string that was checked for matches; the starting and ending
  6956. positions of the regexp match; and, if the regexp included any
  6957. parenthesized subexpressions, the starting and ending positions of each
  6958. submatch.
  6959. In each of the regexp match functions described below, the `match'
  6960. argument must be a match structure returned by a previous call to
  6961. `string-match' or `regexp-exec'. Most of these functions return some
  6962. information about the original target string that was matched against a
  6963. regular expression; we will call that string TARGET for easy reference.
  6964. **** Function: regexp-match? OBJ
  6965. Return `#t' if OBJ is a match structure returned by a previous
  6966. call to `regexp-exec', or `#f' otherwise.
  6967. **** Function: match:substring MATCH [N]
  6968. Return the portion of TARGET matched by subexpression number N.
  6969. Submatch 0 (the default) represents the entire regexp match. If
  6970. the regular expression as a whole matched, but the subexpression
  6971. number N did not match, return `#f'.
  6972. **** Function: match:start MATCH [N]
  6973. Return the starting position of submatch number N.
  6974. **** Function: match:end MATCH [N]
  6975. Return the ending position of submatch number N.
  6976. **** Function: match:prefix MATCH
  6977. Return the unmatched portion of TARGET preceding the regexp match.
  6978. **** Function: match:suffix MATCH
  6979. Return the unmatched portion of TARGET following the regexp match.
  6980. **** Function: match:count MATCH
  6981. Return the number of parenthesized subexpressions from MATCH.
  6982. Note that the entire regular expression match itself counts as a
  6983. subexpression, and failed submatches are included in the count.
  6984. **** Function: match:string MATCH
  6985. Return the original TARGET string.
  6986. *** Backslash Escapes
  6987. Sometimes you will want a regexp to match characters like `*' or `$'
  6988. exactly. For example, to check whether a particular string represents
  6989. a menu entry from an Info node, it would be useful to match it against
  6990. a regexp like `^* [^:]*::'. However, this won't work; because the
  6991. asterisk is a metacharacter, it won't match the `*' at the beginning of
  6992. the string. In this case, we want to make the first asterisk un-magic.
  6993. You can do this by preceding the metacharacter with a backslash
  6994. character `\'. (This is also called "quoting" the metacharacter, and
  6995. is known as a "backslash escape".) When Guile sees a backslash in a
  6996. regular expression, it considers the following glyph to be an ordinary
  6997. character, no matter what special meaning it would ordinarily have.
  6998. Therefore, we can make the above example work by changing the regexp to
  6999. `^\* [^:]*::'. The `\*' sequence tells the regular expression engine
  7000. to match only a single asterisk in the target string.
  7001. Since the backslash is itself a metacharacter, you may force a
  7002. regexp to match a backslash in the target string by preceding the
  7003. backslash with itself. For example, to find variable references in a
  7004. TeX program, you might want to find occurrences of the string `\let\'
  7005. followed by any number of alphabetic characters. The regular expression
  7006. `\\let\\[A-Za-z]*' would do this: the double backslashes in the regexp
  7007. each match a single backslash in the target string.
  7008. **** Function: regexp-quote STR
  7009. Quote each special character found in STR with a backslash, and
  7010. return the resulting string.
  7011. *Very important:* Using backslash escapes in Guile source code (as
  7012. in Emacs Lisp or C) can be tricky, because the backslash character has
  7013. special meaning for the Guile reader. For example, if Guile encounters
  7014. the character sequence `\n' in the middle of a string while processing
  7015. Scheme code, it replaces those characters with a newline character.
  7016. Similarly, the character sequence `\t' is replaced by a horizontal tab.
  7017. Several of these "escape sequences" are processed by the Guile reader
  7018. before your code is executed. Unrecognized escape sequences are
  7019. ignored: if the characters `\*' appear in a string, they will be
  7020. translated to the single character `*'.
  7021. This translation is obviously undesirable for regular expressions,
  7022. since we want to be able to include backslashes in a string in order to
  7023. escape regexp metacharacters. Therefore, to make sure that a backslash
  7024. is preserved in a string in your Guile program, you must use *two*
  7025. consecutive backslashes:
  7026. (define Info-menu-entry-pattern (make-regexp "^\\* [^:]*"))
  7027. The string in this example is preprocessed by the Guile reader before
  7028. any code is executed. The resulting argument to `make-regexp' is the
  7029. string `^\* [^:]*', which is what we really want.
  7030. This also means that in order to write a regular expression that
  7031. matches a single backslash character, the regular expression string in
  7032. the source code must include *four* backslashes. Each consecutive pair
  7033. of backslashes gets translated by the Guile reader to a single
  7034. backslash, and the resulting double-backslash is interpreted by the
  7035. regexp engine as matching a single backslash character. Hence:
  7036. (define tex-variable-pattern (make-regexp "\\\\let\\\\=[A-Za-z]*"))
  7037. The reason for the unwieldiness of this syntax is historical. Both
  7038. regular expression pattern matchers and Unix string processing systems
  7039. have traditionally used backslashes with the special meanings described
  7040. above. The POSIX regular expression specification and ANSI C standard
  7041. both require these semantics. Attempting to abandon either convention
  7042. would cause other kinds of compatibility problems, possibly more severe
  7043. ones. Therefore, without extending the Scheme reader to support
  7044. strings with different quoting conventions (an ungainly and confusing
  7045. extension when implemented in other languages), we must adhere to this
  7046. cumbersome escape syntax.
  7047. * Changes to the gh_ interface
  7048. * Changes to the scm_ interface
  7049. * Changes to system call interfaces:
  7050. ** The value returned by `raise' is now unspecified. It throws an exception
  7051. if an error occurs.
  7052. *** A new procedure `sigaction' can be used to install signal handlers
  7053. (sigaction signum [action] [flags])
  7054. signum is the signal number, which can be specified using the value
  7055. of SIGINT etc.
  7056. If action is omitted, sigaction returns a pair: the CAR is the current
  7057. signal hander, which will be either an integer with the value SIG_DFL
  7058. (default action) or SIG_IGN (ignore), or the Scheme procedure which
  7059. handles the signal, or #f if a non-Scheme procedure handles the
  7060. signal. The CDR contains the current sigaction flags for the handler.
  7061. If action is provided, it is installed as the new handler for signum.
  7062. action can be a Scheme procedure taking one argument, or the value of
  7063. SIG_DFL (default action) or SIG_IGN (ignore), or #f to restore
  7064. whatever signal handler was installed before sigaction was first used.
  7065. Flags can optionally be specified for the new handler (SA_RESTART is
  7066. always used if the system provides it, so need not be specified.) The
  7067. return value is a pair with information about the old handler as
  7068. described above.
  7069. This interface does not provide access to the "signal blocking"
  7070. facility. Maybe this is not needed, since the thread support may
  7071. provide solutions to the problem of consistent access to data
  7072. structures.
  7073. *** A new procedure `flush-all-ports' is equivalent to running
  7074. `force-output' on every port open for output.
  7075. ** Guile now provides information on how it was built, via the new
  7076. global variable, %guile-build-info. This variable records the values
  7077. of the standard GNU makefile directory variables as an assocation
  7078. list, mapping variable names (symbols) onto directory paths (strings).
  7079. For example, to find out where the Guile link libraries were
  7080. installed, you can say:
  7081. guile -c "(display (assq-ref %guile-build-info 'libdir)) (newline)"
  7082. * Changes to the scm_ interface
  7083. ** The new function scm_handle_by_message_noexit is just like the
  7084. existing scm_handle_by_message function, except that it doesn't call
  7085. exit to terminate the process. Instead, it prints a message and just
  7086. returns #f. This might be a more appropriate catch-all handler for
  7087. new dynamic roots and threads.
  7088. Changes in Guile 1.1 (released Friday, May 16 1997):
  7089. * Changes to the distribution.
  7090. The Guile 1.0 distribution has been split up into several smaller
  7091. pieces:
  7092. guile-core --- the Guile interpreter itself.
  7093. guile-tcltk --- the interface between the Guile interpreter and
  7094. Tcl/Tk; Tcl is an interpreter for a stringy language, and Tk
  7095. is a toolkit for building graphical user interfaces.
  7096. guile-rgx-ctax --- the interface between Guile and the Rx regular
  7097. expression matcher, and the translator for the Ctax
  7098. programming language. These are packaged together because the
  7099. Ctax translator uses Rx to parse Ctax source code.
  7100. This NEWS file describes the changes made to guile-core since the 1.0
  7101. release.
  7102. We no longer distribute the documentation, since it was either out of
  7103. date, or incomplete. As soon as we have current documentation, we
  7104. will distribute it.
  7105. * Changes to the stand-alone interpreter
  7106. ** guile now accepts command-line arguments compatible with SCSH, Olin
  7107. Shivers' Scheme Shell.
  7108. In general, arguments are evaluated from left to right, but there are
  7109. exceptions. The following switches stop argument processing, and
  7110. stash all remaining command-line arguments as the value returned by
  7111. the (command-line) function.
  7112. -s SCRIPT load Scheme source code from FILE, and exit
  7113. -c EXPR evalute Scheme expression EXPR, and exit
  7114. -- stop scanning arguments; run interactively
  7115. The switches below are processed as they are encountered.
  7116. -l FILE load Scheme source code from FILE
  7117. -e FUNCTION after reading script, apply FUNCTION to
  7118. command line arguments
  7119. -ds do -s script at this point
  7120. --emacs enable Emacs protocol (experimental)
  7121. -h, --help display this help and exit
  7122. -v, --version display version information and exit
  7123. \ read arguments from following script lines
  7124. So, for example, here is a Guile script named `ekko' (thanks, Olin)
  7125. which re-implements the traditional "echo" command:
  7126. #!/usr/local/bin/guile -s
  7127. !#
  7128. (define (main args)
  7129. (map (lambda (arg) (display arg) (display " "))
  7130. (cdr args))
  7131. (newline))
  7132. (main (command-line))
  7133. Suppose we invoke this script as follows:
  7134. ekko a speckled gecko
  7135. Through the magic of Unix script processing (triggered by the `#!'
  7136. token at the top of the file), /usr/local/bin/guile receives the
  7137. following list of command-line arguments:
  7138. ("-s" "./ekko" "a" "speckled" "gecko")
  7139. Unix inserts the name of the script after the argument specified on
  7140. the first line of the file (in this case, "-s"), and then follows that
  7141. with the arguments given to the script. Guile loads the script, which
  7142. defines the `main' function, and then applies it to the list of
  7143. remaining command-line arguments, ("a" "speckled" "gecko").
  7144. In Unix, the first line of a script file must take the following form:
  7145. #!INTERPRETER ARGUMENT
  7146. where INTERPRETER is the absolute filename of the interpreter
  7147. executable, and ARGUMENT is a single command-line argument to pass to
  7148. the interpreter.
  7149. You may only pass one argument to the interpreter, and its length is
  7150. limited. These restrictions can be annoying to work around, so Guile
  7151. provides a general mechanism (borrowed from, and compatible with,
  7152. SCSH) for circumventing them.
  7153. If the ARGUMENT in a Guile script is a single backslash character,
  7154. `\', Guile will open the script file, parse arguments from its second
  7155. and subsequent lines, and replace the `\' with them. So, for example,
  7156. here is another implementation of the `ekko' script:
  7157. #!/usr/local/bin/guile \
  7158. -e main -s
  7159. !#
  7160. (define (main args)
  7161. (for-each (lambda (arg) (display arg) (display " "))
  7162. (cdr args))
  7163. (newline))
  7164. If the user invokes this script as follows:
  7165. ekko a speckled gecko
  7166. Unix expands this into
  7167. /usr/local/bin/guile \ ekko a speckled gecko
  7168. When Guile sees the `\' argument, it replaces it with the arguments
  7169. read from the second line of the script, producing:
  7170. /usr/local/bin/guile -e main -s ekko a speckled gecko
  7171. This tells Guile to load the `ekko' script, and apply the function
  7172. `main' to the argument list ("a" "speckled" "gecko").
  7173. Here is how Guile parses the command-line arguments:
  7174. - Each space character terminates an argument. This means that two
  7175. spaces in a row introduce an empty-string argument.
  7176. - The tab character is not permitted (unless you quote it with the
  7177. backslash character, as described below), to avoid confusion.
  7178. - The newline character terminates the sequence of arguments, and will
  7179. also terminate a final non-empty argument. (However, a newline
  7180. following a space will not introduce a final empty-string argument;
  7181. it only terminates the argument list.)
  7182. - The backslash character is the escape character. It escapes
  7183. backslash, space, tab, and newline. The ANSI C escape sequences
  7184. like \n and \t are also supported. These produce argument
  7185. constituents; the two-character combination \n doesn't act like a
  7186. terminating newline. The escape sequence \NNN for exactly three
  7187. octal digits reads as the character whose ASCII code is NNN. As
  7188. above, characters produced this way are argument constituents.
  7189. Backslash followed by other characters is not allowed.
  7190. * Changes to the procedure for linking libguile with your programs
  7191. ** Guile now builds and installs a shared guile library, if your
  7192. system support shared libraries. (It still builds a static library on
  7193. all systems.) Guile automatically detects whether your system
  7194. supports shared libraries. To prevent Guile from buildisg shared
  7195. libraries, pass the `--disable-shared' flag to the configure script.
  7196. Guile takes longer to compile when it builds shared libraries, because
  7197. it must compile every file twice --- once to produce position-
  7198. independent object code, and once to produce normal object code.
  7199. ** The libthreads library has been merged into libguile.
  7200. To link a program against Guile, you now need only link against
  7201. -lguile and -lqt; -lthreads is no longer needed. If you are using
  7202. autoconf to generate configuration scripts for your application, the
  7203. following lines should suffice to add the appropriate libraries to
  7204. your link command:
  7205. ### Find quickthreads and libguile.
  7206. AC_CHECK_LIB(qt, main)
  7207. AC_CHECK_LIB(guile, scm_shell)
  7208. * Changes to Scheme functions
  7209. ** Guile Scheme's special syntax for keyword objects is now optional,
  7210. and disabled by default.
  7211. The syntax variation from R4RS made it difficult to port some
  7212. interesting packages to Guile. The routines which accepted keyword
  7213. arguments (mostly in the module system) have been modified to also
  7214. accept symbols whose names begin with `:'.
  7215. To change the keyword syntax, you must first import the (ice-9 debug)
  7216. module:
  7217. (use-modules (ice-9 debug))
  7218. Then you can enable the keyword syntax as follows:
  7219. (read-set! keywords 'prefix)
  7220. To disable keyword syntax, do this:
  7221. (read-set! keywords #f)
  7222. ** Many more primitive functions accept shared substrings as
  7223. arguments. In the past, these functions required normal, mutable
  7224. strings as arguments, although they never made use of this
  7225. restriction.
  7226. ** The uniform array functions now operate on byte vectors. These
  7227. functions are `array-fill!', `serial-array-copy!', `array-copy!',
  7228. `serial-array-map', `array-map', `array-for-each', and
  7229. `array-index-map!'.
  7230. ** The new functions `trace' and `untrace' implement simple debugging
  7231. support for Scheme functions.
  7232. The `trace' function accepts any number of procedures as arguments,
  7233. and tells the Guile interpreter to display each procedure's name and
  7234. arguments each time the procedure is invoked. When invoked with no
  7235. arguments, `trace' returns the list of procedures currently being
  7236. traced.
  7237. The `untrace' function accepts any number of procedures as arguments,
  7238. and tells the Guile interpreter not to trace them any more. When
  7239. invoked with no arguments, `untrace' untraces all curretly traced
  7240. procedures.
  7241. The tracing in Guile has an advantage over most other systems: we
  7242. don't create new procedure objects, but mark the procedure objects
  7243. themselves. This means that anonymous and internal procedures can be
  7244. traced.
  7245. ** The function `assert-repl-prompt' has been renamed to
  7246. `set-repl-prompt!'. It takes one argument, PROMPT.
  7247. - If PROMPT is #f, the Guile read-eval-print loop will not prompt.
  7248. - If PROMPT is a string, we use it as a prompt.
  7249. - If PROMPT is a procedure accepting no arguments, we call it, and
  7250. display the result as a prompt.
  7251. - Otherwise, we display "> ".
  7252. ** The new function `eval-string' reads Scheme expressions from a
  7253. string and evaluates them, returning the value of the last expression
  7254. in the string. If the string contains no expressions, it returns an
  7255. unspecified value.
  7256. ** The new function `thunk?' returns true iff its argument is a
  7257. procedure of zero arguments.
  7258. ** `defined?' is now a builtin function, instead of syntax. This
  7259. means that its argument should be quoted. It returns #t iff its
  7260. argument is bound in the current module.
  7261. ** The new syntax `use-modules' allows you to add new modules to your
  7262. environment without re-typing a complete `define-module' form. It
  7263. accepts any number of module names as arguments, and imports their
  7264. public bindings into the current module.
  7265. ** The new function (module-defined? NAME MODULE) returns true iff
  7266. NAME, a symbol, is defined in MODULE, a module object.
  7267. ** The new function `builtin-bindings' creates and returns a hash
  7268. table containing copies of all the root module's bindings.
  7269. ** The new function `builtin-weak-bindings' does the same as
  7270. `builtin-bindings', but creates a doubly-weak hash table.
  7271. ** The `equal?' function now considers variable objects to be
  7272. equivalent if they have the same name and the same value.
  7273. ** The new function `command-line' returns the command-line arguments
  7274. given to Guile, as a list of strings.
  7275. When using guile as a script interpreter, `command-line' returns the
  7276. script's arguments; those processed by the interpreter (like `-s' or
  7277. `-c') are omitted. (In other words, you get the normal, expected
  7278. behavior.) Any application that uses scm_shell to process its
  7279. command-line arguments gets this behavior as well.
  7280. ** The new function `load-user-init' looks for a file called `.guile'
  7281. in the user's home directory, and loads it if it exists. This is
  7282. mostly for use by the code generated by scm_compile_shell_switches,
  7283. but we thought it might also be useful in other circumstances.
  7284. ** The new function `log10' returns the base-10 logarithm of its
  7285. argument.
  7286. ** Changes to I/O functions
  7287. *** The functions `read', `primitive-load', `read-and-eval!', and
  7288. `primitive-load-path' no longer take optional arguments controlling
  7289. case insensitivity and a `#' parser.
  7290. Case sensitivity is now controlled by a read option called
  7291. `case-insensitive'. The user can add new `#' syntaxes with the
  7292. `read-hash-extend' function (see below).
  7293. *** The new function `read-hash-extend' allows the user to change the
  7294. syntax of Guile Scheme in a somewhat controlled way.
  7295. (read-hash-extend CHAR PROC)
  7296. When parsing S-expressions, if we read a `#' character followed by
  7297. the character CHAR, use PROC to parse an object from the stream.
  7298. If PROC is #f, remove any parsing procedure registered for CHAR.
  7299. The reader applies PROC to two arguments: CHAR and an input port.
  7300. *** The new functions read-delimited and read-delimited! provide a
  7301. general mechanism for doing delimited input on streams.
  7302. (read-delimited DELIMS [PORT HANDLE-DELIM])
  7303. Read until we encounter one of the characters in DELIMS (a string),
  7304. or end-of-file. PORT is the input port to read from; it defaults to
  7305. the current input port. The HANDLE-DELIM parameter determines how
  7306. the terminating character is handled; it should be one of the
  7307. following symbols:
  7308. 'trim omit delimiter from result
  7309. 'peek leave delimiter character in input stream
  7310. 'concat append delimiter character to returned value
  7311. 'split return a pair: (RESULT . TERMINATOR)
  7312. HANDLE-DELIM defaults to 'peek.
  7313. (read-delimited! DELIMS BUF [PORT HANDLE-DELIM START END])
  7314. A side-effecting variant of `read-delimited'.
  7315. The data is written into the string BUF at the indices in the
  7316. half-open interval [START, END); the default interval is the whole
  7317. string: START = 0 and END = (string-length BUF). The values of
  7318. START and END must specify a well-defined interval in BUF, i.e.
  7319. 0 <= START <= END <= (string-length BUF).
  7320. It returns NBYTES, the number of bytes read. If the buffer filled
  7321. up without a delimiter character being found, it returns #f. If the
  7322. port is at EOF when the read starts, it returns the EOF object.
  7323. If an integer is returned (i.e., the read is successfully terminated
  7324. by reading a delimiter character), then the HANDLE-DELIM parameter
  7325. determines how to handle the terminating character. It is described
  7326. above, and defaults to 'peek.
  7327. (The descriptions of these functions were borrowed from the SCSH
  7328. manual, by Olin Shivers and Brian Carlstrom.)
  7329. *** The `%read-delimited!' function is the primitive used to implement
  7330. `read-delimited' and `read-delimited!'.
  7331. (%read-delimited! DELIMS BUF GOBBLE? [PORT START END])
  7332. This returns a pair of values: (TERMINATOR . NUM-READ).
  7333. - TERMINATOR describes why the read was terminated. If it is a
  7334. character or the eof object, then that is the value that terminated
  7335. the read. If it is #f, the function filled the buffer without finding
  7336. a delimiting character.
  7337. - NUM-READ is the number of characters read into BUF.
  7338. If the read is successfully terminated by reading a delimiter
  7339. character, then the gobble? parameter determines what to do with the
  7340. terminating character. If true, the character is removed from the
  7341. input stream; if false, the character is left in the input stream
  7342. where a subsequent read operation will retrieve it. In either case,
  7343. the character is also the first value returned by the procedure call.
  7344. (The descriptions of this function was borrowed from the SCSH manual,
  7345. by Olin Shivers and Brian Carlstrom.)
  7346. *** The `read-line' and `read-line!' functions have changed; they now
  7347. trim the terminator by default; previously they appended it to the
  7348. returned string. For the old behavior, use (read-line PORT 'concat).
  7349. *** The functions `uniform-array-read!' and `uniform-array-write!' now
  7350. take new optional START and END arguments, specifying the region of
  7351. the array to read and write.
  7352. *** The `ungetc-char-ready?' function has been removed. We feel it's
  7353. inappropriate for an interface to expose implementation details this
  7354. way.
  7355. ** Changes to the Unix library and system call interface
  7356. *** The new fcntl function provides access to the Unix `fcntl' system
  7357. call.
  7358. (fcntl PORT COMMAND VALUE)
  7359. Apply COMMAND to PORT's file descriptor, with VALUE as an argument.
  7360. Values for COMMAND are:
  7361. F_DUPFD duplicate a file descriptor
  7362. F_GETFD read the descriptor's close-on-exec flag
  7363. F_SETFD set the descriptor's close-on-exec flag to VALUE
  7364. F_GETFL read the descriptor's flags, as set on open
  7365. F_SETFL set the descriptor's flags, as set on open to VALUE
  7366. F_GETOWN return the process ID of a socket's owner, for SIGIO
  7367. F_SETOWN set the process that owns a socket to VALUE, for SIGIO
  7368. FD_CLOEXEC not sure what this is
  7369. For details, see the documentation for the fcntl system call.
  7370. *** The arguments to `select' have changed, for compatibility with
  7371. SCSH. The TIMEOUT parameter may now be non-integral, yielding the
  7372. expected behavior. The MILLISECONDS parameter has been changed to
  7373. MICROSECONDS, to more closely resemble the underlying system call.
  7374. The RVEC, WVEC, and EVEC arguments can now be vectors; the type of the
  7375. corresponding return set will be the same.
  7376. *** The arguments to the `mknod' system call have changed. They are
  7377. now:
  7378. (mknod PATH TYPE PERMS DEV)
  7379. Create a new file (`node') in the file system. PATH is the name of
  7380. the file to create. TYPE is the kind of file to create; it should
  7381. be 'fifo, 'block-special, or 'char-special. PERMS specifies the
  7382. permission bits to give the newly created file. If TYPE is
  7383. 'block-special or 'char-special, DEV specifies which device the
  7384. special file refers to; its interpretation depends on the kind of
  7385. special file being created.
  7386. *** The `fork' function has been renamed to `primitive-fork', to avoid
  7387. clashing with various SCSH forks.
  7388. *** The `recv' and `recvfrom' functions have been renamed to `recv!'
  7389. and `recvfrom!'. They no longer accept a size for a second argument;
  7390. you must pass a string to hold the received value. They no longer
  7391. return the buffer. Instead, `recv' returns the length of the message
  7392. received, and `recvfrom' returns a pair containing the packet's length
  7393. and originating address.
  7394. *** The file descriptor datatype has been removed, as have the
  7395. `read-fd', `write-fd', `close', `lseek', and `dup' functions.
  7396. We plan to replace these functions with a SCSH-compatible interface.
  7397. *** The `create' function has been removed; it's just a special case
  7398. of `open'.
  7399. *** There are new functions to break down process termination status
  7400. values. In the descriptions below, STATUS is a value returned by
  7401. `waitpid'.
  7402. (status:exit-val STATUS)
  7403. If the child process exited normally, this function returns the exit
  7404. code for the child process (i.e., the value passed to exit, or
  7405. returned from main). If the child process did not exit normally,
  7406. this function returns #f.
  7407. (status:stop-sig STATUS)
  7408. If the child process was suspended by a signal, this function
  7409. returns the signal that suspended the child. Otherwise, it returns
  7410. #f.
  7411. (status:term-sig STATUS)
  7412. If the child process terminated abnormally, this function returns
  7413. the signal that terminated the child. Otherwise, this function
  7414. returns false.
  7415. POSIX promises that exactly one of these functions will return true on
  7416. a valid STATUS value.
  7417. These functions are compatible with SCSH.
  7418. *** There are new accessors and setters for the broken-out time vectors
  7419. returned by `localtime', `gmtime', and that ilk. They are:
  7420. Component Accessor Setter
  7421. ========================= ============ ============
  7422. seconds tm:sec set-tm:sec
  7423. minutes tm:min set-tm:min
  7424. hours tm:hour set-tm:hour
  7425. day of the month tm:mday set-tm:mday
  7426. month tm:mon set-tm:mon
  7427. year tm:year set-tm:year
  7428. day of the week tm:wday set-tm:wday
  7429. day in the year tm:yday set-tm:yday
  7430. daylight saving time tm:isdst set-tm:isdst
  7431. GMT offset, seconds tm:gmtoff set-tm:gmtoff
  7432. name of time zone tm:zone set-tm:zone
  7433. *** There are new accessors for the vectors returned by `uname',
  7434. describing the host system:
  7435. Component Accessor
  7436. ============================================== ================
  7437. name of the operating system implementation utsname:sysname
  7438. network name of this machine utsname:nodename
  7439. release level of the operating system utsname:release
  7440. version level of the operating system utsname:version
  7441. machine hardware platform utsname:machine
  7442. *** There are new accessors for the vectors returned by `getpw',
  7443. `getpwnam', `getpwuid', and `getpwent', describing entries from the
  7444. system's user database:
  7445. Component Accessor
  7446. ====================== =================
  7447. user name passwd:name
  7448. user password passwd:passwd
  7449. user id passwd:uid
  7450. group id passwd:gid
  7451. real name passwd:gecos
  7452. home directory passwd:dir
  7453. shell program passwd:shell
  7454. *** There are new accessors for the vectors returned by `getgr',
  7455. `getgrnam', `getgrgid', and `getgrent', describing entries from the
  7456. system's group database:
  7457. Component Accessor
  7458. ======================= ============
  7459. group name group:name
  7460. group password group:passwd
  7461. group id group:gid
  7462. group members group:mem
  7463. *** There are new accessors for the vectors returned by `gethost',
  7464. `gethostbyaddr', `gethostbyname', and `gethostent', describing
  7465. internet hosts:
  7466. Component Accessor
  7467. ========================= ===============
  7468. official name of host hostent:name
  7469. alias list hostent:aliases
  7470. host address type hostent:addrtype
  7471. length of address hostent:length
  7472. list of addresses hostent:addr-list
  7473. *** There are new accessors for the vectors returned by `getnet',
  7474. `getnetbyaddr', `getnetbyname', and `getnetent', describing internet
  7475. networks:
  7476. Component Accessor
  7477. ========================= ===============
  7478. official name of net netent:name
  7479. alias list netent:aliases
  7480. net number type netent:addrtype
  7481. net number netent:net
  7482. *** There are new accessors for the vectors returned by `getproto',
  7483. `getprotobyname', `getprotobynumber', and `getprotoent', describing
  7484. internet protocols:
  7485. Component Accessor
  7486. ========================= ===============
  7487. official protocol name protoent:name
  7488. alias list protoent:aliases
  7489. protocol number protoent:proto
  7490. *** There are new accessors for the vectors returned by `getserv',
  7491. `getservbyname', `getservbyport', and `getservent', describing
  7492. internet protocols:
  7493. Component Accessor
  7494. ========================= ===============
  7495. official service name servent:name
  7496. alias list servent:aliases
  7497. port number servent:port
  7498. protocol to use servent:proto
  7499. *** There are new accessors for the sockaddr structures returned by
  7500. `accept', `getsockname', `getpeername', `recvfrom!':
  7501. Component Accessor
  7502. ======================================== ===============
  7503. address format (`family') sockaddr:fam
  7504. path, for file domain addresses sockaddr:path
  7505. address, for internet domain addresses sockaddr:addr
  7506. TCP or UDP port, for internet sockaddr:port
  7507. *** The `getpwent', `getgrent', `gethostent', `getnetent',
  7508. `getprotoent', and `getservent' functions now return #f at the end of
  7509. the user database. (They used to throw an exception.)
  7510. Note that calling MUMBLEent function is equivalent to calling the
  7511. corresponding MUMBLE function with no arguments.
  7512. *** The `setpwent', `setgrent', `sethostent', `setnetent',
  7513. `setprotoent', and `setservent' routines now take no arguments.
  7514. *** The `gethost', `getproto', `getnet', and `getserv' functions now
  7515. provide more useful information when they throw an exception.
  7516. *** The `lnaof' function has been renamed to `inet-lnaof'.
  7517. *** Guile now claims to have the `current-time' feature.
  7518. *** The `mktime' function now takes an optional second argument ZONE,
  7519. giving the time zone to use for the conversion. ZONE should be a
  7520. string, in the same format as expected for the "TZ" environment variable.
  7521. *** The `strptime' function now returns a pair (TIME . COUNT), where
  7522. TIME is the parsed time as a vector, and COUNT is the number of
  7523. characters from the string left unparsed. This function used to
  7524. return the remaining characters as a string.
  7525. *** The `gettimeofday' function has replaced the old `time+ticks' function.
  7526. The return value is now (SECONDS . MICROSECONDS); the fractional
  7527. component is no longer expressed in "ticks".
  7528. *** The `ticks/sec' constant has been removed, in light of the above change.
  7529. * Changes to the gh_ interface
  7530. ** gh_eval_str() now returns an SCM object which is the result of the
  7531. evaluation
  7532. ** gh_scm2str() now copies the Scheme data to a caller-provided C
  7533. array
  7534. ** gh_scm2newstr() now makes a C array, copies the Scheme data to it,
  7535. and returns the array
  7536. ** gh_scm2str0() is gone: there is no need to distinguish
  7537. null-terminated from non-null-terminated, since gh_scm2newstr() allows
  7538. the user to interpret the data both ways.
  7539. * Changes to the scm_ interface
  7540. ** The new function scm_symbol_value0 provides an easy way to get a
  7541. symbol's value from C code:
  7542. SCM scm_symbol_value0 (char *NAME)
  7543. Return the value of the symbol named by the null-terminated string
  7544. NAME in the current module. If the symbol named NAME is unbound in
  7545. the current module, return SCM_UNDEFINED.
  7546. ** The new function scm_sysintern0 creates new top-level variables,
  7547. without assigning them a value.
  7548. SCM scm_sysintern0 (char *NAME)
  7549. Create a new Scheme top-level variable named NAME. NAME is a
  7550. null-terminated string. Return the variable's value cell.
  7551. ** The function scm_internal_catch is the guts of catch. It handles
  7552. all the mechanics of setting up a catch target, invoking the catch
  7553. body, and perhaps invoking the handler if the body does a throw.
  7554. The function is designed to be usable from C code, but is general
  7555. enough to implement all the semantics Guile Scheme expects from throw.
  7556. TAG is the catch tag. Typically, this is a symbol, but this function
  7557. doesn't actually care about that.
  7558. BODY is a pointer to a C function which runs the body of the catch;
  7559. this is the code you can throw from. We call it like this:
  7560. BODY (BODY_DATA, JMPBUF)
  7561. where:
  7562. BODY_DATA is just the BODY_DATA argument we received; we pass it
  7563. through to BODY as its first argument. The caller can make
  7564. BODY_DATA point to anything useful that BODY might need.
  7565. JMPBUF is the Scheme jmpbuf object corresponding to this catch,
  7566. which we have just created and initialized.
  7567. HANDLER is a pointer to a C function to deal with a throw to TAG,
  7568. should one occur. We call it like this:
  7569. HANDLER (HANDLER_DATA, THROWN_TAG, THROW_ARGS)
  7570. where
  7571. HANDLER_DATA is the HANDLER_DATA argument we recevied; it's the
  7572. same idea as BODY_DATA above.
  7573. THROWN_TAG is the tag that the user threw to; usually this is
  7574. TAG, but it could be something else if TAG was #t (i.e., a
  7575. catch-all), or the user threw to a jmpbuf.
  7576. THROW_ARGS is the list of arguments the user passed to the THROW
  7577. function.
  7578. BODY_DATA is just a pointer we pass through to BODY. HANDLER_DATA
  7579. is just a pointer we pass through to HANDLER. We don't actually
  7580. use either of those pointers otherwise ourselves. The idea is
  7581. that, if our caller wants to communicate something to BODY or
  7582. HANDLER, it can pass a pointer to it as MUMBLE_DATA, which BODY and
  7583. HANDLER can then use. Think of it as a way to make BODY and
  7584. HANDLER closures, not just functions; MUMBLE_DATA points to the
  7585. enclosed variables.
  7586. Of course, it's up to the caller to make sure that any data a
  7587. MUMBLE_DATA needs is protected from GC. A common way to do this is
  7588. to make MUMBLE_DATA a pointer to data stored in an automatic
  7589. structure variable; since the collector must scan the stack for
  7590. references anyway, this assures that any references in MUMBLE_DATA
  7591. will be found.
  7592. ** The new function scm_internal_lazy_catch is exactly like
  7593. scm_internal_catch, except:
  7594. - It does not unwind the stack (this is the major difference).
  7595. - If handler returns, its value is returned from the throw.
  7596. - BODY always receives #f as its JMPBUF argument (since there's no
  7597. jmpbuf associated with a lazy catch, because we don't unwind the
  7598. stack.)
  7599. ** scm_body_thunk is a new body function you can pass to
  7600. scm_internal_catch if you want the body to be like Scheme's `catch'
  7601. --- a thunk, or a function of one argument if the tag is #f.
  7602. BODY_DATA is a pointer to a scm_body_thunk_data structure, which
  7603. contains the Scheme procedure to invoke as the body, and the tag
  7604. we're catching. If the tag is #f, then we pass JMPBUF (created by
  7605. scm_internal_catch) to the body procedure; otherwise, the body gets
  7606. no arguments.
  7607. ** scm_handle_by_proc is a new handler function you can pass to
  7608. scm_internal_catch if you want the handler to act like Scheme's catch
  7609. --- call a procedure with the tag and the throw arguments.
  7610. If the user does a throw to this catch, this function runs a handler
  7611. procedure written in Scheme. HANDLER_DATA is a pointer to an SCM
  7612. variable holding the Scheme procedure object to invoke. It ought to
  7613. be a pointer to an automatic variable (i.e., one living on the stack),
  7614. or the procedure object should be otherwise protected from GC.
  7615. ** scm_handle_by_message is a new handler function to use with
  7616. `scm_internal_catch' if you want Guile to print a message and die.
  7617. It's useful for dealing with throws to uncaught keys at the top level.
  7618. HANDLER_DATA, if non-zero, is assumed to be a char * pointing to a
  7619. message header to print; if zero, we use "guile" instead. That
  7620. text is followed by a colon, then the message described by ARGS.
  7621. ** The return type of scm_boot_guile is now void; the function does
  7622. not return a value, and indeed, never returns at all.
  7623. ** The new function scm_shell makes it easy for user applications to
  7624. process command-line arguments in a way that is compatible with the
  7625. stand-alone guile interpreter (which is in turn compatible with SCSH,
  7626. the Scheme shell).
  7627. To use the scm_shell function, first initialize any guile modules
  7628. linked into your application, and then call scm_shell with the values
  7629. of ARGC and ARGV your `main' function received. scm_shell will add
  7630. any SCSH-style meta-arguments from the top of the script file to the
  7631. argument vector, and then process the command-line arguments. This
  7632. generally means loading a script file or starting up an interactive
  7633. command interpreter. For details, see "Changes to the stand-alone
  7634. interpreter" above.
  7635. ** The new functions scm_get_meta_args and scm_count_argv help you
  7636. implement the SCSH-style meta-argument, `\'.
  7637. char **scm_get_meta_args (int ARGC, char **ARGV)
  7638. If the second element of ARGV is a string consisting of a single
  7639. backslash character (i.e. "\\" in Scheme notation), open the file
  7640. named by the following argument, parse arguments from it, and return
  7641. the spliced command line. The returned array is terminated by a
  7642. null pointer.
  7643. For details of argument parsing, see above, under "guile now accepts
  7644. command-line arguments compatible with SCSH..."
  7645. int scm_count_argv (char **ARGV)
  7646. Count the arguments in ARGV, assuming it is terminated by a null
  7647. pointer.
  7648. For an example of how these functions might be used, see the source
  7649. code for the function scm_shell in libguile/script.c.
  7650. You will usually want to use scm_shell instead of calling this
  7651. function yourself.
  7652. ** The new function scm_compile_shell_switches turns an array of
  7653. command-line arguments into Scheme code to carry out the actions they
  7654. describe. Given ARGC and ARGV, it returns a Scheme expression to
  7655. evaluate, and calls scm_set_program_arguments to make any remaining
  7656. command-line arguments available to the Scheme code. For example,
  7657. given the following arguments:
  7658. -e main -s ekko a speckled gecko
  7659. scm_set_program_arguments will return the following expression:
  7660. (begin (load "ekko") (main (command-line)) (quit))
  7661. You will usually want to use scm_shell instead of calling this
  7662. function yourself.
  7663. ** The function scm_shell_usage prints a usage message appropriate for
  7664. an interpreter that uses scm_compile_shell_switches to handle its
  7665. command-line arguments.
  7666. void scm_shell_usage (int FATAL, char *MESSAGE)
  7667. Print a usage message to the standard error output. If MESSAGE is
  7668. non-zero, write it before the usage message, followed by a newline.
  7669. If FATAL is non-zero, exit the process, using FATAL as the
  7670. termination status. (If you want to be compatible with Guile,
  7671. always use 1 as the exit status when terminating due to command-line
  7672. usage problems.)
  7673. You will usually want to use scm_shell instead of calling this
  7674. function yourself.
  7675. ** scm_eval_0str now returns SCM_UNSPECIFIED if the string contains no
  7676. expressions. It used to return SCM_EOL. Earth-shattering.
  7677. ** The macros for declaring scheme objects in C code have been
  7678. rearranged slightly. They are now:
  7679. SCM_SYMBOL (C_NAME, SCHEME_NAME)
  7680. Declare a static SCM variable named C_NAME, and initialize it to
  7681. point to the Scheme symbol whose name is SCHEME_NAME. C_NAME should
  7682. be a C identifier, and SCHEME_NAME should be a C string.
  7683. SCM_GLOBAL_SYMBOL (C_NAME, SCHEME_NAME)
  7684. Just like SCM_SYMBOL, but make C_NAME globally visible.
  7685. SCM_VCELL (C_NAME, SCHEME_NAME)
  7686. Create a global variable at the Scheme level named SCHEME_NAME.
  7687. Declare a static SCM variable named C_NAME, and initialize it to
  7688. point to the Scheme variable's value cell.
  7689. SCM_GLOBAL_VCELL (C_NAME, SCHEME_NAME)
  7690. Just like SCM_VCELL, but make C_NAME globally visible.
  7691. The `guile-snarf' script writes initialization code for these macros
  7692. to its standard output, given C source code as input.
  7693. The SCM_GLOBAL macro is gone.
  7694. ** The scm_read_line and scm_read_line_x functions have been replaced
  7695. by Scheme code based on the %read-delimited! procedure (known to C
  7696. code as scm_read_delimited_x). See its description above for more
  7697. information.
  7698. ** The function scm_sys_open has been renamed to scm_open. It now
  7699. returns a port instead of an FD object.
  7700. * The dynamic linking support has changed. For more information, see
  7701. libguile/DYNAMIC-LINKING.
  7702. Guile 1.0b3
  7703. User-visible changes from Thursday, September 5, 1996 until Guile 1.0
  7704. (Sun 5 Jan 1997):
  7705. * Changes to the 'guile' program:
  7706. ** Guile now loads some new files when it starts up. Guile first
  7707. searches the load path for init.scm, and loads it if found. Then, if
  7708. Guile is not being used to execute a script, and the user's home
  7709. directory contains a file named `.guile', Guile loads that.
  7710. ** You can now use Guile as a shell script interpreter.
  7711. To paraphrase the SCSH manual:
  7712. When Unix tries to execute an executable file whose first two
  7713. characters are the `#!', it treats the file not as machine code to
  7714. be directly executed by the native processor, but as source code
  7715. to be executed by some interpreter. The interpreter to use is
  7716. specified immediately after the #! sequence on the first line of
  7717. the source file. The kernel reads in the name of the interpreter,
  7718. and executes that instead. It passes the interpreter the source
  7719. filename as its first argument, with the original arguments
  7720. following. Consult the Unix man page for the `exec' system call
  7721. for more information.
  7722. Now you can use Guile as an interpreter, using a mechanism which is a
  7723. compatible subset of that provided by SCSH.
  7724. Guile now recognizes a '-s' command line switch, whose argument is the
  7725. name of a file of Scheme code to load. It also treats the two
  7726. characters `#!' as the start of a comment, terminated by `!#'. Thus,
  7727. to make a file of Scheme code directly executable by Unix, insert the
  7728. following two lines at the top of the file:
  7729. #!/usr/local/bin/guile -s
  7730. !#
  7731. Guile treats the argument of the `-s' command-line switch as the name
  7732. of a file of Scheme code to load, and treats the sequence `#!' as the
  7733. start of a block comment, terminated by `!#'.
  7734. For example, here's a version of 'echo' written in Scheme:
  7735. #!/usr/local/bin/guile -s
  7736. !#
  7737. (let loop ((args (cdr (program-arguments))))
  7738. (if (pair? args)
  7739. (begin
  7740. (display (car args))
  7741. (if (pair? (cdr args))
  7742. (display " "))
  7743. (loop (cdr args)))))
  7744. (newline)
  7745. Why does `#!' start a block comment terminated by `!#', instead of the
  7746. end of the line? That is the notation SCSH uses, and although we
  7747. don't yet support the other SCSH features that motivate that choice,
  7748. we would like to be backward-compatible with any existing Guile
  7749. scripts once we do. Furthermore, if the path to Guile on your system
  7750. is too long for your kernel, you can start the script with this
  7751. horrible hack:
  7752. #!/bin/sh
  7753. exec /really/long/path/to/guile -s "$0" ${1+"$@"}
  7754. !#
  7755. Note that some very old Unix systems don't support the `#!' syntax.
  7756. ** You can now run Guile without installing it.
  7757. Previous versions of the interactive Guile interpreter (`guile')
  7758. couldn't start up unless Guile's Scheme library had been installed;
  7759. they used the value of the environment variable `SCHEME_LOAD_PATH'
  7760. later on in the startup process, but not to find the startup code
  7761. itself. Now Guile uses `SCHEME_LOAD_PATH' in all searches for Scheme
  7762. code.
  7763. To run Guile without installing it, build it in the normal way, and
  7764. then set the environment variable `SCHEME_LOAD_PATH' to a
  7765. colon-separated list of directories, including the top-level directory
  7766. of the Guile sources. For example, if you unpacked Guile so that the
  7767. full filename of this NEWS file is /home/jimb/guile-1.0b3/NEWS, then
  7768. you might say
  7769. export SCHEME_LOAD_PATH=/home/jimb/my-scheme:/home/jimb/guile-1.0b3
  7770. ** Guile's read-eval-print loop no longer prints #<unspecified>
  7771. results. If the user wants to see this, she can evaluate the
  7772. expression (assert-repl-print-unspecified #t), perhaps in her startup
  7773. file.
  7774. ** Guile no longer shows backtraces by default when an error occurs;
  7775. however, it does display a message saying how to get one, and how to
  7776. request that they be displayed by default. After an error, evaluate
  7777. (backtrace)
  7778. to see a backtrace, and
  7779. (debug-enable 'backtrace)
  7780. to see them by default.
  7781. * Changes to Guile Scheme:
  7782. ** Guile now distinguishes between #f and the empty list.
  7783. This is for compatibility with the IEEE standard, the (possibly)
  7784. upcoming Revised^5 Report on Scheme, and many extant Scheme
  7785. implementations.
  7786. Guile used to have #f and '() denote the same object, to make Scheme's
  7787. type system more compatible with Emacs Lisp's. However, the change
  7788. caused too much trouble for Scheme programmers, and we found another
  7789. way to reconcile Emacs Lisp with Scheme that didn't require this.
  7790. ** Guile's delq, delv, delete functions, and their destructive
  7791. counterparts, delq!, delv!, and delete!, now remove all matching
  7792. elements from the list, not just the first. This matches the behavior
  7793. of the corresponding Emacs Lisp functions, and (I believe) the Maclisp
  7794. functions which inspired them.
  7795. I recognize that this change may break code in subtle ways, but it
  7796. seems best to make the change before the FSF's first Guile release,
  7797. rather than after.
  7798. ** The compiled-library-path function has been deleted from libguile.
  7799. ** The facilities for loading Scheme source files have changed.
  7800. *** The variable %load-path now tells Guile which directories to search
  7801. for Scheme code. Its value is a list of strings, each of which names
  7802. a directory.
  7803. *** The variable %load-extensions now tells Guile which extensions to
  7804. try appending to a filename when searching the load path. Its value
  7805. is a list of strings. Its default value is ("" ".scm").
  7806. *** (%search-load-path FILENAME) searches the directories listed in the
  7807. value of the %load-path variable for a Scheme file named FILENAME,
  7808. with all the extensions listed in %load-extensions. If it finds a
  7809. match, then it returns its full filename. If FILENAME is absolute, it
  7810. returns it unchanged. Otherwise, it returns #f.
  7811. %search-load-path will not return matches that refer to directories.
  7812. *** (primitive-load FILENAME :optional CASE-INSENSITIVE-P SHARP)
  7813. uses %seach-load-path to find a file named FILENAME, and loads it if
  7814. it finds it. If it can't read FILENAME for any reason, it throws an
  7815. error.
  7816. The arguments CASE-INSENSITIVE-P and SHARP are interpreted as by the
  7817. `read' function.
  7818. *** load uses the same searching semantics as primitive-load.
  7819. *** The functions %try-load, try-load-with-path, %load, load-with-path,
  7820. basic-try-load-with-path, basic-load-with-path, try-load-module-with-
  7821. path, and load-module-with-path have been deleted. The functions
  7822. above should serve their purposes.
  7823. *** If the value of the variable %load-hook is a procedure,
  7824. `primitive-load' applies its value to the name of the file being
  7825. loaded (without the load path directory name prepended). If its value
  7826. is #f, it is ignored. Otherwise, an error occurs.
  7827. This is mostly useful for printing load notification messages.
  7828. ** The function `eval!' is no longer accessible from the scheme level.
  7829. We can't allow operations which introduce glocs into the scheme level,
  7830. because Guile's type system can't handle these as data. Use `eval' or
  7831. `read-and-eval!' (see below) as replacement.
  7832. ** The new function read-and-eval! reads an expression from PORT,
  7833. evaluates it, and returns the result. This is more efficient than
  7834. simply calling `read' and `eval', since it is not necessary to make a
  7835. copy of the expression for the evaluator to munge.
  7836. Its optional arguments CASE_INSENSITIVE_P and SHARP are interpreted as
  7837. for the `read' function.
  7838. ** The function `int?' has been removed; its definition was identical
  7839. to that of `integer?'.
  7840. ** The functions `<?', `<?', `<=?', `=?', `>?', and `>=?'. Code should
  7841. use the R4RS names for these functions.
  7842. ** The function object-properties no longer returns the hash handle;
  7843. it simply returns the object's property list.
  7844. ** Many functions have been changed to throw errors, instead of
  7845. returning #f on failure. The point of providing exception handling in
  7846. the language is to simplify the logic of user code, but this is less
  7847. useful if Guile's primitives don't throw exceptions.
  7848. ** The function `fileno' has been renamed from `%fileno'.
  7849. ** The function primitive-mode->fdes returns #t or #f now, not 1 or 0.
  7850. * Changes to Guile's C interface:
  7851. ** The library's initialization procedure has been simplified.
  7852. scm_boot_guile now has the prototype:
  7853. void scm_boot_guile (int ARGC,
  7854. char **ARGV,
  7855. void (*main_func) (),
  7856. void *closure);
  7857. scm_boot_guile calls MAIN_FUNC, passing it CLOSURE, ARGC, and ARGV.
  7858. MAIN_FUNC should do all the work of the program (initializing other
  7859. packages, reading user input, etc.) before returning. When MAIN_FUNC
  7860. returns, call exit (0); this function never returns. If you want some
  7861. other exit value, MAIN_FUNC may call exit itself.
  7862. scm_boot_guile arranges for program-arguments to return the strings
  7863. given by ARGC and ARGV. If MAIN_FUNC modifies ARGC/ARGV, should call
  7864. scm_set_program_arguments with the final list, so Scheme code will
  7865. know which arguments have been processed.
  7866. scm_boot_guile establishes a catch-all catch handler which prints an
  7867. error message and exits the process. This means that Guile exits in a
  7868. coherent way when system errors occur and the user isn't prepared to
  7869. handle it. If the user doesn't like this behavior, they can establish
  7870. their own universal catcher in MAIN_FUNC to shadow this one.
  7871. Why must the caller do all the real work from MAIN_FUNC? The garbage
  7872. collector assumes that all local variables of type SCM will be above
  7873. scm_boot_guile's stack frame on the stack. If you try to manipulate
  7874. SCM values after this function returns, it's the luck of the draw
  7875. whether the GC will be able to find the objects you allocate. So,
  7876. scm_boot_guile function exits, rather than returning, to discourage
  7877. people from making that mistake.
  7878. The IN, OUT, and ERR arguments were removed; there are other
  7879. convenient ways to override these when desired.
  7880. The RESULT argument was deleted; this function should never return.
  7881. The BOOT_CMD argument was deleted; the MAIN_FUNC argument is more
  7882. general.
  7883. ** Guile's header files should no longer conflict with your system's
  7884. header files.
  7885. In order to compile code which #included <libguile.h>, previous
  7886. versions of Guile required you to add a directory containing all the
  7887. Guile header files to your #include path. This was a problem, since
  7888. Guile's header files have names which conflict with many systems'
  7889. header files.
  7890. Now only <libguile.h> need appear in your #include path; you must
  7891. refer to all Guile's other header files as <libguile/mumble.h>.
  7892. Guile's installation procedure puts libguile.h in $(includedir), and
  7893. the rest in $(includedir)/libguile.
  7894. ** Two new C functions, scm_protect_object and scm_unprotect_object,
  7895. have been added to the Guile library.
  7896. scm_protect_object (OBJ) protects OBJ from the garbage collector.
  7897. OBJ will not be freed, even if all other references are dropped,
  7898. until someone does scm_unprotect_object (OBJ). Both functions
  7899. return OBJ.
  7900. Note that calls to scm_protect_object do not nest. You can call
  7901. scm_protect_object any number of times on a given object, and the
  7902. next call to scm_unprotect_object will unprotect it completely.
  7903. Basically, scm_protect_object and scm_unprotect_object just
  7904. maintain a list of references to things. Since the GC knows about
  7905. this list, all objects it mentions stay alive. scm_protect_object
  7906. adds its argument to the list; scm_unprotect_object remove its
  7907. argument from the list.
  7908. ** scm_eval_0str now returns the value of the last expression
  7909. evaluated.
  7910. ** The new function scm_read_0str reads an s-expression from a
  7911. null-terminated string, and returns it.
  7912. ** The new function `scm_stdio_to_port' converts a STDIO file pointer
  7913. to a Scheme port object.
  7914. ** The new function `scm_set_program_arguments' allows C code to set
  7915. the value returned by the Scheme `program-arguments' function.
  7916. Older changes:
  7917. * Guile no longer includes sophisticated Tcl/Tk support.
  7918. The old Tcl/Tk support was unsatisfying to us, because it required the
  7919. user to link against the Tcl library, as well as Tk and Guile. The
  7920. interface was also un-lispy, in that it preserved Tcl/Tk's practice of
  7921. referring to widgets by names, rather than exporting widgets to Scheme
  7922. code as a special datatype.
  7923. In the Usenix Tk Developer's Workshop held in July 1996, the Tcl/Tk
  7924. maintainers described some very interesting changes in progress to the
  7925. Tcl/Tk internals, which would facilitate clean interfaces between lone
  7926. Tk and other interpreters --- even for garbage-collected languages
  7927. like Scheme. They expected the new Tk to be publicly available in the
  7928. fall of 1996.
  7929. Since it seems that Guile might soon have a new, cleaner interface to
  7930. lone Tk, and that the old Guile/Tk glue code would probably need to be
  7931. completely rewritten, we (Jim Blandy and Richard Stallman) have
  7932. decided not to support the old code. We'll spend the time instead on
  7933. a good interface to the newer Tk, as soon as it is available.
  7934. Until then, gtcltk-lib provides trivial, low-maintenance functionality.
  7935. Copyright information:
  7936. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
  7937. Permission is granted to anyone to make or distribute verbatim copies
  7938. of this document as received, in any medium, provided that the
  7939. copyright notice and this permission notice are preserved,
  7940. thus giving the recipient permission to redistribute in turn.
  7941. Permission is granted to distribute modified versions
  7942. of this document, or of portions of it,
  7943. under the above conditions, provided also that they
  7944. carry prominent notices stating who last changed them.
  7945. Local variables:
  7946. mode: outline
  7947. paragraph-separate: "[ ]*$"
  7948. end: