NEWS 369 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029
  1. Guile NEWS --- history of user-visible changes.
  2. Copyright (C) 1996-2012 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.0.5 (since 2.0.4):
  6. This release fixes the binary interface information (SONAME) of
  7. libguile, which was incorrect in 2.0.4. It does not contain other
  8. changes.
  9. Changes in 2.0.4 (since 2.0.3):
  10. * Notable changes
  11. ** Better debuggability for interpreted procedures.
  12. Guile 2.0 came with a great debugging experience for compiled
  13. procedures, but the story for interpreted procedures was terrible. Now,
  14. at least, interpreted procedures have names, and the `arity' procedure
  15. property is always correct (or, as correct as it can be, in the presence
  16. of `case-lambda').
  17. ** Support for cross-compilation.
  18. One can now use a native Guile to cross-compile `.go' files for a
  19. different architecture. See the documentation for `--target' in the
  20. "Compilation" section of the manual, for information on how to use the
  21. cross-compiler. See the "Cross building Guile" section of the README,
  22. for more on how to cross-compile Guile itself.
  23. ** The return of `local-eval'.
  24. Back by popular demand, `the-environment' and `local-eval' allow the
  25. user to capture a lexical environment, and then evaluate arbitrary
  26. expressions in that context. There is also a new `local-compile'
  27. command. See "Local Evaluation" in the manual, for more. Special
  28. thanks to Mark Weaver for an initial implementation of this feature.
  29. ** Fluids can now have default values.
  30. Fluids are used for dynamic and thread-local binding. They have always
  31. inherited their values from the context or thread that created them.
  32. However, there was a case in which a new thread would enter Guile, and
  33. the default values of all the fluids would be `#f' for that thread.
  34. This has now been fixed so that `make-fluid' has an optional default
  35. value for fluids in unrelated dynamic roots, which defaults to `#f'.
  36. ** Garbage collector tuning.
  37. The garbage collector has now been tuned to run more often under some
  38. circumstances.
  39. *** Unmanaged allocation
  40. The new `scm_gc_register_allocation' function will notify the collector
  41. of unmanaged allocation. This will cause the collector to run sooner.
  42. Guile's `scm_malloc', `scm_calloc', and `scm_realloc' unmanaged
  43. allocators eventually call this function. This leads to better
  44. performance under steady-state unmanaged allocation.
  45. *** Transient allocation
  46. When the collector runs, it will try to record the total memory
  47. footprint of a process, if the platform supports this information. If
  48. the memory footprint is growing, the collector will run more frequently.
  49. This reduces the increase of the resident size of a process in response
  50. to a transient increase in allocation.
  51. *** Management of threads, bignums
  52. Creating a thread will allocate a fair amount of memory. Guile now does
  53. some GC work (using `GC_collect_a_little') when allocating a thread.
  54. This leads to a better memory footprint when creating many short-lived
  55. threads.
  56. Similarly, bignums can occupy a lot of memory. Guile now offers hooks
  57. to enable custom GMP allocators that end up calling
  58. `scm_gc_register_allocation'. These allocators are enabled by default
  59. when running Guile from the command-line. To enable them in libraries,
  60. set the `scm_install_gmp_memory_functions' variable to a nonzero value
  61. before loading Guile.
  62. ** SRFI-39 parameters are available by default.
  63. Guile now includes support for parameters, as defined by SRFI-39, in the
  64. default environment. See "Parameters" in the manual, for more
  65. information. `current-input-port', `current-output-port', and
  66. `current-error-port' are now parameters.
  67. ** Add `current-warning-port'.
  68. Guile now outputs warnings on a separate port, `current-warning-port',
  69. initialized to the value that `current-error-port' has on startup.
  70. ** Syntax parameters.
  71. Following Racket's lead, Guile now supports syntax parameters. See
  72. "Syntax parameters" in the manual, for more.
  73. Also see Barzilay, Culpepper, and Flatt's 2011 SFP workshop paper,
  74. "Keeping it Clean with syntax-parameterize".
  75. ** Parse command-line arguments from the locale encoding.
  76. Guile now attempts to parse command-line arguments using the user's
  77. locale. However for backwards compatibility with other 2.0.x releases,
  78. it does so without actually calling `setlocale'. Please report any bugs
  79. in this facility to bug-guile@gnu.org.
  80. ** One-armed conditionals: `when' and `unless'
  81. Guile finally has `when' and `unless' in the default environment. Use
  82. them whenever you would use an `if' with only one branch. See
  83. "Conditionals" in the manual, for more.
  84. ** `current-filename', `add-to-load-path'
  85. There is a new form, `(current-filename)', which expands out to the
  86. source file in which it occurs. Combined with the new
  87. `add-to-load-path', this allows simple scripts to easily add nearby
  88. directories to the load path. See "Load Paths" in the manual, for more.
  89. ** `random-state-from-platform'
  90. This procedure initializes a random seed using good random sources
  91. available on your platform, such as /dev/urandom. See "Random Number
  92. Generation" in the manual, for more.
  93. ** Warn about unsupported `simple-format' options.
  94. The `-Wformat' compilation option now reports unsupported format options
  95. passed to `simple-format'.
  96. ** Manual updates
  97. Besides the sections already mentioned, the following manual sections
  98. are new in this release: "Modules and the File System", "Module System
  99. Reflection", "Syntax Transformer Helpers", and "Local Inclusion".
  100. * New interfaces
  101. ** (ice-9 session): `apropos-hook'
  102. ** New print option: `escape-newlines', defaults to #t.
  103. ** (ice-9 ftw): `file-system-fold', `file-system-tree', `scandir'
  104. ** `scm_c_value_ref': access to multiple returned values from C
  105. ** scm_call (a varargs version), scm_call_7, scm_call_8, scm_call_9
  106. ** Some new syntax helpers in (system syntax)
  107. Search the manual for these identifiers and modules, for more.
  108. * Build fixes
  109. ** FreeBSD build fixes.
  110. ** OpenBSD compilation fixes.
  111. ** Solaris 2.10 test suite fixes.
  112. ** IA64 compilation fix.
  113. ** MinGW build fixes.
  114. ** Work around instruction reordering on SPARC and HPPA in the VM.
  115. ** Gnulib updates: added `dirfd', `setenv' modules.
  116. * Bug fixes
  117. ** Add a deprecated alias for $expt.
  118. ** Add an exception printer for `getaddrinfo-error'.
  119. ** Add deprecated shim for `scm_display_error' with stack as first argument.
  120. ** Add warnings for unsupported `simple-format' options.
  121. ** Allow overlapping regions to be passed to `bytevector-copy!'.
  122. ** Better function prologue disassembly
  123. ** Compiler: fix miscompilation of (values foo ...) in some contexts.
  124. ** Compiler: fix serialization of #nil-terminated lists.
  125. ** Compiler: allow values bound in non-tail let expressions to be collected.
  126. ** Deprecate SCM_ASRTGO.
  127. ** Document invalidity of (begin) as expression; add back-compat shim.
  128. ** Don't leak file descriptors when mmaping objcode.
  129. ** Empty substrings no longer reference the original stringbuf.
  130. ** FFI: Fix `set-pointer-finalizer!' to leave the type cell unchanged.
  131. ** FFI: Hold a weak reference to the CIF made by `procedure->pointer'.
  132. ** FFI: Hold a weak reference to the procedure passed to `procedure->pointer'.
  133. ** FFI: Properly unpack small integer return values in closure call.
  134. ** Fix R6RS `fold-left' so the accumulator is the first argument.
  135. ** Fix bit-set*! bug from 2005.
  136. ** Fix bug in `make-repl' when `lang' is actually a <language>.
  137. ** Fix bugs related to mutation, the null string, and shared substrings.
  138. ** Fix <dynwind> serialization.
  139. ** Fix erroneous check in `set-procedure-properties!'.
  140. ** Fix generalized-vector-{ref,set!} for slices.
  141. ** Fix error messages involving definition forms.
  142. ** Fix primitive-eval to return #<unspecified> for definitions.
  143. ** HTTP: Extend handling of "Cache-Control" header.
  144. ** HTTP: Fix qstring writing of cache-extension values
  145. ** HTTP: Fix validators for various list-style headers.
  146. ** HTTP: Permit non-date values for Expires header.
  147. ** HTTP: `write-request-line' writes absolute paths, not absolute URIs.
  148. ** Hack the port-column of current-output-port after printing a prompt.
  149. ** Make sure `regexp-quote' tests use Unicode-capable string ports.
  150. ** Peval: Fix bugs in the new optimizer.
  151. ** Statistically unique marks and labels, for robust hygiene across sessions.
  152. ** Web: Allow URIs with empty authorities, like "file:///etc/hosts".
  153. ** `,language' at REPL sets the current-language fluid.
  154. ** `primitive-load' returns the value(s) of the last expression.
  155. ** `scm_from_stringn' always returns unique strings.
  156. ** `scm_i_substring_copy' tries to narrow the substring.
  157. ** i18n: Fix gc_malloc/free mismatch on non-GNU systems.
  158. Changes in 2.0.3 (since 2.0.2):
  159. * Speed improvements
  160. ** Guile has a new optimizer, `peval'.
  161. `Peval' is a partial evaluator that performs constant folding, dead code
  162. elimination, copy propagation, and inlining. By default it runs on
  163. every piece of code that Guile compiles, to fold computations that can
  164. happen at compile-time, so they don't have to happen at runtime.
  165. If we did our job right, the only impact you would see would be your
  166. programs getting faster. But if you notice slowdowns or bloated code,
  167. please send a mail to bug-guile@gnu.org with details.
  168. Thanks to William R. Cook, Oscar Waddell, and Kent Dybvig for inspiring
  169. peval and its implementation.
  170. You can see what peval does on a given piece of code by running the new
  171. `,optimize' REPL meta-command, and comparing it to the output of
  172. `,expand'. See "Compile Commands" in the manual, for more.
  173. ** Fewer calls to `stat'.
  174. Guile now stats only the .go file and the .scm file when loading a fresh
  175. compiled file.
  176. * Notable changes
  177. ** New module: `(web client)', a simple synchronous web client.
  178. See "Web Client" in the manual, for more.
  179. ** Users can now install compiled `.go' files.
  180. See "Installing Site Packages" in the manual.
  181. ** Remove Front-Cover and Back-Cover text from the manual.
  182. The manual is still under the GNU Free Documentation License, but no
  183. longer has any invariant sections.
  184. ** More helpful `guild help'.
  185. `guild' is Guile's multi-tool, for use in shell scripting. Now it has a
  186. nicer interface for querying the set of existing commands, and getting
  187. help on those commands. Try it out and see!
  188. ** New macro: `define-syntax-rule'
  189. `define-syntax-rule' is a shorthand to make a `syntax-rules' macro with
  190. one clause. See "Syntax Rules" in the manual, for more.
  191. ** The `,time' REPL meta-command now has more precision.
  192. The output of this command now has microsecond precision, instead of
  193. 10-millisecond precision.
  194. ** `(ice-9 match)' can now match records.
  195. See "Pattern Matching" in the manual, for more on matching records.
  196. ** New module: `(language tree-il debug)'.
  197. This module provides a tree-il verifier. This is useful for people that
  198. generate tree-il, usually as part of a language compiler.
  199. ** New functions: `scm_is_exact', `scm_is_inexact'.
  200. These provide a nice C interface for Scheme's `exact?' and `inexact?',
  201. respectively.
  202. * Bugs fixed
  203. See the git log (or the ChangeLog) for more details on these bugs.
  204. ** Fix order of importing modules and resolving duplicates handlers.
  205. ** Fix a number of bugs involving extended (merged) generics.
  206. ** Fix invocation of merge-generics duplicate handler.
  207. ** Fix write beyond array end in arrays.c.
  208. ** Fix read beyond end of hashtable size array in hashtab.c.
  209. ** (web http): Locale-independent parsing and serialization of dates.
  210. ** Ensure presence of Host header in HTTP/1.1 requests.
  211. ** Fix take-right and drop-right for improper lists.
  212. ** Fix leak in get_current_locale().
  213. ** Fix recursive define-inlinable expansions.
  214. ** Check that srfi-1 procedure arguments are procedures.
  215. ** Fix r6rs `map' for multiple returns.
  216. ** Fix scm_tmpfile leak on POSIX platforms.
  217. ** Fix a couple of leaks (objcode->bytecode, make-boot-program).
  218. ** Fix guile-lib back-compatibility for module-stexi-documentation.
  219. ** Fix --listen option to allow other ports.
  220. ** Fix scm_to_latin1_stringn for substrings.
  221. ** Fix compilation of untyped arrays of rank not 1.
  222. ** Fix unparse-tree-il of <dynset>.
  223. ** Fix reading of #||||#.
  224. ** Fix segfault in GOOPS when class fields are redefined.
  225. ** Prefer poll(2) over select(2) to allow file descriptors above FD_SETSIZE.
  226. Changes in 2.0.2 (since 2.0.1):
  227. * Notable changes
  228. ** `guile-tools' renamed to `guild'
  229. The new name is shorter. Its intended future use is for a CPAN-like
  230. system for Guile wizards and journeyfolk to band together to share code;
  231. hence the name. `guile-tools' is provided as a backward-compatible
  232. symbolic link. See "Using Guile Tools" in the manual, for more.
  233. ** New control operators: `shift' and `reset'
  234. See "Shift and Reset" in the manual, for more information.
  235. ** `while' as an expression
  236. Previously the return value of `while' was unspecified. Now its
  237. values are specified both in the case of normal termination, and via
  238. termination by invoking `break', possibly with arguments. See "while
  239. do" in the manual for more.
  240. ** Disallow access to handles of weak hash tables
  241. `hash-get-handle' and `hash-create-handle!' are no longer permitted to
  242. be called on weak hash tables, because the fields in a weak handle could
  243. be nulled out by the garbage collector at any time, but yet they are
  244. otherwise indistinguishable from pairs. Use `hash-ref' and `hash-set!'
  245. instead.
  246. ** More precision for `get-internal-run-time', `get-internal-real-time'
  247. On 64-bit systems which support POSIX clocks, Guile's internal timing
  248. procedures offer nanosecond resolution instead of the 10-millisecond
  249. resolution previously available. 32-bit systems now use 1-millisecond
  250. timers.
  251. ** Guile now measures time spent in GC
  252. `gc-stats' now returns a meaningful value for `gc-time-taken'.
  253. ** Add `gcprof'
  254. The statprof profiler now exports a `gcprof' procedure, driven by the
  255. `after-gc-hook', to see which parts of your program are causing GC. Let
  256. us know if you find it useful.
  257. ** `map', `for-each' and some others now implemented in Scheme
  258. We would not mention this in NEWS, as it is not a user-visible change,
  259. if it were not for one thing: `map' and `for-each' are no longer
  260. primitive generics. Instead they are normal bindings, which can be
  261. wrapped by normal generics. This fixes some modularity issues between
  262. core `map', SRFI-1 `map', and GOOPS.
  263. Also it's pretty cool that we can do this without a performance impact.
  264. ** Add `scm_peek_byte_or_eof'.
  265. This helper is like `scm_peek_char_or_eof', but for bytes instead of
  266. full characters.
  267. ** Implement #:stop-at-first-non-option option for getopt-long
  268. See "getopt-long Reference" in the manual, for more information.
  269. ** Improve R6RS conformance for conditions in the I/O libraries
  270. The `(rnrs io simple)' module now raises the correct R6RS conditions in
  271. error cases. `(rnrs io ports)' is also more correct now, though it is
  272. still a work in progress.
  273. ** All deprecated routines emit warnings
  274. A few deprecated routines were lacking deprecation warnings. This has
  275. been fixed now.
  276. * Speed improvements
  277. ** Constants in compiled code now share state better
  278. Constants with shared state, like `("foo")' and `"foo"', now share state
  279. as much as possible, in the entire compilation unit. This cuts compiled
  280. `.go' file sizes in half, generally, and speeds startup.
  281. ** VLists: optimize `vlist-fold-right', and add `vhash-fold-right'
  282. These procedures are now twice as fast as they were.
  283. ** UTF-8 ports to bypass `iconv' entirely
  284. This reduces memory usage in a very common case.
  285. ** Compiler speedups
  286. The compiler is now about 40% faster. (Note that this is only the case
  287. once the compiler is itself compiled, so the build still takes as long
  288. as it did before.)
  289. ** VM speed tuning
  290. Some assertions that were mostly useful for sanity-checks on the
  291. bytecode compiler are now off for both "regular" and "debug" engines.
  292. This together with a fix to cache a TLS access and some other tweaks
  293. improve the VM's performance by about 20%.
  294. ** SRFI-1 list-set optimizations
  295. lset-adjoin and lset-union now have fast paths for eq? sets.
  296. ** `memq', `memv' optimizations
  297. These procedures are now at least twice as fast than in 2.0.1.
  298. * Deprecations
  299. ** Deprecate scm_whash API
  300. `scm_whash_get_handle', `SCM_WHASHFOUNDP', `SCM_WHASHREF',
  301. `SCM_WHASHSET', `scm_whash_create_handle', `scm_whash_lookup', and
  302. `scm_whash_insert' are now deprecated. Use the normal hash table API
  303. instead.
  304. ** Deprecate scm_struct_table
  305. `SCM_STRUCT_TABLE_NAME', `SCM_SET_STRUCT_TABLE_NAME',
  306. `SCM_STRUCT_TABLE_CLASS', `SCM_SET_STRUCT_TABLE_CLASS',
  307. `scm_struct_table', and `scm_struct_create_handle' are now deprecated.
  308. These routines formed part of the internals of the map between structs
  309. and classes.
  310. ** Deprecate scm_internal_dynamic_wind
  311. The `scm_t_inner' type and `scm_internal_dynamic_wind' are deprecated,
  312. as the `scm_dynwind' API is better, and this API encourages users to
  313. stuff SCM values into pointers.
  314. ** Deprecate scm_immutable_cell, scm_immutable_double_cell
  315. These routines are deprecated, as the GC_STUBBORN API doesn't do
  316. anything any more.
  317. * Manual updates
  318. Andreas Rottman kindly transcribed the missing parts of the `(rnrs io
  319. ports)' documentation from the R6RS documentation. Thanks Andreas!
  320. * Bugs fixed
  321. ** Fix double-loading of script in -ds case
  322. ** -x error message fix
  323. ** iconveh-related cross-compilation fixes
  324. ** Fix small integer return value packing on big endian machines.
  325. ** Fix hash-set! in weak-value table from non-immediate to immediate
  326. ** Fix call-with-input-file & relatives for multiple values
  327. ** Fix `hash' for inf and nan
  328. ** Fix libguile internal type errors caught by typing-strictness==2
  329. ** Fix compile error in MinGW fstat socket detection
  330. ** Fix generation of auto-compiled file names on MinGW
  331. ** Fix multithreaded access to internal hash tables
  332. ** Emit a 1-based line number in error messages
  333. ** Fix define-module ordering
  334. ** Fix several POSIX functions to use the locale encoding
  335. ** Add type and range checks to the complex generalized vector accessors
  336. ** Fix unaligned accesses for bytevectors of complex numbers
  337. ** Fix '(a #{.} b)
  338. ** Fix erroneous VM stack overflow for canceled threads
  339. Changes in 2.0.1 (since 2.0.0):
  340. * Notable changes
  341. ** guile.m4 supports linking with rpath
  342. The GUILE_FLAGS macro now sets GUILE_LIBS and GUILE_LTLIBS, which
  343. include appropriate directives to the linker to include libguile-2.0.so
  344. in the runtime library lookup path.
  345. ** `begin' expands macros in its body before other expressions
  346. This enables support for programs like the following:
  347. (begin
  348. (define even?
  349. (lambda (x)
  350. (or (= x 0) (odd? (- x 1)))))
  351. (define-syntax odd?
  352. (syntax-rules ()
  353. ((odd? x) (not (even? x)))))
  354. (even? 10))
  355. ** REPL reader usability enhancements
  356. The REPL now flushes input after a read error, which should prevent one
  357. error from causing other errors. The REPL also now interprets comments
  358. as whitespace.
  359. ** REPL output has configurable width
  360. The REPL now defaults to output with the current terminal's width, in
  361. columns. See "Debug Commands" in the manual for more information on
  362. the ,width command.
  363. ** Better C access to the module system
  364. Guile now has convenient C accessors to look up variables or values in
  365. modules and their public interfaces. See `scm_c_public_ref' and friends
  366. in "Accessing Modules from C" in the manual.
  367. ** Added `scm_call_5', `scm_call_6'
  368. See "Fly Evaluation" in the manual.
  369. ** Added `scm_from_latin1_keyword', `scm_from_utf8_keyword'
  370. See "Keyword Procedures" in the manual, for more. Note that
  371. `scm_from_locale_keyword' should not be used when the name is a C string
  372. constant.
  373. ** R6RS unicode and string I/O work
  374. Added efficient implementations of `get-string-n' and `get-string-n!'
  375. for binary ports. Exported `current-input-port', `current-output-port'
  376. and `current-error-port' from `(rnrs io ports)', and enhanced support
  377. for transcoders.
  378. ** Added `pointer->scm', `scm->pointer' to `(system foreign)'
  379. These procedure are useful if one needs to pass and receive SCM values
  380. to and from foreign functions. See "Foreign Variables" in the manual,
  381. for more.
  382. ** Added `heap-allocated-since-gc' to `(gc-stats)'
  383. Also fixed the long-standing bug in the REPL `,stat' command.
  384. ** Add `on-error' REPL option
  385. This option controls what happens when an error occurs at the REPL, and
  386. defaults to `debug', indicating that Guile should enter the debugger.
  387. Other values include `report', which will simply print a backtrace
  388. without entering the debugger. See "System Commands" in the manual.
  389. ** Enforce immutability of string literals
  390. Attempting to mutate a string literal now causes a runtime error.
  391. ** Fix pthread redirection
  392. Guile 2.0.0 shipped with headers that, if configured with pthread
  393. support, would re-define `pthread_create', `pthread_join', and other API
  394. to redirect to the BDW-GC wrappers, `GC_pthread_create', etc. This was
  395. unintended, and not necessary: because threads must enter Guile with
  396. `scm_with_guile', Guile can handle thread registration itself, without
  397. needing to make the GC aware of all threads. This oversight has been
  398. fixed.
  399. ** `with-continuation-barrier' now unwinds on `quit'
  400. A throw to `quit' in a continuation barrier will cause Guile to exit.
  401. Before, it would do so before unwinding to the barrier, which would
  402. prevent cleanup handlers from running. This has been fixed so that it
  403. exits only after unwinding.
  404. ** `string->pointer' and `pointer->string' have optional encoding arg
  405. This allows users of the FFI to more easily deal in strings with
  406. particular (non-locale) encodings, like "utf-8". See "Void Pointers and
  407. Byte Access" in the manual, for more.
  408. ** R6RS fixnum arithmetic optimizations
  409. R6RS fixnum operations are are still slower than generic arithmetic,
  410. however.
  411. ** New procedure: `define-inlinable'
  412. See "Inlinable Procedures" in the manual, for more.
  413. ** New procedure: `exact-integer-sqrt'
  414. See "Integer Operations" in the manual, for more.
  415. ** "Extended read syntax" for symbols parses better
  416. In #{foo}# symbols, backslashes are now treated as escapes, as the
  417. symbol-printing code intended. Additionally, "\x" within #{foo}# is now
  418. interpreted as starting an R6RS hex escape. This is backward compatible
  419. because the symbol printer would never produce a "\x" before. The
  420. printer also works better too.
  421. ** Added `--fresh-auto-compile' option
  422. This allows a user to invalidate the auto-compilation cache. It's
  423. usually not needed. See "Compilation" in the manual, for a discussion.
  424. * Manual updates
  425. ** GOOPS documentation updates
  426. ** New man page
  427. Thanks to Mark Harig for improvements to guile.1.
  428. ** SRFI-23 documented
  429. The humble `error' SRFI now has an entry in the manual.
  430. * New modules
  431. ** `(ice-9 binary-ports)': "R6RS I/O Ports", in the manual
  432. ** `(ice-9 eval-string)': "Fly Evaluation", in the manual
  433. ** `(ice-9 command-line)', not documented yet
  434. * Bugs fixed
  435. ** Fixed `iconv_t' memory leak on close-port
  436. ** Fixed some leaks with weak hash tables
  437. ** Export `vhash-delq' and `vhash-delv' from `(ice-9 vlist)'
  438. ** `after-gc-hook' works again
  439. ** `define-record-type' now allowed in nested contexts
  440. ** `exact-integer-sqrt' now handles large integers correctly
  441. ** Fixed C extension examples in manual
  442. ** `vhash-delete' honors HASH argument
  443. ** Make `locale-digit-grouping' more robust
  444. ** Default exception printer robustness fixes
  445. ** Fix presence of non-I CPPFLAGS in `guile-2.0.pc'
  446. ** `read' updates line/column numbers when reading SCSH block comments
  447. ** Fix imports of multiple custom interfaces of same module
  448. ** Fix encoding scanning for non-seekable ports
  449. ** Fix `setter' when called with a non-setter generic
  450. ** Fix f32 and f64 bytevectors to not accept rationals
  451. ** Fix description of the R6RS `finite?' in manual
  452. ** Quotient, remainder and modulo accept inexact integers again
  453. ** Fix `continue' within `while' to take zero arguments
  454. ** Fix alignment for structures in FFI
  455. ** Fix port-filename of stdin, stdout, stderr to match the docs
  456. ** Fix weak hash table-related bug in `define-wrapped-pointer-type'
  457. ** Fix partial continuation application with pending procedure calls
  458. ** scm_{to,from}_locale_string use current locale, not current ports
  459. ** Fix thread cleanup, by using a pthread_key destructor
  460. ** Fix `quit' at the REPL
  461. ** Fix a failure to sync regs in vm bytevector ops
  462. ** Fix (texinfo reflection) to handle nested structures like syntax patterns
  463. ** Fix stexi->html double translation
  464. ** Fix tree-il->scheme fix for <prompt>
  465. ** Fix compilation of <prompt> in <fix> in single-value context
  466. ** Fix race condition in ensure-writable-dir
  467. ** Fix error message on ,disassemble "non-procedure"
  468. ** Fix prompt and abort with the boot evaluator
  469. ** Fix `procedure->pointer' for functions returning `void'
  470. ** Fix error reporting in dynamic-pointer
  471. ** Fix problems detecting coding: in block comments
  472. ** Fix duplicate load-path and load-compiled-path in compilation environment
  473. ** Add fallback read(2) suppport for .go files if mmap(2) unavailable
  474. ** Fix c32vector-set!, c64vector-set!
  475. ** Fix mistakenly deprecated read syntax for uniform complex vectors
  476. ** Fix parsing of exact numbers with negative exponents
  477. ** Ignore SIGPIPE in (system repl server)
  478. ** Fix optional second arg to R6RS log function
  479. ** Fix R6RS `assert' to return true value.
  480. ** Fix fencepost error when seeking in bytevector input ports
  481. ** Gracefully handle `setlocale' errors when starting the REPL
  482. ** Improve support of the `--disable-posix' configure option
  483. ** Make sure R6RS binary ports pass `binary-port?' regardless of the locale
  484. ** Gracefully handle unterminated UTF-8 sequences instead of hitting an `assert'
  485. Changes in 2.0.0 (changes since the 1.8.x series):
  486. * New modules (see the manual for details)
  487. ** `(srfi srfi-18)', more sophisticated multithreading support
  488. ** `(srfi srfi-27)', sources of random bits
  489. ** `(srfi srfi-38)', External Representation for Data With Shared Structure
  490. ** `(srfi srfi-42)', eager comprehensions
  491. ** `(srfi srfi-45)', primitives for expressing iterative lazy algorithms
  492. ** `(srfi srfi-67)', compare procedures
  493. ** `(ice-9 i18n)', internationalization support
  494. ** `(ice-9 futures)', fine-grain parallelism
  495. ** `(rnrs bytevectors)', the R6RS bytevector API
  496. ** `(rnrs io ports)', a subset of the R6RS I/O port API
  497. ** `(system xref)', a cross-referencing facility (FIXME undocumented)
  498. ** `(ice-9 vlist)', lists with constant-time random access; hash lists
  499. ** `(system foreign)', foreign function interface
  500. ** `(sxml match)', a pattern matcher for SXML
  501. ** `(srfi srfi-9 gnu)', extensions to the SRFI-9 record library
  502. ** `(system vm coverage)', a line-by-line code coverage library
  503. ** `(web uri)', URI data type, parser, and unparser
  504. ** `(web http)', HTTP header parsers and unparsers
  505. ** `(web request)', HTTP request data type, reader, and writer
  506. ** `(web response)', HTTP response data type, reader, and writer
  507. ** `(web server)', Generic HTTP server
  508. ** `(ice-9 poll)', a poll wrapper
  509. ** `(web server http)', HTTP-over-TCP web server implementation
  510. ** Replaced `(ice-9 match)' with Alex Shinn's compatible, hygienic matcher.
  511. Guile's copy of Andrew K. Wright's `match' library has been replaced by
  512. a compatible hygienic implementation by Alex Shinn. It is now
  513. documented, see "Pattern Matching" in the manual.
  514. Compared to Andrew K. Wright's `match', the new `match' lacks
  515. `match-define', `match:error-control', `match:set-error-control',
  516. `match:error', `match:set-error', and all structure-related procedures.
  517. ** Imported statprof, SSAX, and texinfo modules from Guile-Lib
  518. The statprof statistical profiler, the SSAX XML toolkit, and the texinfo
  519. toolkit from Guile-Lib have been imported into Guile proper. See
  520. "Standard Library" in the manual for more details.
  521. ** Integration of lalr-scm, a parser generator
  522. Guile has included Dominique Boucher's fine `lalr-scm' parser generator
  523. as `(system base lalr)'. See "LALR(1) Parsing" in the manual, for more
  524. information.
  525. * Changes to the stand-alone interpreter
  526. ** Guile now can compile Scheme to bytecode for a custom virtual machine.
  527. Compiled code loads much faster than Scheme source code, and runs around
  528. 3 or 4 times as fast, generating much less garbage in the process.
  529. ** Evaluating Scheme code does not use the C stack.
  530. Besides when compiling Guile itself, Guile no longer uses a recursive C
  531. function as an evaluator. This obviates the need to check the C stack
  532. pointer for overflow. Continuations still capture the C stack, however.
  533. ** New environment variables: GUILE_LOAD_COMPILED_PATH,
  534. GUILE_SYSTEM_LOAD_COMPILED_PATH
  535. GUILE_LOAD_COMPILED_PATH is for compiled files what GUILE_LOAD_PATH is
  536. for source files. It is a different path, however, because compiled
  537. files are architecture-specific. GUILE_SYSTEM_LOAD_COMPILED_PATH is like
  538. GUILE_SYSTEM_PATH.
  539. ** New read-eval-print loop (REPL) implementation
  540. Running Guile with no arguments drops the user into the new REPL. See
  541. "Using Guile Interactively" in the manual, for more information.
  542. ** Remove old Emacs interface
  543. Guile had an unused `--emacs' command line argument that was supposed to
  544. help when running Guile inside Emacs. This option has been removed, and
  545. the helper functions `named-module-use!' and `load-emacs-interface' have
  546. been deprecated.
  547. ** Add `(system repl server)' module and `--listen' command-line argument
  548. The `(system repl server)' module exposes procedures to listen on
  549. sockets for connections, and serve REPLs to those clients. The --listen
  550. command-line argument allows any Guile program to thus be remotely
  551. debuggable.
  552. See "Invoking Guile" for more information on `--listen'.
  553. ** Command line additions
  554. The guile binary now supports a new switch "-x", which can be used to
  555. extend the list of filename extensions tried when loading files
  556. (%load-extensions).
  557. ** New reader options: `square-brackets', `r6rs-hex-escapes',
  558. `hungry-eol-escapes'
  559. The reader supports a new option (changeable via `read-options'),
  560. `square-brackets', which instructs it to interpret square brackets as
  561. parentheses. This option is on by default.
  562. When the new `r6rs-hex-escapes' reader option is enabled, the reader
  563. will recognize string escape sequences as defined in R6RS. R6RS string
  564. escape sequences are incompatible with Guile's existing escapes, though,
  565. so this option is off by default.
  566. Additionally, Guile follows the R6RS newline escaping rules when the
  567. `hungry-eol-escapes' option is enabled.
  568. See "String Syntax" in the manual, for more information.
  569. ** Function profiling and tracing at the REPL
  570. The `,profile FORM' REPL meta-command can now be used to statistically
  571. profile execution of a form, to see which functions are taking the most
  572. time. See `,help profile' for more information.
  573. Similarly, `,trace FORM' traces all function applications that occur
  574. during the execution of `FORM'. See `,help trace' for more information.
  575. ** Recursive debugging REPL on error
  576. When Guile sees an error at the REPL, instead of saving the stack, Guile
  577. will directly enter a recursive REPL in the dynamic context of the
  578. error. See "Error Handling" in the manual, for more information.
  579. A recursive REPL is the same as any other REPL, except that it
  580. has been augmented with debugging information, so that one can inspect
  581. the context of the error. The debugger has been integrated with the REPL
  582. via a set of debugging meta-commands.
  583. For example, one may access a backtrace with `,backtrace' (or
  584. `,bt'). See "Interactive Debugging" in the manual, for more
  585. information.
  586. ** New `guile-tools' commands: `compile', `disassemble'
  587. Pass the `--help' command-line option to these commands for more
  588. information.
  589. ** Guile now adds its install prefix to the LTDL_LIBRARY_PATH
  590. Users may now install Guile to nonstandard prefixes and just run
  591. `/path/to/bin/guile', instead of also having to set LTDL_LIBRARY_PATH to
  592. include `/path/to/lib'.
  593. ** Guile's Emacs integration is now more keyboard-friendly
  594. Backtraces may now be disclosed with the keyboard in addition to the
  595. mouse.
  596. ** Load path change: search in version-specific paths before site paths
  597. When looking for a module, Guile now searches first in Guile's
  598. version-specific path (the library path), *then* in the site dir. This
  599. allows Guile's copy of SSAX to override any Guile-Lib copy the user has
  600. installed. Also it should cut the number of `stat' system calls by half,
  601. in the common case.
  602. ** Value history in the REPL on by default
  603. By default, the REPL will save computed values in variables like `$1',
  604. `$2', and the like. There are programmatic and interactive interfaces to
  605. control this. See "Value History" in the manual, for more information.
  606. ** Readline tab completion for arguments
  607. When readline is enabled, tab completion works for arguments too, not
  608. just for the operator position.
  609. ** Expression-oriented readline history
  610. Guile's readline history now tries to operate on expressions instead of
  611. input lines. Let us know what you think!
  612. ** Interactive Guile follows GNU conventions
  613. As recommended by the GPL, Guile now shows a brief copyright and
  614. warranty disclaimer on startup, along with pointers to more information.
  615. * Changes to Scheme functions and syntax
  616. ** Support for R6RS libraries
  617. The `library' and `import' forms from the latest Scheme report have been
  618. added to Guile, in such a way that R6RS libraries share a namespace with
  619. Guile modules. R6RS modules may import Guile modules, and are available
  620. for Guile modules to import via use-modules and all the rest. See "R6RS
  621. Libraries" in the manual for more information.
  622. ** Implementations of R6RS libraries
  623. Guile now has implementations for all of the libraries defined in the
  624. R6RS. Thanks to Julian Graham for this excellent hack. See "R6RS
  625. Standard Libraries" in the manual for a full list of libraries.
  626. ** Partial R6RS compatibility
  627. Guile now has enough support for R6RS to run a reasonably large subset
  628. of R6RS programs.
  629. Guile is not fully R6RS compatible. Many incompatibilities are simply
  630. bugs, though some parts of Guile will remain R6RS-incompatible for the
  631. foreseeable future. See "R6RS Incompatibilities" in the manual, for more
  632. information.
  633. Please contact bug-guile@gnu.org if you have found an issue not
  634. mentioned in that compatibility list.
  635. ** New implementation of `primitive-eval'
  636. Guile's `primitive-eval' is now implemented in Scheme. Actually there is
  637. still a C evaluator, used when building a fresh Guile to interpret the
  638. compiler, so we can compile eval.scm. Thereafter all calls to
  639. primitive-eval are implemented by VM-compiled code.
  640. This allows all of Guile's procedures, be they interpreted or compiled,
  641. to execute on the same stack, unifying multiple-value return semantics,
  642. providing for proper tail recursion between interpreted and compiled
  643. code, and simplifying debugging.
  644. As part of this change, the evaluator no longer mutates the internal
  645. representation of the code being evaluated in a thread-unsafe manner.
  646. There are two negative aspects of this change, however. First, Guile
  647. takes a lot longer to compile now. Also, there is less debugging
  648. information available for debugging interpreted code. We hope to improve
  649. both of these situations.
  650. There are many changes to the internal C evalator interface, but all
  651. public interfaces should be the same. See the ChangeLog for details. If
  652. we have inadvertantly changed an interface that you were using, please
  653. contact bug-guile@gnu.org.
  654. ** Procedure removed: `the-environment'
  655. This procedure was part of the interpreter's execution model, and does
  656. not apply to the compiler.
  657. ** No more `local-eval'
  658. `local-eval' used to exist so that one could evaluate code in the
  659. lexical context of a function. Since there is no way to get the lexical
  660. environment any more, as that concept has no meaning for the compiler,
  661. and a different meaning for the interpreter, we have removed the
  662. function.
  663. If you think you need `local-eval', you should probably implement your
  664. own metacircular evaluator. It will probably be as fast as Guile's
  665. anyway.
  666. ** Scheme source files will now be compiled automatically.
  667. If a compiled .go file corresponding to a .scm file is not found or is
  668. not fresh, the .scm file will be compiled on the fly, and the resulting
  669. .go file stored away. An advisory note will be printed on the console.
  670. Note that this mechanism depends on the timestamp of the .go file being
  671. newer than that of the .scm file; if the .scm or .go files are moved
  672. after installation, care should be taken to preserve their original
  673. timestamps.
  674. Auto-compiled files will be stored in the $XDG_CACHE_HOME/guile/ccache
  675. directory, where $XDG_CACHE_HOME defaults to ~/.cache. This directory
  676. will be created if needed.
  677. To inhibit automatic compilation, set the GUILE_AUTO_COMPILE environment
  678. variable to 0, or pass --no-auto-compile on the Guile command line.
  679. ** New POSIX procedures: `getrlimit' and `setrlimit'
  680. Note however that the interface of these functions is likely to change
  681. in the next prerelease.
  682. ** New POSIX procedure: `getsid'
  683. Scheme binding for the `getsid' C library call.
  684. ** New POSIX procedure: `getaddrinfo'
  685. Scheme binding for the `getaddrinfo' C library function.
  686. ** Multicast socket options
  687. Support was added for the IP_MULTICAST_TTL and IP_MULTICAST_IF socket
  688. options. See "Network Sockets and Communication" in the manual, for
  689. more information.
  690. ** `recv!', `recvfrom!', `send', `sendto' now deal in bytevectors
  691. These socket procedures now take bytevectors as arguments, instead of
  692. strings. There is some deprecated string support, however.
  693. ** New GNU procedures: `setaffinity' and `getaffinity'.
  694. See "Processes" in the manual, for more information.
  695. ** New procedures: `compose', `negate', and `const'
  696. See "Higher-Order Functions" in the manual, for more information.
  697. ** New procedure in `(oops goops)': `method-formals'
  698. ** New procedures in (ice-9 session): `add-value-help-handler!',
  699. `remove-value-help-handler!', `add-name-help-handler!'
  700. `remove-name-help-handler!', `procedure-arguments'
  701. The value and name help handlers provide some minimal extensibility to
  702. the help interface. Guile-lib's `(texinfo reflection)' uses them, for
  703. example, to make stexinfo help documentation available. See those
  704. procedures' docstrings for more information.
  705. `procedure-arguments' describes the arguments that a procedure can take,
  706. combining arity and formals. For example:
  707. (procedure-arguments resolve-interface)
  708. => ((required . (name)) (rest . args))
  709. Additionally, `module-commentary' is now publically exported from
  710. `(ice-9 session).
  711. ** Removed: `procedure->memoizing-macro', `procedure->syntax'
  712. These procedures created primitive fexprs for the old evaluator, and are
  713. no longer supported. If you feel that you need these functions, you
  714. probably need to write your own metacircular evaluator (which will
  715. probably be as fast as Guile's, anyway).
  716. ** New language: ECMAScript
  717. Guile now ships with one other high-level language supported,
  718. ECMAScript. The goal is to support all of version 3.1 of the standard,
  719. but not all of the libraries are there yet. This support is not yet
  720. documented; ask on the mailing list if you are interested.
  721. ** New language: Brainfuck
  722. Brainfuck is a toy language that closely models Turing machines. Guile's
  723. brainfuck compiler is meant to be an example of implementing other
  724. languages. See the manual for details, or
  725. http://en.wikipedia.org/wiki/Brainfuck for more information about the
  726. Brainfuck language itself.
  727. ** New language: Elisp
  728. Guile now has an experimental Emacs Lisp compiler and runtime. You can
  729. now switch to Elisp at the repl: `,language elisp'. All kudos to Daniel
  730. Kraft and Brian Templeton, and all bugs to bug-guile@gnu.org.
  731. ** Better documentation infrastructure for macros
  732. It is now possible to introspect on the type of a macro, e.g.
  733. syntax-rules, identifier-syntax, etc, and extract information about that
  734. macro, such as the syntax-rules patterns or the defmacro arguments.
  735. `(texinfo reflection)' takes advantage of this to give better macro
  736. documentation.
  737. ** Support for arbitrary procedure metadata
  738. Building on its support for docstrings, Guile now supports multiple
  739. docstrings, adding them to the tail of a compiled procedure's
  740. properties. For example:
  741. (define (foo)
  742. "one"
  743. "two"
  744. 3)
  745. (procedure-properties foo)
  746. => ((name . foo) (documentation . "one") (documentation . "two"))
  747. Also, vectors of pairs are now treated as additional metadata entries:
  748. (define (bar)
  749. #((quz . #f) (docstring . "xyzzy"))
  750. 3)
  751. (procedure-properties bar)
  752. => ((name . bar) (quz . #f) (docstring . "xyzzy"))
  753. This allows arbitrary literals to be embedded as metadata in a compiled
  754. procedure.
  755. ** The psyntax expander now knows how to interpret the @ and @@ special
  756. forms.
  757. ** The psyntax expander is now hygienic with respect to modules.
  758. Free variables in a macro are scoped in the module that the macro was
  759. defined in, not in the module the macro is used in. For example, code
  760. like this works now:
  761. (define-module (foo) #:export (bar))
  762. (define (helper x) ...)
  763. (define-syntax bar
  764. (syntax-rules () ((_ x) (helper x))))
  765. (define-module (baz) #:use-module (foo))
  766. (bar qux)
  767. It used to be you had to export `helper' from `(foo)' as well.
  768. Thankfully, this has been fixed.
  769. ** Support for version information in Guile's `module' form
  770. Guile modules now have a `#:version' field. See "R6RS Version
  771. References", "General Information about Modules", "Using Guile Modules",
  772. and "Creating Guile Modules" in the manual for more information.
  773. ** Support for renaming bindings on module export
  774. Wherever Guile accepts a symbol as an argument to specify a binding to
  775. export, it now also accepts a pair of symbols, indicating that a binding
  776. should be renamed on export. See "Creating Guile Modules" in the manual
  777. for more information.
  778. ** New procedure: `module-export-all!'
  779. This procedure exports all current and future bindings from a module.
  780. Use as `(module-export-all! (current-module))'.
  781. ** New procedure `reload-module', and `,reload' REPL command
  782. See "Module System Reflection" and "Module Commands" in the manual, for
  783. more information.
  784. ** `eval-case' has been deprecated, and replaced by `eval-when'.
  785. The semantics of `eval-when' are easier to understand. See "Eval When"
  786. in the manual, for more information.
  787. ** Guile is now more strict about prohibiting definitions in expression
  788. contexts.
  789. Although previous versions of Guile accepted it, the following
  790. expression is not valid, in R5RS or R6RS:
  791. (if test (define foo 'bar) (define foo 'baz))
  792. In this specific case, it would be better to do:
  793. (define foo (if test 'bar 'baz))
  794. It is possible to circumvent this restriction with e.g.
  795. `(module-define! (current-module) 'foo 'baz)'. Contact the list if you
  796. have any questions.
  797. ** Support for `letrec*'
  798. Guile now supports `letrec*', a recursive lexical binding operator in
  799. which the identifiers are bound in order. See "Local Bindings" in the
  800. manual, for more details.
  801. ** Internal definitions now expand to `letrec*'
  802. Following the R6RS, internal definitions now expand to letrec* instead
  803. of letrec. The following program is invalid for R5RS, but valid for
  804. R6RS:
  805. (define (foo)
  806. (define bar 10)
  807. (define baz (+ bar 20))
  808. baz)
  809. ;; R5RS and Guile <= 1.8:
  810. (foo) => Unbound variable: bar
  811. ;; R6RS and Guile >= 2.0:
  812. (foo) => 30
  813. This change should not affect correct R5RS programs, or programs written
  814. in earlier Guile dialects.
  815. ** Macro expansion produces structures instead of s-expressions
  816. In the olden days, macroexpanding an s-expression would yield another
  817. s-expression. Though the lexical variables were renamed, expansions of
  818. core forms like `if' and `begin' were still non-hygienic, as they relied
  819. on the toplevel definitions of `if' et al being the conventional ones.
  820. The solution is to expand to structures instead of s-expressions. There
  821. is an `if' structure, a `begin' structure, a `toplevel-ref' structure,
  822. etc. The expander already did this for compilation, producing Tree-IL
  823. directly; it has been changed now to do so when expanding for the
  824. evaluator as well.
  825. ** Defmacros must now produce valid Scheme expressions.
  826. It used to be that defmacros could unquote in Scheme values, as a way of
  827. supporting partial evaluation, and avoiding some hygiene issues. For
  828. example:
  829. (define (helper x) ...)
  830. (define-macro (foo bar)
  831. `(,helper ,bar))
  832. Assuming this macro is in the `(baz)' module, the direct translation of
  833. this code would be:
  834. (define (helper x) ...)
  835. (define-macro (foo bar)
  836. `((@@ (baz) helper) ,bar))
  837. Of course, one could just use a hygienic macro instead:
  838. (define-syntax foo
  839. (syntax-rules ()
  840. ((_ bar) (helper bar))))
  841. ** Guile's psyntax now supports docstrings and internal definitions.
  842. The following Scheme is not strictly legal:
  843. (define (foo)
  844. "bar"
  845. (define (baz) ...)
  846. (baz))
  847. However its intent is fairly clear. Guile interprets "bar" to be the
  848. docstring of `foo', and the definition of `baz' is still in definition
  849. context.
  850. ** Support for settable identifier syntax
  851. Following the R6RS, "variable transformers" are settable
  852. identifier-syntax. See "Identifier macros" in the manual, for more
  853. information.
  854. ** syntax-case treats `_' as a placeholder
  855. Following R6RS, a `_' in a syntax-rules or syntax-case pattern matches
  856. anything, and binds no pattern variables. Unlike the R6RS, Guile also
  857. permits `_' to be in the literals list for a pattern.
  858. ** Macros need to be defined before their first use.
  859. It used to be that with lazy memoization, this might work:
  860. (define (foo x)
  861. (ref x))
  862. (define-macro (ref x) x)
  863. (foo 1) => 1
  864. But now, the body of `foo' is interpreted to mean a call to the toplevel
  865. `ref' function, instead of a macro expansion. The solution is to define
  866. macros before code that uses them.
  867. ** Functions needed by macros at expand-time need to be present at
  868. expand-time.
  869. For example, this code will work at the REPL:
  870. (define (double-helper x) (* x x))
  871. (define-macro (double-literal x) (double-helper x))
  872. (double-literal 2) => 4
  873. But it will not work when a file is compiled, because the definition of
  874. `double-helper' is not present at expand-time. The solution is to wrap
  875. the definition of `double-helper' in `eval-when':
  876. (eval-when (load compile eval)
  877. (define (double-helper x) (* x x)))
  878. (define-macro (double-literal x) (double-helper x))
  879. (double-literal 2) => 4
  880. See the documentation for eval-when for more information.
  881. ** `macroexpand' produces structures, not S-expressions.
  882. Given the need to maintain referential transparency, both lexically and
  883. modular, the result of expanding Scheme expressions is no longer itself
  884. an s-expression. If you want a human-readable approximation of the
  885. result of `macroexpand', call `tree-il->scheme' from `(language
  886. tree-il)'.
  887. ** Removed function: `macroexpand-1'
  888. It is unclear how to implement `macroexpand-1' with syntax-case, though
  889. PLT Scheme does prove that it is possible.
  890. ** New reader macros: #' #` #, #,@
  891. These macros translate, respectively, to `syntax', `quasisyntax',
  892. `unsyntax', and `unsyntax-splicing'. See the R6RS for more information.
  893. These reader macros may be overridden by `read-hash-extend'.
  894. ** Incompatible change to #'
  895. Guile did have a #' hash-extension, by default, which just returned the
  896. subsequent datum: #'foo => foo. In the unlikely event that anyone
  897. actually used this, this behavior may be reinstated via the
  898. `read-hash-extend' mechanism.
  899. ** `unquote' and `unquote-splicing' accept multiple expressions
  900. As per the R6RS, these syntax operators can now accept any number of
  901. expressions to unquote.
  902. ** Scheme expresssions may be commented out with #;
  903. #; comments out an entire expression. See SRFI-62 or the R6RS for more
  904. information.
  905. ** Prompts: Delimited, composable continuations
  906. Guile now has prompts as part of its primitive language. See "Prompts"
  907. in the manual, for more information.
  908. Expressions entered in at the REPL, or from the command line, are
  909. surrounded by a prompt with the default prompt tag.
  910. ** `make-stack' with a tail-called procedural narrowing argument no longer
  911. works (with compiled procedures)
  912. It used to be the case that a captured stack could be narrowed to select
  913. calls only up to or from a certain procedure, even if that procedure
  914. already tail-called another procedure. This was because the debug
  915. information from the original procedure was kept on the stack.
  916. Now with the new compiler, the stack only contains active frames from
  917. the current continuation. A narrow to a procedure that is not in the
  918. stack will result in an empty stack. To fix this, narrow to a procedure
  919. that is active in the current continuation, or narrow to a specific
  920. number of stack frames.
  921. ** Backtraces through compiled procedures only show procedures that are
  922. active in the current continuation
  923. Similarly to the previous issue, backtraces in compiled code may be
  924. different from backtraces in interpreted code. There are no semantic
  925. differences, however. Please mail bug-guile@gnu.org if you see any
  926. deficiencies with Guile's backtraces.
  927. ** `positions' reader option enabled by default
  928. This change allows primitive-load without --auto-compile to also
  929. propagate source information through the expander, for better errors and
  930. to let macros know their source locations. The compiler was already
  931. turning it on anyway.
  932. ** New macro: `current-source-location'
  933. The macro returns the current source location (to be documented).
  934. ** syntax-rules and syntax-case macros now propagate source information
  935. through to the expanded code
  936. This should result in better backtraces.
  937. ** The currying behavior of `define' has been removed.
  938. Before, `(define ((f a) b) (* a b))' would translate to
  939. (define f (lambda (a) (lambda (b) (* a b))))
  940. Now a syntax error is signaled, as this syntax is not supported by
  941. default. Use the `(ice-9 curried-definitions)' module to get back the
  942. old behavior.
  943. ** New procedure, `define!'
  944. `define!' is a procedure that takes two arguments, a symbol and a value,
  945. and binds the value to the symbol in the current module. It's useful to
  946. programmatically make definitions in the current module, and is slightly
  947. less verbose than `module-define!'.
  948. ** All modules have names now
  949. Before, you could have anonymous modules: modules without names. Now,
  950. because of hygiene and macros, all modules have names. If a module was
  951. created without a name, the first time `module-name' is called on it, a
  952. fresh name will be lazily generated for it.
  953. ** The module namespace is now separate from the value namespace
  954. It was a little-known implementation detail of Guile's module system
  955. that it was built on a single hierarchical namespace of values -- that
  956. if there was a module named `(foo bar)', then in the module named
  957. `(foo)' there was a binding from `bar' to the `(foo bar)' module.
  958. This was a neat trick, but presented a number of problems. One problem
  959. was that the bindings in a module were not apparent from the module
  960. itself; perhaps the `(foo)' module had a private binding for `bar', and
  961. then an external contributor defined `(foo bar)'. In the end there can
  962. be only one binding, so one of the two will see the wrong thing, and
  963. produce an obtuse error of unclear provenance.
  964. Also, the public interface of a module was also bound in the value
  965. namespace, as `%module-public-interface'. This was a hack from the early
  966. days of Guile's modules.
  967. Both of these warts have been fixed by the addition of fields in the
  968. `module' data type. Access to modules and their interfaces from the
  969. value namespace has been deprecated, and all accessors use the new
  970. record accessors appropriately.
  971. When Guile is built with support for deprecated code, as is the default,
  972. the value namespace is still searched for modules and public interfaces,
  973. and a deprecation warning is raised as appropriate.
  974. Finally, to support lazy loading of modules as one used to be able to do
  975. with module binder procedures, Guile now has submodule binders, called
  976. if a given submodule is not found. See boot-9.scm for more information.
  977. ** New procedures: module-ref-submodule, module-define-submodule,
  978. nested-ref-module, nested-define-module!, local-ref-module,
  979. local-define-module
  980. These new accessors are like their bare variants, but operate on
  981. namespaces instead of values.
  982. ** The (app modules) module tree is officially deprecated
  983. It used to be that one could access a module named `(foo bar)' via
  984. `(nested-ref the-root-module '(app modules foo bar))'. The `(app
  985. modules)' bit was a never-used and never-documented abstraction, and has
  986. been deprecated. See the following mail for a full discussion:
  987. http://lists.gnu.org/archive/html/guile-devel/2010-04/msg00168.html
  988. The `%app' binding is also deprecated.
  989. ** `module-filename' field and accessor
  990. Modules now record the file in which they are defined. This field may be
  991. accessed with the new `module-filename' procedure.
  992. ** Modules load within a known environment
  993. It takes a few procedure calls to define a module, and those procedure
  994. calls need to be in scope. Now we ensure that the current module when
  995. loading a module is one that has the needed bindings, instead of relying
  996. on chance.
  997. ** `load' is a macro (!) that resolves paths relative to source file dir
  998. The familiar Schem `load' procedure is now a macro that captures the
  999. name of the source file being expanded, and dispatches to the new
  1000. `load-in-vicinity'. Referencing `load' by bare name returns a closure
  1001. that embeds the current source file name.
  1002. This fix allows `load' of relative paths to be resolved with respect to
  1003. the location of the file that calls `load'.
  1004. ** Many syntax errors have different texts now
  1005. Syntax errors still throw to the `syntax-error' key, but the arguments
  1006. are often different now. Perhaps in the future, Guile will switch to
  1007. using standard SRFI-35 conditions.
  1008. ** Returning multiple values to compiled code will silently truncate the
  1009. values to the expected number
  1010. For example, the interpreter would raise an error evaluating the form,
  1011. `(+ (values 1 2) (values 3 4))', because it would see the operands as
  1012. being two compound "values" objects, to which `+' does not apply.
  1013. The compiler, on the other hand, receives multiple values on the stack,
  1014. not as a compound object. Given that it must check the number of values
  1015. anyway, if too many values are provided for a continuation, it chooses
  1016. to truncate those values, effectively evaluating `(+ 1 3)' instead.
  1017. The idea is that the semantics that the compiler implements is more
  1018. intuitive, and the use of the interpreter will fade out with time.
  1019. This behavior is allowed both by the R5RS and the R6RS.
  1020. ** Multiple values in compiled code are not represented by compound
  1021. objects
  1022. This change may manifest itself in the following situation:
  1023. (let ((val (foo))) (do-something) val)
  1024. In the interpreter, if `foo' returns multiple values, multiple values
  1025. are produced from the `let' expression. In the compiler, those values
  1026. are truncated to the first value, and that first value is returned. In
  1027. the compiler, if `foo' returns no values, an error will be raised, while
  1028. the interpreter would proceed.
  1029. Both of these behaviors are allowed by R5RS and R6RS. The compiler's
  1030. behavior is more correct, however. If you wish to preserve a potentially
  1031. multiply-valued return, you will need to set up a multiple-value
  1032. continuation, using `call-with-values'.
  1033. ** Defmacros are now implemented in terms of syntax-case.
  1034. The practical ramification of this is that the `defmacro?' predicate has
  1035. been removed, along with `defmacro-transformer', `macro-table',
  1036. `xformer-table', `assert-defmacro?!', `set-defmacro-transformer!' and
  1037. `defmacro:transformer'. This is because defmacros are simply macros. If
  1038. any of these procedures provided useful facilities to you, we encourage
  1039. you to contact the Guile developers.
  1040. ** Hygienic macros documented as the primary syntactic extension mechanism.
  1041. The macro documentation was finally fleshed out with some documentation
  1042. on `syntax-rules' and `syntax-case' macros, and other parts of the macro
  1043. expansion process. See "Macros" in the manual, for details.
  1044. ** psyntax is now the default expander
  1045. Scheme code is now expanded by default by the psyntax hygienic macro
  1046. expander. Expansion is performed completely before compilation or
  1047. interpretation.
  1048. Notably, syntax errors will be signalled before interpretation begins.
  1049. In the past, many syntax errors were only detected at runtime if the
  1050. code in question was memoized.
  1051. As part of its expansion, psyntax renames all lexically-bound
  1052. identifiers. Original identifier names are preserved and given to the
  1053. compiler, but the interpreter will see the renamed variables, e.g.,
  1054. `x432' instead of `x'.
  1055. Note that the psyntax that Guile uses is a fork, as Guile already had
  1056. modules before incompatible modules were added to psyntax -- about 10
  1057. years ago! Thus there are surely a number of bugs that have been fixed
  1058. in psyntax since then. If you find one, please notify bug-guile@gnu.org.
  1059. ** syntax-rules and syntax-case are available by default.
  1060. There is no longer any need to import the `(ice-9 syncase)' module
  1061. (which is now deprecated). The expander may be invoked directly via
  1062. `macroexpand', though it is normally searched for via the current module
  1063. transformer.
  1064. Also, the helper routines for syntax-case are available in the default
  1065. environment as well: `syntax->datum', `datum->syntax',
  1066. `bound-identifier=?', `free-identifier=?', `generate-temporaries',
  1067. `identifier?', and `syntax-violation'. See the R6RS for documentation.
  1068. ** Tail patterns in syntax-case
  1069. Guile has pulled in some more recent changes from the psyntax portable
  1070. syntax expander, to implement support for "tail patterns". Such patterns
  1071. are supported by syntax-rules and syntax-case. This allows a syntax-case
  1072. match clause to have ellipses, then a pattern at the end. For example:
  1073. (define-syntax case
  1074. (syntax-rules (else)
  1075. ((_ val match-clause ... (else e e* ...))
  1076. [...])))
  1077. Note how there is MATCH-CLAUSE, which is ellipsized, then there is a
  1078. tail pattern for the else clause. Thanks to Andreas Rottmann for the
  1079. patch, and Kent Dybvig for the code.
  1080. ** Lexical bindings introduced by hygienic macros may not be referenced
  1081. by nonhygienic macros.
  1082. If a lexical binding is introduced by a hygienic macro, it may not be
  1083. referenced by a nonhygienic macro. For example, this works:
  1084. (let ()
  1085. (define-macro (bind-x val body)
  1086. `(let ((x ,val)) ,body))
  1087. (define-macro (ref x)
  1088. x)
  1089. (bind-x 10 (ref x)))
  1090. But this does not:
  1091. (let ()
  1092. (define-syntax bind-x
  1093. (syntax-rules ()
  1094. ((_ val body) (let ((x val)) body))))
  1095. (define-macro (ref x)
  1096. x)
  1097. (bind-x 10 (ref x)))
  1098. It is not normal to run into this situation with existing code. However,
  1099. if you have defmacros that expand to hygienic macros, it is possible to
  1100. run into situations like this. For example, if you have a defmacro that
  1101. generates a `while' expression, the `break' bound by the `while' may not
  1102. be visible within other parts of your defmacro. The solution is to port
  1103. from defmacros to syntax-rules or syntax-case.
  1104. ** Macros may no longer be referenced as first-class values.
  1105. In the past, you could evaluate e.g. `if', and get its macro value. Now,
  1106. expanding this form raises a syntax error.
  1107. Macros still /exist/ as first-class values, but they must be
  1108. /referenced/ via the module system, e.g. `(module-ref (current-module)
  1109. 'if)'.
  1110. ** Macros may now have docstrings.
  1111. `object-documentation' from `(ice-9 documentation)' may be used to
  1112. retrieve the docstring, once you have a macro value -- but see the above
  1113. note about first-class macros. Docstrings are associated with the syntax
  1114. transformer procedures.
  1115. ** `case-lambda' is now available in the default environment.
  1116. The binding in the default environment is equivalent to the one from the
  1117. `(srfi srfi-16)' module. Use the srfi-16 module explicitly if you wish
  1118. to maintain compatibility with Guile 1.8 and earlier.
  1119. ** Procedures may now have more than one arity.
  1120. This can be the case, for example, in case-lambda procedures. The
  1121. arities of compiled procedures may be accessed via procedures from the
  1122. `(system vm program)' module; see "Compiled Procedures", "Optional
  1123. Arguments", and "Case-lambda" in the manual.
  1124. ** Deprecate arity access via (procedure-properties proc 'arity)
  1125. Instead of accessing a procedure's arity as a property, use the new
  1126. `procedure-minimum-arity' function, which gives the most permissive
  1127. arity that the function has, in the same format as the old arity
  1128. accessor.
  1129. ** `lambda*' and `define*' are now available in the default environment
  1130. As with `case-lambda', `(ice-9 optargs)' continues to be supported, for
  1131. compatibility purposes. No semantic change has been made (we hope).
  1132. Optional and keyword arguments now dispatch via special VM operations,
  1133. without the need to cons rest arguments, making them very fast.
  1134. ** New syntax: define-once
  1135. `define-once' is like Lisp's `defvar': it creates a toplevel binding,
  1136. but only if one does not exist already.
  1137. ** New function, `truncated-print', with `format' support
  1138. `(ice-9 pretty-print)' now exports `truncated-print', a printer that
  1139. will ensure that the output stays within a certain width, truncating the
  1140. output in what is hopefully an intelligent manner. See the manual for
  1141. more details.
  1142. There is a new `format' specifier, `~@y', for doing a truncated
  1143. print (as opposed to `~y', which does a pretty-print). See the `format'
  1144. documentation for more details.
  1145. ** Better pretty-printing
  1146. Indentation recognizes more special forms, like `syntax-case', and read
  1147. macros like `quote' are printed better.
  1148. ** Passing a number as the destination of `format' is deprecated
  1149. The `format' procedure in `(ice-9 format)' now emits a deprecation
  1150. warning if a number is passed as its first argument.
  1151. Also, it used to be that you could omit passing a port to `format', in
  1152. some cases. This still works, but has been formally deprecated.
  1153. ** SRFI-4 vectors reimplemented in terms of R6RS bytevectors
  1154. Guile now implements SRFI-4 vectors using bytevectors. Often when you
  1155. have a numeric vector, you end up wanting to write its bytes somewhere,
  1156. or have access to the underlying bytes, or read in bytes from somewhere
  1157. else. Bytevectors are very good at this sort of thing. But the SRFI-4
  1158. APIs are nicer to use when doing number-crunching, because they are
  1159. addressed by element and not by byte.
  1160. So as a compromise, Guile allows all bytevector functions to operate on
  1161. numeric vectors. They address the underlying bytes in the native
  1162. endianness, as one would expect.
  1163. Following the same reasoning, that it's just bytes underneath, Guile
  1164. also allows uniform vectors of a given type to be accessed as if they
  1165. were of any type. One can fill a u32vector, and access its elements with
  1166. u8vector-ref. One can use f64vector-ref on bytevectors. It's all the
  1167. same to Guile.
  1168. In this way, uniform numeric vectors may be written to and read from
  1169. input/output ports using the procedures that operate on bytevectors.
  1170. Calls to SRFI-4 accessors (ref and set functions) from Scheme are now
  1171. inlined to the VM instructions for bytevector access.
  1172. See "SRFI-4" in the manual, for more information.
  1173. ** Nonstandard SRFI-4 procedures now available from `(srfi srfi-4 gnu)'
  1174. Guile's `(srfi srfi-4)' now only exports those srfi-4 procedures that
  1175. are part of the standard. Complex uniform vectors and the
  1176. `any->FOOvector' family are now available only from `(srfi srfi-4 gnu)'.
  1177. Guile's default environment imports `(srfi srfi-4)', and probably should
  1178. import `(srfi srfi-4 gnu)' as well.
  1179. See "SRFI-4 Extensions" in the manual, for more information.
  1180. ** New syntax: include-from-path.
  1181. `include-from-path' is like `include', except it looks for its file in
  1182. the load path. It can be used to compile other files into a file.
  1183. ** New syntax: quasisyntax.
  1184. `quasisyntax' is to `syntax' as `quasiquote' is to `quote'. See the R6RS
  1185. documentation for more information. Thanks to Andre van Tonder for the
  1186. implementation.
  1187. ** `*unspecified*' is identifier syntax
  1188. `*unspecified*' is no longer a variable, so it is optimized properly by
  1189. the compiler, and is not `set!'-able.
  1190. ** Changes and bugfixes in numerics code
  1191. *** Added six new sets of fast quotient and remainder operators
  1192. Added six new sets of fast quotient and remainder operator pairs with
  1193. different semantics than the R5RS operators. They support not only
  1194. integers, but all reals, including exact rationals and inexact
  1195. floating point numbers.
  1196. These procedures accept two real numbers N and D, where the divisor D
  1197. must be non-zero. Each set of operators computes an integer quotient
  1198. Q and a real remainder R such that N = Q*D + R and |R| < |D|. They
  1199. differ only in how N/D is rounded to produce Q.
  1200. `euclidean-quotient' returns the integer Q and `euclidean-remainder'
  1201. returns the real R such that N = Q*D + R and 0 <= R < |D|. `euclidean/'
  1202. returns both Q and R, and is more efficient than computing each
  1203. separately. Note that when D > 0, `euclidean-quotient' returns
  1204. floor(N/D), and when D < 0 it returns ceiling(N/D).
  1205. `centered-quotient', `centered-remainder', and `centered/' are similar
  1206. except that the range of remainders is -abs(D/2) <= R < abs(D/2), and
  1207. `centered-quotient' rounds N/D to the nearest integer. Note that these
  1208. operators are equivalent to the R6RS integer division operators `div',
  1209. `mod', `div-and-mod', `div0', `mod0', and `div0-and-mod0'.
  1210. `floor-quotient' and `floor-remainder' compute Q and R, respectively,
  1211. where Q has been rounded toward negative infinity. `floor/' returns
  1212. both Q and R, and is more efficient than computing each separately.
  1213. Note that when applied to integers, `floor-remainder' is equivalent to
  1214. the R5RS integer-only `modulo' operator. `ceiling-quotient',
  1215. `ceiling-remainder', and `ceiling/' are similar except that Q is
  1216. rounded toward positive infinity.
  1217. For `truncate-quotient', `truncate-remainder', and `truncate/', Q is
  1218. rounded toward zero. Note that when applied to integers,
  1219. `truncate-quotient' and `truncate-remainder' are equivalent to the
  1220. R5RS integer-only operators `quotient' and `remainder'.
  1221. For `round-quotient', `round-remainder', and `round/', Q is rounded to
  1222. the nearest integer, with ties going to the nearest even integer.
  1223. *** Complex number changes
  1224. Guile is now able to represent non-real complex numbers whose
  1225. imaginary part is an _inexact_ zero (0.0 or -0.0), per R6RS.
  1226. Previously, such numbers were immediately changed into inexact reals.
  1227. (real? 0.0+0.0i) now returns #f, per R6RS, although (zero? 0.0+0.0i)
  1228. still returns #t, per R6RS. (= 0 0.0+0.0i) and (= 0.0 0.0+0.0i) are
  1229. #t, but the same comparisons using `eqv?' or `equal?' are #f.
  1230. Like other non-real numbers, these complex numbers with inexact zero
  1231. imaginary part will raise exceptions is passed to procedures requiring
  1232. reals, such as `<', `>', `<=', `>=', `min', `max', `positive?',
  1233. `negative?', `inf?', `nan?', `finite?', etc.
  1234. **** `make-rectangular' changes
  1235. scm_make_rectangular `make-rectangular' now returns a real number only
  1236. if the imaginary part is an _exact_ 0. Previously, it would return a
  1237. real number if the imaginary part was an inexact zero.
  1238. scm_c_make_rectangular now always returns a non-real complex number,
  1239. even if the imaginary part is zero. Previously, it would return a
  1240. real number if the imaginary part was zero.
  1241. **** `make-polar' changes
  1242. scm_make_polar `make-polar' now returns a real number only if the
  1243. angle or magnitude is an _exact_ 0. If the magnitude is an exact 0,
  1244. it now returns an exact 0. Previously, it would return a real
  1245. number if the imaginary part was an inexact zero.
  1246. scm_c_make_polar now always returns a non-real complex number, even if
  1247. the imaginary part is 0.0. Previously, it would return a real number
  1248. if the imaginary part was 0.0.
  1249. **** `imag-part' changes
  1250. scm_imag_part `imag-part' now returns an exact 0 if applied to an
  1251. inexact real number. Previously it returned an inexact zero in this
  1252. case.
  1253. *** `eqv?' and `equal?' now compare numbers equivalently
  1254. scm_equal_p `equal?' now behaves equivalently to scm_eqv_p `eqv?' for
  1255. numeric values, per R5RS. Previously, equal? worked differently,
  1256. e.g. `(equal? 0.0 -0.0)' returned #t but `(eqv? 0.0 -0.0)' returned #f,
  1257. and `(equal? +nan.0 +nan.0)' returned #f but `(eqv? +nan.0 +nan.0)'
  1258. returned #t.
  1259. *** `(equal? +nan.0 +nan.0)' now returns #t
  1260. Previously, `(equal? +nan.0 +nan.0)' returned #f, although
  1261. `(let ((x +nan.0)) (equal? x x))' and `(eqv? +nan.0 +nan.0)'
  1262. both returned #t. R5RS requires that `equal?' behave like
  1263. `eqv?' when comparing numbers.
  1264. *** Change in handling products `*' involving exact 0
  1265. scm_product `*' now handles exact 0 differently. A product containing
  1266. an exact 0 now returns an exact 0 if and only if the other arguments
  1267. are all exact. An inexact zero is returned if and only if the other
  1268. arguments are all finite but not all exact. If an infinite or NaN
  1269. value is present, a NaN value is returned. Previously, any product
  1270. containing an exact 0 yielded an exact 0, regardless of the other
  1271. arguments.
  1272. *** `expt' and `integer-expt' changes when the base is 0
  1273. While `(expt 0 0)' is still 1, and `(expt 0 N)' for N > 0 is still
  1274. zero, `(expt 0 N)' for N < 0 is now a NaN value, and likewise for
  1275. integer-expt. This is more correct, and conforming to R6RS, but seems
  1276. to be incompatible with R5RS, which would return 0 for all non-zero
  1277. values of N.
  1278. *** `expt' and `integer-expt' are more generic, less strict
  1279. When raising to an exact non-negative integer exponent, `expt' and
  1280. `integer-expt' are now able to exponentiate any object that can be
  1281. multiplied using `*'. They can also raise an object to an exact
  1282. negative integer power if its reciprocal can be taken using `/'.
  1283. In order to allow this, the type of the first argument is no longer
  1284. checked when raising to an exact integer power. If the exponent is 0
  1285. or 1, the first parameter is not manipulated at all, and need not
  1286. even support multiplication.
  1287. *** Infinities are no longer integers, nor rationals
  1288. scm_integer_p `integer?' and scm_rational_p `rational?' now return #f
  1289. for infinities, per R6RS. Previously they returned #t for real
  1290. infinities. The real infinities and NaNs are still considered real by
  1291. scm_real `real?' however, per R6RS.
  1292. *** NaNs are no longer rationals
  1293. scm_rational_p `rational?' now returns #f for NaN values, per R6RS.
  1294. Previously it returned #t for real NaN values. They are still
  1295. considered real by scm_real `real?' however, per R6RS.
  1296. *** `inf?' and `nan?' now throw exceptions for non-reals
  1297. The domain of `inf?' and `nan?' is the real numbers. Guile now signals
  1298. an error when a non-real number or non-number is passed to these
  1299. procedures. (Note that NaNs _are_ considered numbers by scheme, despite
  1300. their name).
  1301. *** `rationalize' bugfixes and changes
  1302. Fixed bugs in scm_rationalize `rationalize'. Previously, it returned
  1303. exact integers unmodified, although that was incorrect if the epsilon
  1304. was at least 1 or inexact, e.g. (rationalize 4 1) should return 3 per
  1305. R5RS and R6RS, but previously it returned 4. It also now handles
  1306. cases involving infinities and NaNs properly, per R6RS.
  1307. *** Trigonometric functions now return exact numbers in some cases
  1308. scm_sin `sin', scm_cos `cos', scm_tan `tan', scm_asin `asin', scm_acos
  1309. `acos', scm_atan `atan', scm_sinh `sinh', scm_cosh `cosh', scm_tanh
  1310. `tanh', scm_sys_asinh `asinh', scm_sys_acosh `acosh', and
  1311. scm_sys_atanh `atanh' now return exact results in some cases.
  1312. *** New procedure: `finite?'
  1313. Add scm_finite_p `finite?' from R6RS to guile core, which returns #t
  1314. if and only if its argument is neither infinite nor a NaN. Note that
  1315. this is not the same as (not (inf? x)) or (not (infinite? x)), since
  1316. NaNs are neither finite nor infinite.
  1317. *** Improved exactness handling for complex number parsing
  1318. When parsing non-real complex numbers, exactness specifiers are now
  1319. applied to each component, as is done in PLT Scheme. For complex
  1320. numbers written in rectangular form, exactness specifiers are applied
  1321. to the real and imaginary parts before calling scm_make_rectangular.
  1322. For complex numbers written in polar form, exactness specifiers are
  1323. applied to the magnitude and angle before calling scm_make_polar.
  1324. Previously, exactness specifiers were applied to the number as a whole
  1325. _after_ calling scm_make_rectangular or scm_make_polar.
  1326. For example, (string->number "#i5.0+0i") now does the equivalent of:
  1327. (make-rectangular (exact->inexact 5.0) (exact->inexact 0))
  1328. which yields 5.0+0.0i. Previously it did the equivalent of:
  1329. (exact->inexact (make-rectangular 5.0 0))
  1330. which yielded 5.0.
  1331. ** Unicode characters
  1332. Unicode characters may be entered in octal format via e.g. `#\454', or
  1333. created via (integer->char 300). A hex external representation will
  1334. probably be introduced at some point.
  1335. ** Unicode strings
  1336. Internally, strings are now represented either in the `latin-1'
  1337. encoding, one byte per character, or in UTF-32, with four bytes per
  1338. character. Strings manage their own allocation, switching if needed.
  1339. Extended characters may be written in a literal string using the
  1340. hexadecimal escapes `\xXX', `\uXXXX', or `\UXXXXXX', for 8-bit, 16-bit,
  1341. or 24-bit codepoints, respectively, or entered directly in the native
  1342. encoding of the port on which the string is read.
  1343. ** Unicode symbols
  1344. One may now use U+03BB (GREEK SMALL LETTER LAMBDA) as an identifier.
  1345. ** Support for non-ASCII source code files
  1346. The default reader now handles source code files for some of the
  1347. non-ASCII character encodings, such as UTF-8. A non-ASCII source file
  1348. should have an encoding declaration near the top of the file. Also,
  1349. there is a new function, `file-encoding', that scans a port for a coding
  1350. declaration. See the section of the manual entitled, "Character Encoding
  1351. of Source Files".
  1352. The pre-1.9.3 reader handled 8-bit clean but otherwise unspecified source
  1353. code. This use is now discouraged. Binary input and output is
  1354. currently supported by opening ports in the ISO-8859-1 locale.
  1355. ** Source files default to UTF-8.
  1356. If source files do not specify their encoding via a `coding:' block,
  1357. the default encoding is UTF-8, instead of being taken from the current
  1358. locale.
  1359. ** Interactive Guile installs the current locale.
  1360. Instead of leaving the user in the "C" locale, running the Guile REPL
  1361. installs the current locale. [FIXME xref?]
  1362. ** Support for locale transcoding when reading from and writing to ports
  1363. Ports now have an associated character encoding, and port read and write
  1364. operations do conversion to and from locales automatically. Ports also
  1365. have an associated strategy for how to deal with locale conversion
  1366. failures.
  1367. See the documentation in the manual for the four new support functions,
  1368. `set-port-encoding!', `port-encoding', `set-port-conversion-strategy!',
  1369. and `port-conversion-strategy'.
  1370. ** String and SRFI-13 functions can operate on Unicode strings
  1371. ** Unicode support for SRFI-14 character sets
  1372. The default character sets are no longer locale dependent and contain
  1373. characters from the whole Unicode range. There is a new predefined
  1374. character set, `char-set:designated', which contains all assigned
  1375. Unicode characters. There is a new debugging function, `%char-set-dump'.
  1376. ** Character functions operate on Unicode characters
  1377. `char-upcase' and `char-downcase' use default Unicode casing rules.
  1378. Character comparisons such as `char<?' and `char-ci<?' now sort based on
  1379. Unicode code points.
  1380. ** Global variables `scm_charnames' and `scm_charnums' are removed
  1381. These variables contained the names of control characters and were
  1382. used when writing characters. While these were global, they were
  1383. never intended to be public API. They have been replaced with private
  1384. functions.
  1385. ** EBCDIC support is removed
  1386. There was an EBCDIC compile flag that altered some of the character
  1387. processing. It appeared that full EBCDIC support was never completed
  1388. and was unmaintained.
  1389. ** Compile-time warnings
  1390. Guile can warn about potentially unbound free variables. Pass the
  1391. -Wunbound-variable on the `guile-tools compile' command line, or add
  1392. `#:warnings '(unbound-variable)' to your `compile' or `compile-file'
  1393. invocation. Warnings are also enabled by default for expressions entered
  1394. at the REPL.
  1395. Guile can also warn when you pass the wrong number of arguments to a
  1396. procedure, with -Warity-mismatch, or `arity-mismatch' in the
  1397. `#:warnings' as above.
  1398. Other warnings include `-Wunused-variable' and `-Wunused-toplevel', to
  1399. warn about unused local or global (top-level) variables, and `-Wformat',
  1400. to check for various errors related to the `format' procedure.
  1401. ** A new `memoize-symbol' evaluator trap has been added.
  1402. This trap can be used for efficiently implementing a Scheme code
  1403. coverage.
  1404. ** Duplicate bindings among used modules are resolved lazily.
  1405. This slightly improves program startup times.
  1406. ** New thread cancellation and thread cleanup API
  1407. See `cancel-thread', `set-thread-cleanup!', and `thread-cleanup'.
  1408. ** New threads are in `(guile-user)' by default, not `(guile)'
  1409. It used to be that a new thread entering Guile would do so in the
  1410. `(guile)' module, unless this was the first time Guile was initialized,
  1411. in which case it was `(guile-user)'. This has been fixed to have all
  1412. new threads unknown to Guile default to `(guile-user)'.
  1413. ** New helpers: `print-exception', `set-exception-printer!'
  1414. These functions implement an extensible exception printer. Guile
  1415. registers printers for all of the exceptions it throws. Users may add
  1416. their own printers. There is also `scm_print_exception', for use by C
  1417. programs. Pleasantly, this allows SRFI-35 and R6RS exceptions to be
  1418. printed appropriately.
  1419. ** GOOPS dispatch in scheme
  1420. As an implementation detail, GOOPS dispatch is no longer implemented by
  1421. special evaluator bytecodes, but rather directly via a Scheme function
  1422. associated with an applicable struct. There is some VM support for the
  1423. underlying primitives, like `class-of'.
  1424. This change will in the future allow users to customize generic function
  1425. dispatch without incurring a performance penalty, and allow us to
  1426. implement method combinations.
  1427. ** Applicable struct support
  1428. One may now make structs from Scheme that may be applied as procedures.
  1429. To do so, make a struct whose vtable is `<applicable-struct-vtable>'.
  1430. That struct will be the vtable of your applicable structs; instances of
  1431. that new struct are assumed to have the procedure in their first slot.
  1432. `<applicable-struct-vtable>' is like Common Lisp's
  1433. `funcallable-standard-class'. Likewise there is
  1434. `<applicable-struct-with-setter-vtable>', which looks for the setter in
  1435. the second slot. This needs to be better documented.
  1436. ** GOOPS cleanups.
  1437. GOOPS had a number of concepts that were relevant to the days of Tcl,
  1438. but not any more: operators and entities, mainly. These objects were
  1439. never documented, and it is unlikely that they were ever used. Operators
  1440. were a kind of generic specific to the Tcl support. Entities were
  1441. replaced by applicable structs, mentioned above.
  1442. ** New struct slot allocation: "hidden"
  1443. A hidden slot is readable and writable, but will not be initialized by a
  1444. call to make-struct. For example in your layout you would say "ph"
  1445. instead of "pw". Hidden slots are useful for adding new slots to a
  1446. vtable without breaking existing invocations to make-struct.
  1447. ** eqv? not a generic
  1448. One used to be able to extend `eqv?' as a primitive-generic, but no
  1449. more. Because `eqv?' is in the expansion of `case' (via `memv'), which
  1450. should be able to compile to static dispatch tables, it doesn't make
  1451. sense to allow extensions that would subvert this optimization.
  1452. ** `inet-ntop' and `inet-pton' are always available.
  1453. Guile now use a portable implementation of `inet_pton'/`inet_ntop', so
  1454. there is no more need to use `inet-aton'/`inet-ntoa'. The latter
  1455. functions are deprecated.
  1456. ** `getopt-long' parsing errors throw to `quit', not `misc-error'
  1457. This change should inhibit backtraces on argument parsing errors.
  1458. `getopt-long' has been modified to print out the error that it throws
  1459. itself.
  1460. ** New primitive: `tmpfile'.
  1461. See "File System" in the manual.
  1462. ** Random generator state may be serialized to a datum
  1463. `random-state->datum' will serialize a random state to a datum, which
  1464. may be written out, read back in later, and revivified using
  1465. `datum->random-state'. See "Random" in the manual, for more details.
  1466. ** Fix random number generator on 64-bit platforms
  1467. There was a nasty bug on 64-bit platforms in which asking for a random
  1468. integer with a range between 2**32 and 2**64 caused a segfault. After
  1469. many embarrassing iterations, this was fixed.
  1470. ** Fast bit operations.
  1471. The bit-twiddling operations `ash', `logand', `logior', and `logxor' now
  1472. have dedicated bytecodes. Guile is not just for symbolic computation,
  1473. it's for number crunching too.
  1474. ** Faster SRFI-9 record access
  1475. SRFI-9 records are now implemented directly on top of Guile's structs,
  1476. and their accessors are defined in such a way that normal call-sites
  1477. inline to special VM opcodes, while still allowing for the general case
  1478. (e.g. passing a record accessor to `apply').
  1479. ** R6RS block comment support
  1480. Guile now supports R6RS nested block comments. The start of a comment is
  1481. marked with `#|', and the end with `|#'.
  1482. ** `guile-2' cond-expand feature
  1483. To test if your code is running under Guile 2.0 (or its alpha releases),
  1484. test for the `guile-2' cond-expand feature. Like this:
  1485. (cond-expand (guile-2 (eval-when (compile)
  1486. ;; This must be evaluated at compile time.
  1487. (fluid-set! current-reader my-reader)))
  1488. (guile
  1489. ;; Earlier versions of Guile do not have a
  1490. ;; separate compilation phase.
  1491. (fluid-set! current-reader my-reader)))
  1492. ** New global variables: %load-compiled-path, %load-compiled-extensions
  1493. These are analogous to %load-path and %load-extensions.
  1494. ** New fluid: `%file-port-name-canonicalization'
  1495. This fluid parameterizes the file names that are associated with file
  1496. ports. If %file-port-name-canonicalization is 'absolute, then file names
  1497. are canonicalized to be absolute paths. If it is 'relative, then the
  1498. name is canonicalized, but any prefix corresponding to a member of
  1499. `%load-path' is stripped off. Otherwise the names are passed through
  1500. unchanged.
  1501. In addition, the `compile-file' and `compile-and-load' procedures bind
  1502. %file-port-name-canonicalization to their `#:canonicalization' keyword
  1503. argument, which defaults to 'relative. In this way, one might compile
  1504. "../module/ice-9/boot-9.scm", but the path that gets residualized into
  1505. the .go is "ice-9/boot-9.scm".
  1506. ** New procedure, `make-promise'
  1507. `(make-promise (lambda () foo))' is equivalent to `(delay foo)'.
  1508. ** `defined?' may accept a module as its second argument
  1509. Previously it only accepted internal structures from the evaluator.
  1510. ** New entry into %guile-build-info: `ccachedir'
  1511. ** Fix bug in `module-bound?'.
  1512. `module-bound?' was returning true if a module did have a local
  1513. variable, but one that was unbound, but another imported module bound
  1514. the variable. This was an error, and was fixed.
  1515. ** `(ice-9 syncase)' has been deprecated.
  1516. As syntax-case is available by default, importing `(ice-9 syncase)' has
  1517. no effect, and will trigger a deprecation warning.
  1518. ** New readline history functions
  1519. The (ice-9 readline) module now provides add-history, read-history,
  1520. write-history and clear-history, which wrap the corresponding GNU
  1521. History library functions.
  1522. ** Removed deprecated uniform array procedures:
  1523. dimensions->uniform-array, list->uniform-array, array-prototype
  1524. Instead, use make-typed-array, list->typed-array, or array-type,
  1525. respectively.
  1526. ** Deprecate the old `scm-style-repl'
  1527. The following bindings from boot-9 are now found in `(ice-9
  1528. scm-style-repl)': `scm-style-repl', `error-catching-loop',
  1529. `error-catching-repl', `bad-throw', `scm-repl-silent'
  1530. `assert-repl-silence', `repl-print-unspecified',
  1531. `assert-repl-print-unspecified', `scm-repl-verbose',
  1532. `assert-repl-verbosity', `scm-repl-prompt', `set-repl-prompt!', `repl',
  1533. `default-pre-unwind-handler', `handle-system-error',
  1534. The following bindings have been deprecated, with no replacement:
  1535. `pre-unwind-handler-dispatch'.
  1536. The following bindings have been totally removed:
  1537. `before-signal-stack'.
  1538. Deprecated forwarding shims have been installed so that users that
  1539. expect these bindings in the main namespace will still work, but receive
  1540. a deprecation warning.
  1541. ** `set-batch-mode?!' replaced by `ensure-batch-mode!'
  1542. "Batch mode" is a flag used to tell a program that it is not running
  1543. interactively. One usually turns it on after a fork. It may not be
  1544. turned off. `ensure-batch-mode!' deprecates the old `set-batch-mode?!',
  1545. because it is a better interface, as it can only turn on batch mode, not
  1546. turn it off.
  1547. ** Deprecate `save-stack', `the-last-stack'
  1548. It used to be that the way to debug programs in Guile was to capture the
  1549. stack at the time of error, drop back to the REPL, then debug that
  1550. stack. But this approach didn't compose, was tricky to get right in the
  1551. presence of threads, and was not very powerful.
  1552. So `save-stack', `stack-saved?', and `the-last-stack' have been moved to
  1553. `(ice-9 save-stack)', with deprecated bindings left in the root module.
  1554. ** `top-repl' has its own module
  1555. The `top-repl' binding, called with Guile is run interactively, is now
  1556. is its own module, `(ice-9 top-repl)'. A deprecated forwarding shim was
  1557. left in the default environment.
  1558. ** `display-error' takes a frame
  1559. The `display-error' / `scm_display_error' helper now takes a frame as an
  1560. argument instead of a stack. Stacks are still supported in deprecated
  1561. builds. Additionally, `display-error' will again source location
  1562. information for the error.
  1563. ** No more `(ice-9 debug)'
  1564. This module had some debugging helpers that are no longer applicable to
  1565. the current debugging model. Importing this module will produce a
  1566. deprecation warning. Users should contact bug-guile for support.
  1567. ** Remove obsolete debug-options
  1568. Removed `breakpoints', `trace', `procnames', `indent', `frames',
  1569. `maxdepth', and `debug' debug-options.
  1570. ** `backtrace' debug option on by default
  1571. Given that Guile 2.0 can always give you a backtrace, backtraces are now
  1572. on by default.
  1573. ** `turn-on-debugging' deprecated
  1574. ** Remove obsolete print-options
  1575. The `source' and `closure-hook' print options are obsolete, and have
  1576. been removed.
  1577. ** Remove obsolete read-options
  1578. The "elisp-strings" and "elisp-vectors" read options were unused and
  1579. obsolete, so they have been removed.
  1580. ** Remove eval-options and trap-options
  1581. Eval-options and trap-options are obsolete with the new VM and
  1582. evaluator.
  1583. ** Remove (ice-9 debugger) and (ice-9 debugging)
  1584. See "Traps" and "Interactive Debugging" in the manual, for information
  1585. on their replacements.
  1586. ** Remove the GDS Emacs integration
  1587. See "Using Guile in Emacs" in the manual, for info on how we think you
  1588. should use Guile with Emacs.
  1589. ** Deprecated: `lazy-catch'
  1590. `lazy-catch' was a form that captured the stack at the point of a
  1591. `throw', but the dynamic state at the point of the `catch'. It was a bit
  1592. crazy. Please change to use `catch', possibly with a throw-handler, or
  1593. `with-throw-handler'.
  1594. ** Deprecated: primitive properties
  1595. The `primitive-make-property', `primitive-property-set!',
  1596. `primitive-property-ref', and `primitive-property-del!' procedures were
  1597. crufty and only used to implement object properties, which has a new,
  1598. threadsafe implementation. Use object properties or weak hash tables
  1599. instead.
  1600. ** Deprecated `@bind' syntax
  1601. `@bind' was part of an older implementation of the Emacs Lisp language,
  1602. and is no longer used.
  1603. ** Miscellaneous other deprecations
  1604. `cuserid' has been deprecated, as it only returns 8 bytes of a user's
  1605. login. Use `(passwd:name (getpwuid (geteuid)))' instead.
  1606. Additionally, the procedures `apply-to-args', `has-suffix?', `scheme-file-suffix'
  1607. `get-option', `for-next-option', `display-usage-report',
  1608. `transform-usage-lambda', `collect', and `set-batch-mode?!' have all
  1609. been deprecated.
  1610. ** Add support for unbound fluids
  1611. See `make-unbound-fluid', `fluid-unset!', and `fluid-bound?' in the
  1612. manual.
  1613. ** Add `variable-unset!'
  1614. See "Variables" in the manual, for more details.
  1615. ** Last but not least, the `λ' macro can be used in lieu of `lambda'
  1616. * Changes to the C interface
  1617. ** Guile now uses libgc, the Boehm-Demers-Weiser garbage collector
  1618. The semantics of `scm_gc_malloc ()' have been changed, in a
  1619. backward-compatible way. A new allocation routine,
  1620. `scm_gc_malloc_pointerless ()', was added.
  1621. Libgc is a conservative GC, which we hope will make interaction with C
  1622. code easier and less error-prone.
  1623. ** New procedures: `scm_to_stringn', `scm_from_stringn'
  1624. ** New procedures: scm_{to,from}_{utf8,latin1}_symbol{n,}
  1625. ** New procedures: scm_{to,from}_{utf8,utf32,latin1}_string{n,}
  1626. These new procedures convert to and from string representations in
  1627. particular encodings.
  1628. Users should continue to use locale encoding for user input, user
  1629. output, or interacting with the C library.
  1630. Use the Latin-1 functions for ASCII, and for literals in source code.
  1631. Use UTF-8 functions for interaction with modern libraries which deal in
  1632. UTF-8, and UTF-32 for interaction with utf32-using libraries.
  1633. Otherwise, use scm_to_stringn or scm_from_stringn with a specific
  1634. encoding.
  1635. ** New type definitions for `scm_t_intptr' and friends.
  1636. `SCM_T_UINTPTR_MAX', `SCM_T_INTPTR_MIN', `SCM_T_INTPTR_MAX',
  1637. `SIZEOF_SCM_T_BITS', `scm_t_intptr' and `scm_t_uintptr' are now
  1638. available to C. Have fun!
  1639. ** The GH interface (deprecated in version 1.6, 2001) was removed.
  1640. ** Internal `scm_i_' functions now have "hidden" linkage with GCC/ELF
  1641. This makes these internal functions technically not callable from
  1642. application code.
  1643. ** Functions for handling `scm_option' now no longer require an argument
  1644. indicating length of the `scm_t_option' array.
  1645. ** Procedures-with-setters are now implemented using applicable structs
  1646. From a user's perspective this doesn't mean very much. But if, for some
  1647. odd reason, you used the SCM_PROCEDURE_WITH_SETTER_P, SCM_PROCEDURE, or
  1648. SCM_SETTER macros, know that they're deprecated now. Also, scm_tc7_pws
  1649. is gone.
  1650. ** Remove old evaluator closures
  1651. There used to be ranges of typecodes allocated to interpreted data
  1652. structures, but that it no longer the case, given that interpreted
  1653. procedure are now just regular VM closures. As a result, there is a
  1654. newly free tc3, and a number of removed macros. See the ChangeLog for
  1655. details.
  1656. ** Primitive procedures are now VM trampoline procedures
  1657. It used to be that there were something like 12 different typecodes
  1658. allocated to primitive procedures, each with its own calling convention.
  1659. Now there is only one, the gsubr. This may affect user code if you were
  1660. defining a procedure using scm_c_make_subr rather scm_c_make_gsubr. The
  1661. solution is to switch to use scm_c_make_gsubr. This solution works well
  1662. both with the old 1.8 and with the current 1.9 branch.
  1663. Guile's old evaluator used to have special cases for applying "gsubrs",
  1664. primitive procedures with specified numbers of required, optional, and
  1665. rest arguments. Now, however, Guile represents gsubrs as normal VM
  1666. procedures, with appropriate bytecode to parse out the correct number of
  1667. arguments, including optional and rest arguments, and then with a
  1668. special bytecode to apply the gsubr.
  1669. This allows primitive procedures to appear on the VM stack, allowing
  1670. them to be accurately counted in profiles. Also they now have more
  1671. debugging information attached to them -- their number of arguments, for
  1672. example. In addition, the VM can completely inline the application
  1673. mechanics, allowing for faster primitive calls.
  1674. However there are some changes on the C level. There is no more
  1675. `scm_tc7_gsubr' or `scm_tcs_subrs' typecode for primitive procedures, as
  1676. they are just VM procedures. Likewise the macros `SCM_GSUBR_TYPE',
  1677. `SCM_GSUBR_MAKTYPE', `SCM_GSUBR_REQ', `SCM_GSUBR_OPT', and
  1678. `SCM_GSUBR_REST' are gone, as are `SCM_SUBR_META_INFO', `SCM_SUBR_PROPS'
  1679. `SCM_SET_SUBR_GENERIC_LOC', and `SCM_SUBR_ARITY_TO_TYPE'.
  1680. Perhaps more significantly, `scm_c_make_subr',
  1681. `scm_c_make_subr_with_generic', `scm_c_define_subr', and
  1682. `scm_c_define_subr_with_generic'. They all operated on subr typecodes,
  1683. and there are no more subr typecodes. Use the scm_c_make_gsubr family
  1684. instead.
  1685. Normal users of gsubrs should not be affected, though, as the
  1686. scm_c_make_gsubr family still is the correct way to create primitive
  1687. procedures.
  1688. ** Remove deprecated array C interfaces
  1689. Removed the deprecated array functions `scm_i_arrayp',
  1690. `scm_i_array_ndim', `scm_i_array_mem', `scm_i_array_v',
  1691. `scm_i_array_base', `scm_i_array_dims', and the deprecated macros
  1692. `SCM_ARRAYP', `SCM_ARRAY_NDIM', `SCM_ARRAY_CONTP', `SCM_ARRAY_MEM',
  1693. `SCM_ARRAY_V', `SCM_ARRAY_BASE', and `SCM_ARRAY_DIMS'.
  1694. ** Remove unused snarf macros
  1695. `SCM_DEFINE1', `SCM_PRIMITIVE_GENERIC_1', `SCM_PROC1, and `SCM_GPROC1'
  1696. are no more. Use SCM_DEFINE or SCM_PRIMITIVE_GENERIC instead.
  1697. ** New functions: `scm_call_n', `scm_c_run_hookn'
  1698. `scm_call_n' applies to apply a function to an array of arguments.
  1699. `scm_c_run_hookn' runs a hook with an array of arguments.
  1700. ** Some SMOB types changed to have static typecodes
  1701. Fluids, dynamic states, and hash tables used to be SMOB objects, but now
  1702. they have statically allocated tc7 typecodes.
  1703. ** Preparations for changing SMOB representation
  1704. If things go right, we'll be changing the SMOB representation soon. To
  1705. that end, we did a lot of cleanups to calls to e.g. SCM_CELL_WORD_2(x) when
  1706. the code meant SCM_SMOB_DATA_2(x); user code will need similar changes
  1707. in the future. Code accessing SMOBs using SCM_CELL macros was never
  1708. correct, but until now things still worked. Users should be aware of
  1709. such changes.
  1710. ** Changed invocation mechanics of applicable SMOBs
  1711. Guile's old evaluator used to have special cases for applying SMOB
  1712. objects. Now, with the VM, when Guile sees a SMOB, it looks up a VM
  1713. trampoline procedure for it, and use the normal mechanics to apply the
  1714. trampoline. This simplifies procedure application in the normal,
  1715. non-SMOB case.
  1716. The upshot is that the mechanics used to apply a SMOB are different from
  1717. 1.8. Descriptors no longer have `apply_0', `apply_1', `apply_2', and
  1718. `apply_3' functions, and the macros SCM_SMOB_APPLY_0 and friends are now
  1719. deprecated. Just use the scm_call_0 family of procedures.
  1720. ** Removed support shlibs for SRFIs 1, 4, 13, 14, and 60
  1721. Though these SRFI support libraries did expose API, they encoded a
  1722. strange version string into their library names. That version was never
  1723. programmatically exported, so there was no way people could use the
  1724. libs.
  1725. This was a fortunate oversight, as it allows us to remove the need for
  1726. extra, needless shared libraries --- the C support code for SRFIs 4, 13,
  1727. and 14 was already in core --- and allow us to incrementally return the
  1728. SRFI implementation to Scheme.
  1729. ** New C function: scm_module_public_interface
  1730. This procedure corresponds to Scheme's `module-public-interface'.
  1731. ** Undeprecate `scm_the_root_module ()'
  1732. It's useful to be able to get the root module from C without doing a
  1733. full module lookup.
  1734. ** Inline vector allocation
  1735. Instead of having vectors point out into the heap for their data, their
  1736. data is now allocated inline to the vector object itself. The same is
  1737. true for bytevectors, by default, though there is an indirection
  1738. available which should allow for making a bytevector from an existing
  1739. memory region.
  1740. ** New struct constructors that don't involve making lists
  1741. `scm_c_make_struct' and `scm_c_make_structv' are new varargs and array
  1742. constructors, respectively, for structs. You might find them useful.
  1743. ** Stack refactor
  1744. In Guile 1.8, there were debugging frames on the C stack. Now there is
  1745. no more need to explicitly mark the stack in this way, because Guile has
  1746. a VM stack that it knows how to walk, which simplifies the C API
  1747. considerably. See the ChangeLog for details; the relevant interface is
  1748. in libguile/stacks.h. The Scheme API has not been changed significantly.
  1749. ** Removal of Guile's primitive object system.
  1750. There were a number of pieces in `objects.[ch]' that tried to be a
  1751. minimal object system, but were never documented, and were quickly
  1752. obseleted by GOOPS' merge into Guile proper. So `scm_make_class_object',
  1753. `scm_make_subclass_object', `scm_metaclass_standard', and like symbols
  1754. from objects.h are no more. In the very unlikely case in which these
  1755. were useful to you, we urge you to contact guile-devel.
  1756. ** No future.
  1757. Actually the future is still in the state that it was, is, and ever
  1758. shall be, Amen, except that `futures.c' and `futures.h' are no longer a
  1759. part of it. These files were experimental, never compiled, and would be
  1760. better implemented in Scheme anyway. In the future, that is.
  1761. ** Deprecate trampolines
  1762. There used to be C functions `scm_trampoline_0', `scm_trampoline_1', and
  1763. so on. The point was to do some precomputation on the type of the
  1764. procedure, then return a specialized "call" procedure. However this
  1765. optimization wasn't actually an optimization, so it is now deprecated.
  1766. Just use `scm_call_0', etc instead.
  1767. ** Deprecated `scm_badargsp'
  1768. This function is unused in Guile, but was part of its API.
  1769. ** Better support for Lisp `nil'.
  1770. The bit representation of `nil' has been tweaked so that it is now very
  1771. efficient to check e.g. if a value is equal to Scheme's end-of-list or
  1772. Lisp's nil. Additionally there are a heap of new, specific predicates
  1773. like scm_is_null_or_nil.
  1774. ** Better integration of Lisp `nil'.
  1775. `scm_is_boolean', `scm_is_false', and `scm_is_null' all return true now
  1776. for Lisp's `nil'. This shouldn't affect any Scheme code at this point,
  1777. but when we start to integrate more with Emacs, it is possible that we
  1778. break code that assumes that, for example, `(not x)' implies that `x' is
  1779. `eq?' to `#f'. This is not a common assumption. Refactoring affected
  1780. code to rely on properties instead of identities will improve code
  1781. correctness. See "Nil" in the manual, for more details.
  1782. ** Support for static allocation of strings, symbols, and subrs.
  1783. Calls to snarfing CPP macros like SCM_DEFINE macro will now allocate
  1784. much of their associated data as static variables, reducing Guile's
  1785. memory footprint.
  1786. ** `scm_stat' has an additional argument, `exception_on_error'
  1787. ** `scm_primitive_load_path' has an additional argument `exception_on_not_found'
  1788. ** `scm_set_port_seek' and `scm_set_port_truncate' use the `scm_t_off' type
  1789. Previously they would use the `off_t' type, which is fragile since its
  1790. definition depends on the application's value for `_FILE_OFFSET_BITS'.
  1791. ** The `long_long' C type, deprecated in 1.8, has been removed
  1792. ** Removed deprecated uniform array procedures: scm_make_uve,
  1793. scm_array_prototype, scm_list_to_uniform_array,
  1794. scm_dimensions_to_uniform_array, scm_make_ra, scm_shap2ra, scm_cvref,
  1795. scm_ra_set_contp, scm_aind, scm_raprin1
  1796. These functions have been deprecated since early 2005.
  1797. * Changes to the distribution
  1798. ** Guile's license is now LGPLv3+
  1799. In other words the GNU Lesser General Public License, version 3 or
  1800. later (at the discretion of each person that chooses to redistribute
  1801. part of Guile).
  1802. ** AM_SILENT_RULES
  1803. Guile's build is visually quieter, due to the use of Automake 1.11's
  1804. AM_SILENT_RULES. Build as `make V=1' to see all of the output.
  1805. ** GOOPS documentation folded into Guile reference manual
  1806. GOOPS, Guile's object system, used to be documented in separate manuals.
  1807. This content is now included in Guile's manual directly.
  1808. ** `guile-config' will be deprecated in favor of `pkg-config'
  1809. `guile-config' has been rewritten to get its information from
  1810. `pkg-config', so this should be a transparent change. Note however that
  1811. guile.m4 has yet to be modified to call pkg-config instead of
  1812. guile-config.
  1813. ** Guile now provides `guile-2.0.pc' instead of `guile-1.8.pc'
  1814. Programs that use `pkg-config' to find Guile or one of its Autoconf
  1815. macros should now require `guile-2.0' instead of `guile-1.8'.
  1816. ** New installation directory: $(pkglibdir)/1.9/ccache
  1817. If $(libdir) is /usr/lib, for example, Guile will install its .go files
  1818. to /usr/lib/guile/1.9/ccache. These files are architecture-specific.
  1819. ** Parallel installability fixes
  1820. Guile now installs its header files to a effective-version-specific
  1821. directory, and includes the effective version (e.g. 2.0) in the library
  1822. name (e.g. libguile-2.0.so).
  1823. This change should be transparent to users, who should detect Guile via
  1824. the guile.m4 macro, or the guile-2.0.pc pkg-config file. It will allow
  1825. parallel installs for multiple versions of Guile development
  1826. environments.
  1827. ** Dynamically loadable extensions may be placed in a Guile-specific path
  1828. Before, Guile only searched the system library paths for extensions
  1829. (e.g. /usr/lib), which meant that the names of Guile extensions had to
  1830. be globally unique. Installing them to a Guile-specific extensions
  1831. directory is cleaner. Use `pkg-config --variable=extensiondir
  1832. guile-2.0' to get the location of the extensions directory.
  1833. ** User Scheme code may be placed in a version-specific path
  1834. Before, there was only one way to install user Scheme code to a
  1835. version-specific Guile directory: install to Guile's own path,
  1836. e.g. /usr/share/guile/2.0. The site directory,
  1837. e.g. /usr/share/guile/site, was unversioned. This has been changed to
  1838. add a version-specific site directory, e.g. /usr/share/guile/site/2.0,
  1839. searched before the global site directory.
  1840. ** New dependency: libgc
  1841. See http://www.hpl.hp.com/personal/Hans_Boehm/gc/, for more information.
  1842. ** New dependency: GNU libunistring
  1843. See http://www.gnu.org/software/libunistring/, for more information. Our
  1844. Unicode support uses routines from libunistring.
  1845. ** New dependency: libffi
  1846. See http://sourceware.org/libffi/, for more information.
  1847. Changes in 1.8.8 (since 1.8.7)
  1848. * Bugs fixed
  1849. ** Fix possible buffer overruns when parsing numbers
  1850. ** Avoid clash with system setjmp/longjmp on IA64
  1851. ** Fix `wrong type arg' exceptions with IPv6 addresses
  1852. Changes in 1.8.7 (since 1.8.6)
  1853. * New modules (see the manual for details)
  1854. ** `(srfi srfi-98)', an interface to access environment variables
  1855. * Bugs fixed
  1856. ** Fix compilation with `--disable-deprecated'
  1857. ** Fix %fast-slot-ref/set!, to avoid possible segmentation fault
  1858. ** Fix MinGW build problem caused by HAVE_STRUCT_TIMESPEC confusion
  1859. ** Fix build problem when scm_t_timespec is different from struct timespec
  1860. ** Fix build when compiled with -Wundef -Werror
  1861. ** More build fixes for `alphaev56-dec-osf5.1b' (Tru64)
  1862. ** Build fixes for `powerpc-ibm-aix5.3.0.0' (AIX 5.3)
  1863. ** With GCC, always compile with `-mieee' on `alpha*' and `sh*'
  1864. ** Better diagnose broken `(strftime "%z" ...)' in `time.test' (bug #24130)
  1865. ** Fix parsing of SRFI-88/postfix keywords longer than 128 characters
  1866. ** Fix reading of complex numbers where both parts are inexact decimals
  1867. ** Allow @ macro to work with (ice-9 syncase)
  1868. Previously, use of the @ macro in a module whose code is being
  1869. transformed by (ice-9 syncase) would cause an "Invalid syntax" error.
  1870. Now it works as you would expect (giving the value of the specified
  1871. module binding).
  1872. ** Have `scm_take_locale_symbol ()' return an interned symbol (bug #25865)
  1873. Changes in 1.8.6 (since 1.8.5)
  1874. * New features (see the manual for details)
  1875. ** New convenience function `scm_c_symbol_length ()'
  1876. ** Single stepping through code from Emacs
  1877. When you use GDS to evaluate Scheme code from Emacs, you can now use
  1878. `C-u' to indicate that you want to single step through that code. See
  1879. `Evaluating Scheme Code' in the manual for more details.
  1880. ** New "guile(1)" man page!
  1881. * Changes to the distribution
  1882. ** Automake's `AM_MAINTAINER_MODE' is no longer used
  1883. Thus, the `--enable-maintainer-mode' configure option is no longer
  1884. available: Guile is now always configured in "maintainer mode".
  1885. ** `ChangeLog' files are no longer updated
  1886. Instead, changes are detailed in the version control system's logs. See
  1887. the top-level `ChangeLog' files for details.
  1888. * Bugs fixed
  1889. ** `symbol->string' now returns a read-only string, as per R5RS
  1890. ** Fix incorrect handling of the FLAGS argument of `fold-matches'
  1891. ** `guile-config link' now prints `-L$libdir' before `-lguile'
  1892. ** Fix memory corruption involving GOOPS' `class-redefinition'
  1893. ** Fix possible deadlock in `mutex-lock'
  1894. ** Fix build issue on Tru64 and ia64-hp-hpux11.23 (`SCM_UNPACK' macro)
  1895. ** Fix build issue on mips, mipsel, powerpc and ia64 (stack direction)
  1896. ** Fix build issue on hppa2.0w-hp-hpux11.11 (`dirent64' and `readdir64_r')
  1897. ** Fix build issue on i386-unknown-freebsd7.0 ("break strict-aliasing rules")
  1898. ** Fix misleading output from `(help rationalize)'
  1899. ** Fix build failure on Debian hppa architecture (bad stack growth detection)
  1900. ** Fix `gcd' when called with a single, negative argument.
  1901. ** Fix `Stack overflow' errors seen when building on some platforms
  1902. ** Fix bug when `scm_with_guile ()' was called several times from the
  1903. same thread
  1904. ** The handler of SRFI-34 `with-exception-handler' is now invoked in the
  1905. dynamic environment of the call to `raise'
  1906. ** Fix potential deadlock in `make-struct'
  1907. ** Fix compilation problem with libltdl from Libtool 2.2.x
  1908. ** Fix sloppy bound checking in `string-{ref,set!}' with the empty string
  1909. Changes in 1.8.5 (since 1.8.4)
  1910. * Infrastructure changes
  1911. ** Guile repository switched from CVS to Git
  1912. The new repository can be accessed using
  1913. "git-clone git://git.sv.gnu.org/guile.git", or can be browsed on-line at
  1914. http://git.sv.gnu.org/gitweb/?p=guile.git . See `README' for details.
  1915. ** Add support for `pkg-config'
  1916. See "Autoconf Support" in the manual for details.
  1917. * New modules (see the manual for details)
  1918. ** `(srfi srfi-88)'
  1919. * New features (see the manual for details)
  1920. ** New `postfix' read option, for SRFI-88 keyword syntax
  1921. ** Some I/O primitives have been inlined, which improves I/O performance
  1922. ** New object-based traps infrastructure
  1923. This is a GOOPS-based infrastructure that builds on Guile's low-level
  1924. evaluator trap calls and facilitates the development of debugging
  1925. features like single-stepping, breakpoints, tracing and profiling.
  1926. See the `Traps' node of the manual for details.
  1927. ** New support for working on Guile code from within Emacs
  1928. Guile now incorporates the `GDS' library (previously distributed
  1929. separately) for working on Guile code from within Emacs. See the
  1930. `Using Guile In Emacs' node of the manual for details.
  1931. * Bugs fixed
  1932. ** `scm_add_slot ()' no longer segfaults (fixes bug #22369)
  1933. ** Fixed `(ice-9 match)' for patterns like `((_ ...) ...)'
  1934. Previously, expressions like `(match '((foo) (bar)) (((_ ...) ...) #t))'
  1935. would trigger an unbound variable error for `match:andmap'.
  1936. ** `(oop goops describe)' now properly provides the `describe' feature
  1937. ** Fixed `args-fold' from `(srfi srfi-37)'
  1938. Previously, parsing short option names of argument-less options would
  1939. lead to a stack overflow.
  1940. ** `(srfi srfi-35)' is now visible through `cond-expand'
  1941. ** Fixed type-checking for the second argument of `eval'
  1942. ** Fixed type-checking for SRFI-1 `partition'
  1943. ** Fixed `struct-ref' and `struct-set!' on "light structs"
  1944. ** Honor struct field access rights in GOOPS
  1945. ** Changed the storage strategy of source properties, which fixes a deadlock
  1946. ** Allow compilation of Guile-using programs in C99 mode with GCC 4.3 and later
  1947. ** Fixed build issue for GNU/Linux on IA64
  1948. ** Fixed build issues on NetBSD 1.6
  1949. ** Fixed build issue on Solaris 2.10 x86_64
  1950. ** Fixed build issue with DEC/Compaq/HP's compiler
  1951. ** Fixed `scm_from_complex_double' build issue on FreeBSD
  1952. ** Fixed `alloca' build issue on FreeBSD 6
  1953. ** Removed use of non-portable makefile constructs
  1954. ** Fixed shadowing of libc's <random.h> on Tru64, which broke compilation
  1955. ** Make sure all tests honor `$TMPDIR'
  1956. Changes in 1.8.4 (since 1.8.3)
  1957. * Bugs fixed
  1958. ** CR (ASCII 0x0d) is (again) recognized as a token delimiter by the reader
  1959. ** Fixed a segmentation fault which occurred when displaying the
  1960. backtrace of a stack with a promise object (made by `delay') in it.
  1961. ** Make `accept' leave guile mode while blocking
  1962. ** `scm_c_read ()' and `scm_c_write ()' now type-check their port argument
  1963. ** Fixed a build problem on AIX (use of func_data identifier)
  1964. ** Fixed a segmentation fault which occurred when hashx-ref or hashx-set! was
  1965. called with an associator proc that returns neither a pair nor #f.
  1966. ** Secondary threads now always return a valid module for (current-module).
  1967. ** Avoid MacOS build problems caused by incorrect combination of "64"
  1968. system and library calls.
  1969. ** `guile-snarf' now honors `$TMPDIR'
  1970. ** `guile-config compile' now reports CPPFLAGS used at compile-time
  1971. ** Fixed build with Sun Studio (Solaris 9)
  1972. ** Fixed wrong-type-arg errors when creating zero length SRFI-4
  1973. uniform vectors on AIX.
  1974. ** Fixed a deadlock that occurs upon GC with multiple threads.
  1975. ** Fixed compile problem with GCC on Solaris and AIX (use of _Complex_I)
  1976. ** Fixed autotool-derived build problems on AIX 6.1.
  1977. ** Fixed NetBSD/alpha support
  1978. ** Fixed MacOS build problem caused by use of rl_get_keymap(_name)
  1979. * New modules (see the manual for details)
  1980. ** `(srfi srfi-69)'
  1981. * Documentation fixes and improvements
  1982. ** Removed premature breakpoint documentation
  1983. The features described are not available in the series of 1.8.x
  1984. releases, so the documentation was misleading and has been removed.
  1985. ** More about Guile's default *random-state* variable
  1986. ** GOOPS: more about how to use `next-method'
  1987. * Changes to the distribution
  1988. ** Corrected a few files that referred incorrectly to the old GPL + special exception licence
  1989. In fact Guile since 1.8.0 has been licensed with the GNU Lesser
  1990. General Public License, and the few incorrect files have now been
  1991. fixed to agree with the rest of the Guile distribution.
  1992. ** Removed unnecessary extra copies of COPYING*
  1993. The distribution now contains a single COPYING.LESSER at its top level.
  1994. Changes in 1.8.3 (since 1.8.2)
  1995. * New modules (see the manual for details)
  1996. ** `(srfi srfi-35)'
  1997. ** `(srfi srfi-37)'
  1998. * Bugs fixed
  1999. ** The `(ice-9 slib)' module now works as expected
  2000. ** Expressions like "(set! 'x #t)" no longer yield a crash
  2001. ** Warnings about duplicate bindings now go to stderr
  2002. ** A memory leak in `make-socket-address' was fixed
  2003. ** Alignment issues (e.g., on SPARC) in network routines were fixed
  2004. ** A threading issue that showed up at least on NetBSD was fixed
  2005. ** Build problems on Solaris and IRIX fixed
  2006. * Implementation improvements
  2007. ** The reader is now faster, which reduces startup time
  2008. ** Procedures returned by `record-accessor' and `record-modifier' are faster
  2009. Changes in 1.8.2 (since 1.8.1):
  2010. * New procedures (see the manual for details)
  2011. ** set-program-arguments
  2012. ** make-vtable
  2013. * Incompatible changes
  2014. ** The body of a top-level `define' no longer sees the binding being created
  2015. In a top-level `define', the binding being created is no longer visible
  2016. from the `define' body. This breaks code like
  2017. "(define foo (begin (set! foo 1) (+ foo 1)))", where `foo' is now
  2018. unbound in the body. However, such code was not R5RS-compliant anyway,
  2019. per Section 5.2.1.
  2020. * Bugs fixed
  2021. ** Fractions were not `equal?' if stored in unreduced form.
  2022. (A subtle problem, since printing a value reduced it, making it work.)
  2023. ** srfi-60 `copy-bit' failed on 64-bit systems
  2024. ** "guile --use-srfi" option at the REPL can replace core functions
  2025. (Programs run with that option were ok, but in the interactive REPL
  2026. the core bindings got priority, preventing SRFI replacements or
  2027. extensions.)
  2028. ** `regexp-exec' doesn't abort() on #\nul in the input or bad flags arg
  2029. ** `kill' on mingw throws an error for a PID other than oneself
  2030. ** Procedure names are attached to procedure-with-setters
  2031. ** Array read syntax works with negative lower bound
  2032. ** `array-in-bounds?' fix if an array has different lower bounds on each index
  2033. ** `*' returns exact 0 for "(* inexact 0)"
  2034. This follows what it always did for "(* 0 inexact)".
  2035. ** SRFI-19: Value returned by `(current-time time-process)' was incorrect
  2036. ** SRFI-19: `date->julian-day' did not account for timezone offset
  2037. ** `ttyname' no longer crashes when passed a non-tty argument
  2038. ** `inet-ntop' no longer crashes on SPARC when passed an `AF_INET' address
  2039. ** Small memory leaks have been fixed in `make-fluid' and `add-history'
  2040. ** GOOPS: Fixed a bug in `method-more-specific?'
  2041. ** Build problems on Solaris fixed
  2042. ** Build problems on HP-UX IA64 fixed
  2043. ** Build problems on MinGW fixed
  2044. Changes in 1.8.1 (since 1.8.0):
  2045. * LFS functions are now used to access 64-bit files on 32-bit systems.
  2046. * New procedures (see the manual for details)
  2047. ** primitive-_exit - [Scheme] the-root-module
  2048. ** scm_primitive__exit - [C]
  2049. ** make-completion-function - [Scheme] (ice-9 readline)
  2050. ** scm_c_locale_stringn_to_number - [C]
  2051. ** scm_srfi1_append_reverse [C]
  2052. ** scm_srfi1_append_reverse_x [C]
  2053. ** scm_log - [C]
  2054. ** scm_log10 - [C]
  2055. ** scm_exp - [C]
  2056. ** scm_sqrt - [C]
  2057. * Bugs fixed
  2058. ** Build problems have been fixed on MacOS, SunOS, and QNX.
  2059. ** `strftime' fix sign of %z timezone offset.
  2060. ** A one-dimensional array can now be 'equal?' to a vector.
  2061. ** Structures, records, and SRFI-9 records can now be compared with `equal?'.
  2062. ** SRFI-14 standard char sets are recomputed upon a successful `setlocale'.
  2063. ** `record-accessor' and `record-modifier' now have strict type checks.
  2064. Record accessor and modifier procedures now throw an error if the
  2065. record type of the record they're given is not the type expected.
  2066. (Previously accessors returned #f and modifiers silently did nothing).
  2067. ** It is now OK to use both autoload and use-modules on a given module.
  2068. ** `apply' checks the number of arguments more carefully on "0 or 1" funcs.
  2069. Previously there was no checking on primatives like make-vector that
  2070. accept "one or two" arguments. Now there is.
  2071. ** The srfi-1 assoc function now calls its equality predicate properly.
  2072. Previously srfi-1 assoc would call the equality predicate with the key
  2073. last. According to the SRFI, the key should be first.
  2074. ** A bug in n-par-for-each and n-for-each-par-map has been fixed.
  2075. ** The array-set! procedure no longer segfaults when given a bit vector.
  2076. ** Bugs in make-shared-array have been fixed.
  2077. ** string<? and friends now follow char<? etc order on 8-bit chars.
  2078. ** The format procedure now handles inf and nan values for ~f correctly.
  2079. ** exact->inexact should no longer overflow when given certain large fractions.
  2080. ** srfi-9 accessor and modifier procedures now have strict record type checks.
  2081. This matches the srfi-9 specification.
  2082. ** (ice-9 ftw) procedures won't ignore different files with same inode number.
  2083. Previously the (ice-9 ftw) procedures would ignore any file that had
  2084. the same inode number as a file they had already seen, even if that
  2085. file was on a different device.
  2086. Changes in 1.8.0 (changes since the 1.6.x series):
  2087. * Changes to the distribution
  2088. ** Guile is now licensed with the GNU Lesser General Public License.
  2089. ** The manual is now licensed with the GNU Free Documentation License.
  2090. ** Guile now requires GNU MP (http://swox.com/gmp).
  2091. Guile now uses the GNU MP library for arbitrary precision arithmetic.
  2092. ** Guile now has separate private and public configuration headers.
  2093. That is, things like HAVE_STRING_H no longer leak from Guile's
  2094. headers.
  2095. ** Guile now provides and uses an "effective" version number.
  2096. Guile now provides scm_effective_version and effective-version
  2097. functions which return the "effective" version number. This is just
  2098. the normal full version string without the final micro-version number,
  2099. so the current effective-version is "1.8". The effective version
  2100. should remain unchanged during a stable series, and should be used for
  2101. items like the versioned share directory name
  2102. i.e. /usr/share/guile/1.8.
  2103. Providing an unchanging version number during a stable release for
  2104. things like the versioned share directory can be particularly
  2105. important for Guile "add-on" packages, since it provides a directory
  2106. that they can install to that won't be changed out from under them
  2107. with each micro release during a stable series.
  2108. ** Thread implementation has changed.
  2109. When you configure "--with-threads=null", you will get the usual
  2110. threading API (call-with-new-thread, make-mutex, etc), but you can't
  2111. actually create new threads. Also, "--with-threads=no" is now
  2112. equivalent to "--with-threads=null". This means that the thread API
  2113. is always present, although you might not be able to create new
  2114. threads.
  2115. When you configure "--with-threads=pthreads" or "--with-threads=yes",
  2116. you will get threads that are implemented with the portable POSIX
  2117. threads. These threads can run concurrently (unlike the previous
  2118. "coop" thread implementation), but need to cooperate for things like
  2119. the GC.
  2120. The default is "pthreads", unless your platform doesn't have pthreads,
  2121. in which case "null" threads are used.
  2122. See the manual for details, nodes "Initialization", "Multi-Threading",
  2123. "Blocking", and others.
  2124. ** There is the new notion of 'discouraged' features.
  2125. This is a milder form of deprecation.
  2126. Things that are discouraged should not be used in new code, but it is
  2127. OK to leave them in old code for now. When a discouraged feature is
  2128. used, no warning message is printed like there is for 'deprecated'
  2129. features. Also, things that are merely discouraged are nevertheless
  2130. implemented efficiently, while deprecated features can be very slow.
  2131. You can omit discouraged features from libguile by configuring it with
  2132. the '--disable-discouraged' option.
  2133. ** Deprecation warnings can be controlled at run-time.
  2134. (debug-enable 'warn-deprecated) switches them on and (debug-disable
  2135. 'warn-deprecated) switches them off.
  2136. ** Support for SRFI 61, extended cond syntax for multiple values has
  2137. been added.
  2138. This SRFI is always available.
  2139. ** Support for require-extension, SRFI-55, has been added.
  2140. The SRFI-55 special form `require-extension' has been added. It is
  2141. available at startup, and provides a portable way to load Scheme
  2142. extensions. SRFI-55 only requires support for one type of extension,
  2143. "srfi"; so a set of SRFIs may be loaded via (require-extension (srfi 1
  2144. 13 14)).
  2145. ** New module (srfi srfi-26) provides support for `cut' and `cute'.
  2146. The (srfi srfi-26) module is an implementation of SRFI-26 which
  2147. provides the `cut' and `cute' syntax. These may be used to specialize
  2148. parameters without currying.
  2149. ** New module (srfi srfi-31)
  2150. This is an implementation of SRFI-31 which provides a special form
  2151. `rec' for recursive evaluation.
  2152. ** The modules (srfi srfi-13), (srfi srfi-14) and (srfi srfi-4) have
  2153. been merged with the core, making their functionality always
  2154. available.
  2155. The modules are still available, tho, and you could use them together
  2156. with a renaming import, for example.
  2157. ** Guile no longer includes its own version of libltdl.
  2158. The official version is good enough now.
  2159. ** The --enable-htmldoc option has been removed from 'configure'.
  2160. Support for translating the documentation into HTML is now always
  2161. provided. Use 'make html'.
  2162. ** New module (ice-9 serialize):
  2163. (serialize FORM1 ...) and (parallelize FORM1 ...) are useful when you
  2164. don't trust the thread safety of most of your program, but where you
  2165. have some section(s) of code which you consider can run in parallel to
  2166. other sections. See ice-9/serialize.scm for more information.
  2167. ** The configure option '--disable-arrays' has been removed.
  2168. Support for arrays and uniform numeric arrays is now always included
  2169. in Guile.
  2170. * Changes to the stand-alone interpreter
  2171. ** New command line option `-L'.
  2172. This option adds a directory to the front of the load path.
  2173. ** New command line option `--no-debug'.
  2174. Specifying `--no-debug' on the command line will keep the debugging
  2175. evaluator turned off, even for interactive sessions.
  2176. ** User-init file ~/.guile is now loaded with the debugging evaluator.
  2177. Previously, the normal evaluator would have been used. Using the
  2178. debugging evaluator gives better error messages.
  2179. ** The '-e' option now 'read's its argument.
  2180. This is to allow the new '(@ MODULE-NAME VARIABLE-NAME)' construct to
  2181. be used with '-e'. For example, you can now write a script like
  2182. #! /bin/sh
  2183. exec guile -e '(@ (demo) main)' -s "$0" "$@"
  2184. !#
  2185. (define-module (demo)
  2186. :export (main))
  2187. (define (main args)
  2188. (format #t "Demo: ~a~%" args))
  2189. * Changes to Scheme functions and syntax
  2190. ** Guardians have changed back to their original semantics
  2191. Guardians now behave like described in the paper by Dybvig et al. In
  2192. particular, they no longer make guarantees about the order in which
  2193. they return objects, and they can no longer be greedy.
  2194. They no longer drop cyclic data structures.
  2195. The C function scm_make_guardian has been changed incompatibly and no
  2196. longer takes the 'greedy_p' argument.
  2197. ** New function hashx-remove!
  2198. This function completes the set of 'hashx' functions.
  2199. ** The concept of dynamic roots has been factored into continuation
  2200. barriers and dynamic states.
  2201. Each thread has a current dynamic state that carries the values of the
  2202. fluids. You can create and copy dynamic states and use them as the
  2203. second argument for 'eval'. See "Fluids and Dynamic States" in the
  2204. manual.
  2205. To restrict the influence that captured continuations can have on the
  2206. control flow, you can errect continuation barriers. See "Continuation
  2207. Barriers" in the manual.
  2208. The function call-with-dynamic-root now essentially temporarily
  2209. installs a new dynamic state and errects a continuation barrier.
  2210. ** The default load path no longer includes "." at the end.
  2211. Automatically loading modules from the current directory should not
  2212. happen by default. If you want to allow it in a more controlled
  2213. manner, set the environment variable GUILE_LOAD_PATH or the Scheme
  2214. variable %load-path.
  2215. ** The uniform vector and array support has been overhauled.
  2216. It now complies with SRFI-4 and the weird prototype based uniform
  2217. array creation has been deprecated. See the manual for more details.
  2218. Some non-compatible changes have been made:
  2219. - characters can no longer be stored into byte arrays.
  2220. - strings and bit vectors are no longer considered to be uniform numeric
  2221. vectors.
  2222. - array-rank throws an error for non-arrays instead of returning zero.
  2223. - array-ref does no longer accept non-arrays when no indices are given.
  2224. There is the new notion of 'generalized vectors' and corresponding
  2225. procedures like 'generalized-vector-ref'. Generalized vectors include
  2226. strings, bitvectors, ordinary vectors, and uniform numeric vectors.
  2227. Arrays use generalized vectors as their storage, so that you still
  2228. have arrays of characters, bits, etc. However, uniform-array-read!
  2229. and uniform-array-write can no longer read/write strings and
  2230. bitvectors.
  2231. ** There is now support for copy-on-write substrings, mutation-sharing
  2232. substrings and read-only strings.
  2233. Three new procedures are related to this: substring/shared,
  2234. substring/copy, and substring/read-only. See the manual for more
  2235. information.
  2236. ** Backtraces will now highlight the value that caused the error.
  2237. By default, these values are enclosed in "{...}", such as in this
  2238. example:
  2239. guile> (car 'a)
  2240. Backtrace:
  2241. In current input:
  2242. 1: 0* [car {a}]
  2243. <unnamed port>:1:1: In procedure car in expression (car (quote a)):
  2244. <unnamed port>:1:1: Wrong type (expecting pair): a
  2245. ABORT: (wrong-type-arg)
  2246. The prefix and suffix used for highlighting can be set via the two new
  2247. printer options 'highlight-prefix' and 'highlight-suffix'. For
  2248. example, putting this into ~/.guile will output the bad value in bold
  2249. on an ANSI terminal:
  2250. (print-set! highlight-prefix "\x1b[1m")
  2251. (print-set! highlight-suffix "\x1b[22m")
  2252. ** 'gettext' support for internationalization has been added.
  2253. See the manual for details.
  2254. ** New syntax '@' and '@@':
  2255. You can now directly refer to variables exported from a module by
  2256. writing
  2257. (@ MODULE-NAME VARIABLE-NAME)
  2258. For example (@ (ice-9 pretty-print) pretty-print) will directly access
  2259. the pretty-print variable exported from the (ice-9 pretty-print)
  2260. module. You don't need to 'use' that module first. You can also use
  2261. '@' as a target of 'set!', as in (set! (@ mod var) val).
  2262. The related syntax (@@ MODULE-NAME VARIABLE-NAME) works just like '@',
  2263. but it can also access variables that have not been exported. It is
  2264. intended only for kluges and temporary fixes and for debugging, not
  2265. for ordinary code.
  2266. ** Keyword syntax has been made more disciplined.
  2267. Previously, the name of a keyword was read as a 'token' but printed as
  2268. a symbol. Now, it is read as a general Scheme datum which must be a
  2269. symbol.
  2270. Previously:
  2271. guile> #:12
  2272. #:#{12}#
  2273. guile> #:#{12}#
  2274. #:#{\#{12}\#}#
  2275. guile> #:(a b c)
  2276. #:#{}#
  2277. ERROR: In expression (a b c):
  2278. Unbound variable: a
  2279. guile> #: foo
  2280. #:#{}#
  2281. ERROR: Unbound variable: foo
  2282. Now:
  2283. guile> #:12
  2284. ERROR: Wrong type (expecting symbol): 12
  2285. guile> #:#{12}#
  2286. #:#{12}#
  2287. guile> #:(a b c)
  2288. ERROR: Wrong type (expecting symbol): (a b c)
  2289. guile> #: foo
  2290. #:foo
  2291. ** The printing of symbols that might look like keywords can be
  2292. controlled.
  2293. The new printer option 'quote-keywordish-symbols' controls how symbols
  2294. are printed that have a colon as their first or last character. The
  2295. default now is to only quote a symbol with #{...}# when the read
  2296. option 'keywords' is not '#f'. Thus:
  2297. guile> (define foo (string->symbol ":foo"))
  2298. guile> (read-set! keywords #f)
  2299. guile> foo
  2300. :foo
  2301. guile> (read-set! keywords 'prefix)
  2302. guile> foo
  2303. #{:foo}#
  2304. guile> (print-set! quote-keywordish-symbols #f)
  2305. guile> foo
  2306. :foo
  2307. ** 'while' now provides 'break' and 'continue'
  2308. break and continue were previously bound in a while loop, but not
  2309. documented, and continue didn't quite work properly. The undocumented
  2310. parameter to break which gave a return value for the while has been
  2311. dropped.
  2312. ** 'call-with-current-continuation' is now also available under the name
  2313. 'call/cc'.
  2314. ** The module system now checks for duplicate bindings.
  2315. The module system now can check for name conflicts among imported
  2316. bindings.
  2317. The behavior can be controlled by specifying one or more 'duplicates'
  2318. handlers. For example, to make Guile return an error for every name
  2319. collision, write:
  2320. (define-module (foo)
  2321. :use-module (bar)
  2322. :use-module (baz)
  2323. :duplicates check)
  2324. The new default behavior of the module system when a name collision
  2325. has been detected is to
  2326. 1. Give priority to bindings marked as a replacement.
  2327. 2. Issue a warning (different warning if overriding core binding).
  2328. 3. Give priority to the last encountered binding (this corresponds to
  2329. the old behavior).
  2330. If you want the old behavior back without replacements or warnings you
  2331. can add the line:
  2332. (default-duplicate-binding-handler 'last)
  2333. to your .guile init file.
  2334. ** New define-module option: :replace
  2335. :replace works as :export, but, in addition, marks the binding as a
  2336. replacement.
  2337. A typical example is `format' in (ice-9 format) which is a replacement
  2338. for the core binding `format'.
  2339. ** Adding prefixes to imported bindings in the module system
  2340. There is now a new :use-module option :prefix. It can be used to add
  2341. a prefix to all imported bindings.
  2342. (define-module (foo)
  2343. :use-module ((bar) :prefix bar:))
  2344. will import all bindings exported from bar, but rename them by adding
  2345. the prefix `bar:'.
  2346. ** Conflicting generic functions can be automatically merged.
  2347. When two imported bindings conflict and they are both generic
  2348. functions, the two functions can now be merged automatically. This is
  2349. activated with the 'duplicates' handler 'merge-generics'.
  2350. ** New function: effective-version
  2351. Returns the "effective" version number. This is just the normal full
  2352. version string without the final micro-version number. See "Changes
  2353. to the distribution" above.
  2354. ** New threading functions: parallel, letpar, par-map, and friends
  2355. These are convenient ways to run calculations in parallel in new
  2356. threads. See "Parallel forms" in the manual for details.
  2357. ** New function 'try-mutex'.
  2358. This function will attempt to lock a mutex but will return immediately
  2359. instead of blocking and indicate failure.
  2360. ** Waiting on a condition variable can have a timeout.
  2361. The function 'wait-condition-variable' now takes a third, optional
  2362. argument that specifies the point in time where the waiting should be
  2363. aborted.
  2364. ** New function 'broadcast-condition-variable'.
  2365. ** New functions 'all-threads' and 'current-thread'.
  2366. ** Signals and system asyncs work better with threads.
  2367. The function 'sigaction' now takes a fourth, optional, argument that
  2368. specifies the thread that the handler should run in. When the
  2369. argument is omitted, the handler will run in the thread that called
  2370. 'sigaction'.
  2371. Likewise, 'system-async-mark' takes a second, optional, argument that
  2372. specifies the thread that the async should run in. When it is
  2373. omitted, the async will run in the thread that called
  2374. 'system-async-mark'.
  2375. C code can use the new functions scm_sigaction_for_thread and
  2376. scm_system_async_mark_for_thread to pass the new thread argument.
  2377. When a thread blocks on a mutex, a condition variable or is waiting
  2378. for IO to be possible, it will still execute system asyncs. This can
  2379. be used to interrupt such a thread by making it execute a 'throw', for
  2380. example.
  2381. ** The function 'system-async' is deprecated.
  2382. You can now pass any zero-argument procedure to 'system-async-mark'.
  2383. The function 'system-async' will just return its argument unchanged
  2384. now.
  2385. ** New functions 'call-with-blocked-asyncs' and
  2386. 'call-with-unblocked-asyncs'
  2387. The expression (call-with-blocked-asyncs PROC) will call PROC and will
  2388. block execution of system asyncs for the current thread by one level
  2389. while PROC runs. Likewise, call-with-unblocked-asyncs will call a
  2390. procedure and will unblock the execution of system asyncs by one
  2391. level for the current thread.
  2392. Only system asyncs are affected by these functions.
  2393. ** The functions 'mask-signals' and 'unmask-signals' are deprecated.
  2394. Use 'call-with-blocked-asyncs' or 'call-with-unblocked-asyncs'
  2395. instead. Those functions are easier to use correctly and can be
  2396. nested.
  2397. ** New function 'unsetenv'.
  2398. ** New macro 'define-syntax-public'.
  2399. It works like 'define-syntax' and also exports the defined macro (but
  2400. only on top-level).
  2401. ** There is support for Infinity and NaNs.
  2402. Following PLT Scheme, Guile can now work with infinite numbers, and
  2403. 'not-a-numbers'.
  2404. There is new syntax for numbers: "+inf.0" (infinity), "-inf.0"
  2405. (negative infinity), "+nan.0" (not-a-number), and "-nan.0" (same as
  2406. "+nan.0"). These numbers are inexact and have no exact counterpart.
  2407. Dividing by an inexact zero returns +inf.0 or -inf.0, depending on the
  2408. sign of the dividend. The infinities are integers, and they answer #t
  2409. for both 'even?' and 'odd?'. The +nan.0 value is not an integer and is
  2410. not '=' to itself, but '+nan.0' is 'eqv?' to itself.
  2411. For example
  2412. (/ 1 0.0)
  2413. => +inf.0
  2414. (/ 0 0.0)
  2415. => +nan.0
  2416. (/ 0)
  2417. ERROR: Numerical overflow
  2418. Two new predicates 'inf?' and 'nan?' can be used to test for the
  2419. special values.
  2420. ** Inexact zero can have a sign.
  2421. Guile can now distinguish between plus and minus inexact zero, if your
  2422. platform supports this, too. The two zeros are equal according to
  2423. '=', but not according to 'eqv?'. For example
  2424. (- 0.0)
  2425. => -0.0
  2426. (= 0.0 (- 0.0))
  2427. => #t
  2428. (eqv? 0.0 (- 0.0))
  2429. => #f
  2430. ** Guile now has exact rationals.
  2431. Guile can now represent fractions such as 1/3 exactly. Computing with
  2432. them is also done exactly, of course:
  2433. (* 1/3 3/2)
  2434. => 1/2
  2435. ** 'floor', 'ceiling', 'round' and 'truncate' now return exact numbers
  2436. for exact arguments.
  2437. For example: (floor 2) now returns an exact 2 where in the past it
  2438. returned an inexact 2.0. Likewise, (floor 5/4) returns an exact 1.
  2439. ** inexact->exact no longer returns only integers.
  2440. Without exact rationals, the closest exact number was always an
  2441. integer, but now inexact->exact returns the fraction that is exactly
  2442. equal to a floating point number. For example:
  2443. (inexact->exact 1.234)
  2444. => 694680242521899/562949953421312
  2445. When you want the old behavior, use 'round' explicitly:
  2446. (inexact->exact (round 1.234))
  2447. => 1
  2448. ** New function 'rationalize'.
  2449. This function finds a simple fraction that is close to a given real
  2450. number. For example (and compare with inexact->exact above):
  2451. (rationalize (inexact->exact 1.234) 1/2000)
  2452. => 58/47
  2453. Note that, as required by R5RS, rationalize returns only then an exact
  2454. result when both its arguments are exact.
  2455. ** 'odd?' and 'even?' work also for inexact integers.
  2456. Previously, (odd? 1.0) would signal an error since only exact integers
  2457. were recognized as integers. Now (odd? 1.0) returns #t, (odd? 2.0)
  2458. returns #f and (odd? 1.5) signals an error.
  2459. ** Guile now has uninterned symbols.
  2460. The new function 'make-symbol' will return an uninterned symbol. This
  2461. is a symbol that is unique and is guaranteed to remain unique.
  2462. However, uninterned symbols can not yet be read back in.
  2463. Use the new function 'symbol-interned?' to check whether a symbol is
  2464. interned or not.
  2465. ** pretty-print has more options.
  2466. The function pretty-print from the (ice-9 pretty-print) module can now
  2467. also be invoked with keyword arguments that control things like
  2468. maximum output width. See the manual for details.
  2469. ** Variables have no longer a special behavior for `equal?'.
  2470. Previously, comparing two variables with `equal?' would recursivly
  2471. compare their values. This is no longer done. Variables are now only
  2472. `equal?' if they are `eq?'.
  2473. ** `(begin)' is now valid.
  2474. You can now use an empty `begin' form. It will yield #<unspecified>
  2475. when evaluated and simply be ignored in a definition context.
  2476. ** Deprecated: procedure->macro
  2477. Change your code to use 'define-macro' or r5rs macros. Also, be aware
  2478. that macro expansion will not be done during evaluation, but prior to
  2479. evaluation.
  2480. ** Soft ports now allow a `char-ready?' procedure
  2481. The vector argument to `make-soft-port' can now have a length of
  2482. either 5 or 6. (Previously the length had to be 5.) The optional 6th
  2483. element is interpreted as an `input-waiting' thunk -- i.e. a thunk
  2484. that returns the number of characters that can be read immediately
  2485. without the soft port blocking.
  2486. ** Deprecated: undefine
  2487. There is no replacement for undefine.
  2488. ** The functions make-keyword-from-dash-symbol and keyword-dash-symbol
  2489. have been discouraged.
  2490. They are relics from a time where a keyword like #:foo was used
  2491. directly as a Tcl option "-foo" and thus keywords were internally
  2492. stored as a symbol with a starting dash. We now store a symbol
  2493. without the dash.
  2494. Use symbol->keyword and keyword->symbol instead.
  2495. ** The `cheap' debug option is now obsolete
  2496. Evaluator trap calls are now unconditionally "cheap" - in other words,
  2497. they pass a debug object to the trap handler rather than a full
  2498. continuation. The trap handler code can capture a full continuation
  2499. by using `call-with-current-continuation' in the usual way, if it so
  2500. desires.
  2501. The `cheap' option is retained for now so as not to break existing
  2502. code which gets or sets it, but setting it now has no effect. It will
  2503. be removed in the next major Guile release.
  2504. ** Evaluator trap calls now support `tweaking'
  2505. `Tweaking' means that the trap handler code can modify the Scheme
  2506. expression that is about to be evaluated (in the case of an
  2507. enter-frame trap) or the value that is being returned (in the case of
  2508. an exit-frame trap). The trap handler code indicates that it wants to
  2509. do this by returning a pair whose car is the symbol 'instead and whose
  2510. cdr is the modified expression or return value.
  2511. * Changes to the C interface
  2512. ** The functions scm_hash_fn_remove_x and scm_hashx_remove_x no longer
  2513. take a 'delete' function argument.
  2514. This argument makes no sense since the delete function is used to
  2515. remove a pair from an alist, and this must not be configurable.
  2516. This is an incompatible change.
  2517. ** The GH interface is now subject to the deprecation mechanism
  2518. The GH interface has been deprecated for quite some time but now it is
  2519. actually removed from Guile when it is configured with
  2520. --disable-deprecated.
  2521. See the manual "Transitioning away from GH" for more information.
  2522. ** A new family of functions for converting between C values and
  2523. Scheme values has been added.
  2524. These functions follow a common naming scheme and are designed to be
  2525. easier to use, thread-safe and more future-proof than the older
  2526. alternatives.
  2527. - int scm_is_* (...)
  2528. These are predicates that return a C boolean: 1 or 0. Instead of
  2529. SCM_NFALSEP, you can now use scm_is_true, for example.
  2530. - <type> scm_to_<type> (SCM val, ...)
  2531. These are functions that convert a Scheme value into an appropriate
  2532. C value. For example, you can use scm_to_int to safely convert from
  2533. a SCM to an int.
  2534. - SCM scm_from_<type> (<type> val, ...)
  2535. These functions convert from a C type to a SCM value; for example,
  2536. scm_from_int for ints.
  2537. There is a huge number of these functions, for numbers, strings,
  2538. symbols, vectors, etc. They are documented in the reference manual in
  2539. the API section together with the types that they apply to.
  2540. ** New functions for dealing with complex numbers in C have been added.
  2541. The new functions are scm_c_make_rectangular, scm_c_make_polar,
  2542. scm_c_real_part, scm_c_imag_part, scm_c_magnitude and scm_c_angle.
  2543. They work like scm_make_rectangular etc but take or return doubles
  2544. directly.
  2545. ** The function scm_make_complex has been discouraged.
  2546. Use scm_c_make_rectangular instead.
  2547. ** The INUM macros have been deprecated.
  2548. A lot of code uses these macros to do general integer conversions,
  2549. although the macros only work correctly with fixnums. Use the
  2550. following alternatives.
  2551. SCM_INUMP -> scm_is_integer or similar
  2552. SCM_NINUMP -> !scm_is_integer or similar
  2553. SCM_MAKINUM -> scm_from_int or similar
  2554. SCM_INUM -> scm_to_int or similar
  2555. SCM_VALIDATE_INUM_* -> Do not use these; scm_to_int, etc. will
  2556. do the validating for you.
  2557. ** The scm_num2<type> and scm_<type>2num functions and scm_make_real
  2558. have been discouraged.
  2559. Use the newer scm_to_<type> and scm_from_<type> functions instead for
  2560. new code. The functions have been discouraged since they don't fit
  2561. the naming scheme.
  2562. ** The 'boolean' macros SCM_FALSEP etc have been discouraged.
  2563. They have strange names, especially SCM_NFALSEP, and SCM_BOOLP
  2564. evaluates its argument twice. Use scm_is_true, etc. instead for new
  2565. code.
  2566. ** The macro SCM_EQ_P has been discouraged.
  2567. Use scm_is_eq for new code, which fits better into the naming
  2568. conventions.
  2569. ** The macros SCM_CONSP, SCM_NCONSP, SCM_NULLP, and SCM_NNULLP have
  2570. been discouraged.
  2571. Use the function scm_is_pair or scm_is_null instead.
  2572. ** The functions scm_round and scm_truncate have been deprecated and
  2573. are now available as scm_c_round and scm_c_truncate, respectively.
  2574. These functions occupy the names that scm_round_number and
  2575. scm_truncate_number should have.
  2576. ** The functions scm_c_string2str, scm_c_substring2str, and
  2577. scm_c_symbol2str have been deprecated.
  2578. Use scm_to_locale_stringbuf or similar instead, maybe together with
  2579. scm_substring.
  2580. ** New functions scm_c_make_string, scm_c_string_length,
  2581. scm_c_string_ref, scm_c_string_set_x, scm_c_substring,
  2582. scm_c_substring_shared, scm_c_substring_copy.
  2583. These are like scm_make_string, scm_length, etc. but are slightly
  2584. easier to use from C.
  2585. ** The macros SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_LENGTH,
  2586. SCM_SYMBOL_CHARS, and SCM_SYMBOL_LENGTH have been deprecated.
  2587. They export too many assumptions about the implementation of strings
  2588. and symbols that are no longer true in the presence of
  2589. mutation-sharing substrings and when Guile switches to some form of
  2590. Unicode.
  2591. When working with strings, it is often best to use the normal string
  2592. functions provided by Guile, such as scm_c_string_ref,
  2593. scm_c_string_set_x, scm_string_append, etc. Be sure to look in the
  2594. manual since many more such functions are now provided than
  2595. previously.
  2596. When you want to convert a SCM string to a C string, use the
  2597. scm_to_locale_string function or similar instead. For symbols, use
  2598. scm_symbol_to_string and then work with that string. Because of the
  2599. new string representation, scm_symbol_to_string does not need to copy
  2600. and is thus quite efficient.
  2601. ** Some string, symbol and keyword functions have been discouraged.
  2602. They don't fit into the uniform naming scheme and are not explicit
  2603. about the character encoding.
  2604. Replace according to the following table:
  2605. scm_allocate_string -> scm_c_make_string
  2606. scm_take_str -> scm_take_locale_stringn
  2607. scm_take0str -> scm_take_locale_string
  2608. scm_mem2string -> scm_from_locale_stringn
  2609. scm_str2string -> scm_from_locale_string
  2610. scm_makfrom0str -> scm_from_locale_string
  2611. scm_mem2symbol -> scm_from_locale_symboln
  2612. scm_mem2uninterned_symbol -> scm_from_locale_stringn + scm_make_symbol
  2613. scm_str2symbol -> scm_from_locale_symbol
  2614. SCM_SYMBOL_HASH -> scm_hashq
  2615. SCM_SYMBOL_INTERNED_P -> scm_symbol_interned_p
  2616. scm_c_make_keyword -> scm_from_locale_keyword
  2617. ** The functions scm_keyword_to_symbol and sym_symbol_to_keyword are
  2618. now also available to C code.
  2619. ** SCM_KEYWORDP and SCM_KEYWORDSYM have been deprecated.
  2620. Use scm_is_keyword and scm_keyword_to_symbol instead, but note that
  2621. the latter returns the true name of the keyword, not the 'dash name',
  2622. as SCM_KEYWORDSYM used to do.
  2623. ** A new way to access arrays in a thread-safe and efficient way has
  2624. been added.
  2625. See the manual, node "Accessing Arrays From C".
  2626. ** The old uniform vector and bitvector implementations have been
  2627. unceremoniously removed.
  2628. This implementation exposed the details of the tagging system of
  2629. Guile. Use the new C API explained in the manual in node "Uniform
  2630. Numeric Vectors" and "Bit Vectors", respectively.
  2631. The following macros are gone: SCM_UVECTOR_BASE, SCM_SET_UVECTOR_BASE,
  2632. SCM_UVECTOR_MAXLENGTH, SCM_UVECTOR_LENGTH, SCM_MAKE_UVECTOR_TAG,
  2633. SCM_SET_UVECTOR_LENGTH, SCM_BITVECTOR_P, SCM_BITVECTOR_BASE,
  2634. SCM_SET_BITVECTOR_BASE, SCM_BITVECTOR_MAX_LENGTH,
  2635. SCM_BITVECTOR_LENGTH, SCM_MAKE_BITVECTOR_TAG,
  2636. SCM_SET_BITVECTOR_LENGTH, SCM_BITVEC_REF, SCM_BITVEC_SET,
  2637. SCM_BITVEC_CLR.
  2638. ** The macros dealing with vectors have been deprecated.
  2639. Use the new functions scm_is_vector, scm_vector_elements,
  2640. scm_vector_writable_elements, etc, or scm_is_simple_vector,
  2641. SCM_SIMPLE_VECTOR_REF, SCM_SIMPLE_VECTOR_SET, etc instead. See the
  2642. manual for more details.
  2643. Deprecated are SCM_VECTORP, SCM_VELTS, SCM_VECTOR_MAX_LENGTH,
  2644. SCM_VECTOR_LENGTH, SCM_VECTOR_REF, SCM_VECTOR_SET, SCM_WRITABLE_VELTS.
  2645. The following macros have been removed: SCM_VECTOR_BASE,
  2646. SCM_SET_VECTOR_BASE, SCM_MAKE_VECTOR_TAG, SCM_SET_VECTOR_LENGTH,
  2647. SCM_VELTS_AS_STACKITEMS, SCM_SETVELTS, SCM_GC_WRITABLE_VELTS.
  2648. ** Some C functions and macros related to arrays have been deprecated.
  2649. Migrate according to the following table:
  2650. scm_make_uve -> scm_make_typed_array, scm_make_u8vector etc.
  2651. scm_make_ra -> scm_make_array
  2652. scm_shap2ra -> scm_make_array
  2653. scm_cvref -> scm_c_generalized_vector_ref
  2654. scm_ra_set_contp -> do not use
  2655. scm_aind -> scm_array_handle_pos
  2656. scm_raprin1 -> scm_display or scm_write
  2657. SCM_ARRAYP -> scm_is_array
  2658. SCM_ARRAY_NDIM -> scm_c_array_rank
  2659. SCM_ARRAY_DIMS -> scm_array_handle_dims
  2660. SCM_ARRAY_CONTP -> do not use
  2661. SCM_ARRAY_MEM -> do not use
  2662. SCM_ARRAY_V -> scm_array_handle_elements or similar
  2663. SCM_ARRAY_BASE -> do not use
  2664. ** SCM_CELL_WORD_LOC has been deprecated.
  2665. Use the new macro SCM_CELL_OBJECT_LOC instead, which returns a pointer
  2666. to a SCM, as opposed to a pointer to a scm_t_bits.
  2667. This was done to allow the correct use of pointers into the Scheme
  2668. heap. Previously, the heap words were of type scm_t_bits and local
  2669. variables and function arguments were of type SCM, making it
  2670. non-standards-conformant to have a pointer that can point to both.
  2671. ** New macros SCM_SMOB_DATA_2, SCM_SMOB_DATA_3, etc.
  2672. These macros should be used instead of SCM_CELL_WORD_2/3 to access the
  2673. second and third words of double smobs. Likewise for
  2674. SCM_SET_SMOB_DATA_2 and SCM_SET_SMOB_DATA_3.
  2675. Also, there is SCM_SMOB_FLAGS and SCM_SET_SMOB_FLAGS that should be
  2676. used to get and set the 16 exra bits in the zeroth word of a smob.
  2677. And finally, there is SCM_SMOB_OBJECT and SCM_SMOB_SET_OBJECT for
  2678. accesing the first immediate word of a smob as a SCM value, and there
  2679. is SCM_SMOB_OBJECT_LOC for getting a pointer to the first immediate
  2680. smob word. Like wise for SCM_SMOB_OBJECT_2, etc.
  2681. ** New way to deal with non-local exits and re-entries.
  2682. There is a new set of functions that essentially do what
  2683. scm_internal_dynamic_wind does, but in a way that is more convenient
  2684. for C code in some situations. Here is a quick example of how to
  2685. prevent a potential memory leak:
  2686. void
  2687. foo ()
  2688. {
  2689. char *mem;
  2690. scm_dynwind_begin (0);
  2691. mem = scm_malloc (100);
  2692. scm_dynwind_unwind_handler (free, mem, SCM_F_WIND_EXPLICITLY);
  2693. /* MEM would leak if BAR throws an error.
  2694. SCM_DYNWIND_UNWIND_HANDLER frees it nevertheless.
  2695. */
  2696. bar ();
  2697. scm_dynwind_end ();
  2698. /* Because of SCM_F_WIND_EXPLICITLY, MEM will be freed by
  2699. SCM_DYNWIND_END as well.
  2700. */
  2701. }
  2702. For full documentation, see the node "Dynamic Wind" in the manual.
  2703. ** New function scm_dynwind_free
  2704. This function calls 'free' on a given pointer when a dynwind context
  2705. is left. Thus the call to scm_dynwind_unwind_handler above could be
  2706. replaced with simply scm_dynwind_free (mem).
  2707. ** New functions scm_c_call_with_blocked_asyncs and
  2708. scm_c_call_with_unblocked_asyncs
  2709. Like scm_call_with_blocked_asyncs etc. but for C functions.
  2710. ** New functions scm_dynwind_block_asyncs and scm_dynwind_unblock_asyncs
  2711. In addition to scm_c_call_with_blocked_asyncs you can now also use
  2712. scm_dynwind_block_asyncs in a 'dynwind context' (see above). Likewise for
  2713. scm_c_call_with_unblocked_asyncs and scm_dynwind_unblock_asyncs.
  2714. ** The macros SCM_DEFER_INTS, SCM_ALLOW_INTS, SCM_REDEFER_INTS,
  2715. SCM_REALLOW_INTS have been deprecated.
  2716. They do no longer fulfill their original role of blocking signal
  2717. delivery. Depending on what you want to achieve, replace a pair of
  2718. SCM_DEFER_INTS and SCM_ALLOW_INTS with a dynwind context that locks a
  2719. mutex, blocks asyncs, or both. See node "Critical Sections" in the
  2720. manual.
  2721. ** The value 'scm_mask_ints' is no longer writable.
  2722. Previously, you could set scm_mask_ints directly. This is no longer
  2723. possible. Use scm_c_call_with_blocked_asyncs and
  2724. scm_c_call_with_unblocked_asyncs instead.
  2725. ** New way to temporarily set the current input, output or error ports
  2726. C code can now use scm_dynwind_current_<foo>_port in a 'dynwind
  2727. context' (see above). <foo> is one of "input", "output" or "error".
  2728. ** New way to temporarily set fluids
  2729. C code can now use scm_dynwind_fluid in a 'dynwind context' (see
  2730. above) to temporarily set the value of a fluid.
  2731. ** New types scm_t_intmax and scm_t_uintmax.
  2732. On platforms that have them, these types are identical to intmax_t and
  2733. uintmax_t, respectively. On other platforms, they are identical to
  2734. the largest integer types that Guile knows about.
  2735. ** The functions scm_unmemocopy and scm_unmemoize have been removed.
  2736. You should not have used them.
  2737. ** Many public #defines with generic names have been made private.
  2738. #defines with generic names like HAVE_FOO or SIZEOF_FOO have been made
  2739. private or renamed with a more suitable public name.
  2740. ** The macro SCM_TYP16S has been deprecated.
  2741. This macro is not intended for public use.
  2742. ** The macro SCM_SLOPPY_INEXACTP has been deprecated.
  2743. Use scm_is_true (scm_inexact_p (...)) instead.
  2744. ** The macro SCM_SLOPPY_REALP has been deprecated.
  2745. Use scm_is_real instead.
  2746. ** The macro SCM_SLOPPY_COMPLEXP has been deprecated.
  2747. Use scm_is_complex instead.
  2748. ** Some preprocessor defines have been deprecated.
  2749. These defines indicated whether a certain feature was present in Guile
  2750. or not. Going forward, assume that the features are always present.
  2751. The macros are: USE_THREADS, GUILE_ISELECT, READER_EXTENSIONS,
  2752. DEBUG_EXTENSIONS, DYNAMIC_LINKING.
  2753. The following macros have been removed completely: MEMOIZE_LOCALS,
  2754. SCM_RECKLESS, SCM_CAUTIOUS.
  2755. ** The preprocessor define STACK_DIRECTION has been deprecated.
  2756. There should be no need to know about the stack direction for ordinary
  2757. programs.
  2758. ** New function: scm_effective_version
  2759. Returns the "effective" version number. This is just the normal full
  2760. version string without the final micro-version number. See "Changes
  2761. to the distribution" above.
  2762. ** The function scm_call_with_new_thread has a new prototype.
  2763. Instead of taking a list with the thunk and handler, these two
  2764. arguments are now passed directly:
  2765. SCM scm_call_with_new_thread (SCM thunk, SCM handler);
  2766. This is an incompatible change.
  2767. ** New snarfer macro SCM_DEFINE_PUBLIC.
  2768. This is like SCM_DEFINE, but also calls scm_c_export for the defined
  2769. function in the init section.
  2770. ** The snarfer macro SCM_SNARF_INIT is now officially supported.
  2771. ** Garbage collector rewrite.
  2772. The garbage collector is cleaned up a lot, and now uses lazy
  2773. sweeping. This is reflected in the output of (gc-stats); since cells
  2774. are being freed when they are allocated, the cells-allocated field
  2775. stays roughly constant.
  2776. For malloc related triggers, the behavior is changed. It uses the same
  2777. heuristic as the cell-triggered collections. It may be tuned with the
  2778. environment variables GUILE_MIN_YIELD_MALLOC. This is the percentage
  2779. for minimum yield of malloc related triggers. The default is 40.
  2780. GUILE_INIT_MALLOC_LIMIT sets the initial trigger for doing a GC. The
  2781. default is 200 kb.
  2782. Debugging operations for the freelist have been deprecated, along with
  2783. the C variables that control garbage collection. The environment
  2784. variables GUILE_MAX_SEGMENT_SIZE, GUILE_INIT_SEGMENT_SIZE_2,
  2785. GUILE_INIT_SEGMENT_SIZE_1, and GUILE_MIN_YIELD_2 should be used.
  2786. For understanding the memory usage of a GUILE program, the routine
  2787. gc-live-object-stats returns an alist containing the number of live
  2788. objects for every type.
  2789. ** The function scm_definedp has been renamed to scm_defined_p
  2790. The name scm_definedp is deprecated.
  2791. ** The struct scm_cell type has been renamed to scm_t_cell
  2792. This is in accordance to Guile's naming scheme for types. Note that
  2793. the name scm_cell is now used for a function that allocates and
  2794. initializes a new cell (see below).
  2795. ** New functions for memory management
  2796. A new set of functions for memory management has been added since the
  2797. old way (scm_must_malloc, scm_must_free, etc) was error prone and
  2798. indeed, Guile itself contained some long standing bugs that could
  2799. cause aborts in long running programs.
  2800. The new functions are more symmetrical and do not need cooperation
  2801. from smob free routines, among other improvements.
  2802. The new functions are scm_malloc, scm_realloc, scm_calloc, scm_strdup,
  2803. scm_strndup, scm_gc_malloc, scm_gc_calloc, scm_gc_realloc,
  2804. scm_gc_free, scm_gc_register_collectable_memory, and
  2805. scm_gc_unregister_collectable_memory. Refer to the manual for more
  2806. details and for upgrading instructions.
  2807. The old functions for memory management have been deprecated. They
  2808. are: scm_must_malloc, scm_must_realloc, scm_must_free,
  2809. scm_must_strdup, scm_must_strndup, scm_done_malloc, scm_done_free.
  2810. ** Declarations of exported features are marked with SCM_API.
  2811. Every declaration of a feature that belongs to the exported Guile API
  2812. has been marked by adding the macro "SCM_API" to the start of the
  2813. declaration. This macro can expand into different things, the most
  2814. common of which is just "extern" for Unix platforms. On Win32, it can
  2815. be used to control which symbols are exported from a DLL.
  2816. If you `#define SCM_IMPORT' before including <libguile.h>, SCM_API
  2817. will expand into "__declspec (dllimport) extern", which is needed for
  2818. linking to the Guile DLL in Windows.
  2819. There are also SCM_RL_IMPORT, SCM_SRFI1314_IMPORT, and
  2820. SCM_SRFI4_IMPORT, for the corresponding libraries.
  2821. ** SCM_NEWCELL and SCM_NEWCELL2 have been deprecated.
  2822. Use the new functions scm_cell and scm_double_cell instead. The old
  2823. macros had problems because with them allocation and initialization
  2824. was separated and the GC could sometimes observe half initialized
  2825. cells. Only careful coding by the user of SCM_NEWCELL and
  2826. SCM_NEWCELL2 could make this safe and efficient.
  2827. ** CHECK_ENTRY, CHECK_APPLY and CHECK_EXIT have been deprecated.
  2828. Use the variables scm_check_entry_p, scm_check_apply_p and scm_check_exit_p
  2829. instead.
  2830. ** SRCBRKP has been deprecated.
  2831. Use scm_c_source_property_breakpoint_p instead.
  2832. ** Deprecated: scm_makmacro
  2833. Change your code to use either scm_makmmacro or to define macros in
  2834. Scheme, using 'define-macro'.
  2835. ** New function scm_c_port_for_each.
  2836. This function is like scm_port_for_each but takes a pointer to a C
  2837. function as the callback instead of a SCM value.
  2838. ** The names scm_internal_select, scm_thread_sleep, and
  2839. scm_thread_usleep have been discouraged.
  2840. Use scm_std_select, scm_std_sleep, scm_std_usleep instead.
  2841. ** The GC can no longer be blocked.
  2842. The global flags scm_gc_heap_lock and scm_block_gc have been removed.
  2843. The GC can now run (partially) concurrently with other code and thus
  2844. blocking it is not well defined.
  2845. ** Many definitions have been removed that were previously deprecated.
  2846. scm_lisp_nil, scm_lisp_t, s_nil_ify, scm_m_nil_ify, s_t_ify,
  2847. scm_m_t_ify, s_0_cond, scm_m_0_cond, s_0_ify, scm_m_0_ify, s_1_ify,
  2848. scm_m_1_ify, scm_debug_newcell, scm_debug_newcell2,
  2849. scm_tc16_allocated, SCM_SET_SYMBOL_HASH, SCM_IM_NIL_IFY, SCM_IM_T_IFY,
  2850. SCM_IM_0_COND, SCM_IM_0_IFY, SCM_IM_1_IFY, SCM_GC_SET_ALLOCATED,
  2851. scm_debug_newcell, scm_debug_newcell2, SCM_HUP_SIGNAL, SCM_INT_SIGNAL,
  2852. SCM_FPE_SIGNAL, SCM_BUS_SIGNAL, SCM_SEGV_SIGNAL, SCM_ALRM_SIGNAL,
  2853. SCM_GC_SIGNAL, SCM_TICK_SIGNAL, SCM_SIG_ORD, SCM_ORD_SIG,
  2854. SCM_NUM_SIGS, scm_top_level_lookup_closure_var,
  2855. *top-level-lookup-closure*, scm_system_transformer, scm_eval_3,
  2856. scm_eval2, root_module_lookup_closure, SCM_SLOPPY_STRINGP,
  2857. SCM_RWSTRINGP, scm_read_only_string_p, scm_make_shared_substring,
  2858. scm_tc7_substring, sym_huh, SCM_VARVCELL, SCM_UDVARIABLEP,
  2859. SCM_DEFVARIABLEP, scm_mkbig, scm_big2inum, scm_adjbig, scm_normbig,
  2860. scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl, SCM_FIXNUM_BIT,
  2861. SCM_SETCHARS, SCM_SLOPPY_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET,
  2862. SCM_LENGTH_MAX, SCM_SETLENGTH, SCM_ROSTRINGP, SCM_ROLENGTH,
  2863. SCM_ROCHARS, SCM_ROUCHARS, SCM_SUBSTRP, SCM_COERCE_SUBSTR,
  2864. scm_sym2vcell, scm_intern, scm_intern0, scm_sysintern, scm_sysintern0,
  2865. scm_sysintern0_no_module_lookup, scm_init_symbols_deprecated,
  2866. scm_vector_set_length_x, scm_contregs, scm_debug_info,
  2867. scm_debug_frame, SCM_DSIDEVAL, SCM_CONST_LONG, SCM_VCELL,
  2868. SCM_GLOBAL_VCELL, SCM_VCELL_INIT, SCM_GLOBAL_VCELL_INIT,
  2869. SCM_HUGE_LENGTH, SCM_VALIDATE_STRINGORSUBSTR, SCM_VALIDATE_ROSTRING,
  2870. SCM_VALIDATE_ROSTRING_COPY, SCM_VALIDATE_NULLORROSTRING_COPY,
  2871. SCM_VALIDATE_RWSTRING, DIGITS, scm_small_istr2int, scm_istr2int,
  2872. scm_istr2flo, scm_istring2number, scm_istr2int, scm_istr2flo,
  2873. scm_istring2number, scm_vtable_index_vcell, scm_si_vcell, SCM_ECONSP,
  2874. SCM_NECONSP, SCM_GLOC_VAR, SCM_GLOC_VAL, SCM_GLOC_SET_VAL,
  2875. SCM_GLOC_VAL_LOC, scm_make_gloc, scm_gloc_p, scm_tc16_variable,
  2876. SCM_CHARS, SCM_LENGTH, SCM_SET_STRING_CHARS, SCM_SET_STRING_LENGTH.
  2877. * Changes to bundled modules
  2878. ** (ice-9 debug)
  2879. Using the (ice-9 debug) module no longer automatically switches Guile
  2880. to use the debugging evaluator. If you want to switch to the
  2881. debugging evaluator (which is needed for backtrace information if you
  2882. hit an error), please add an explicit "(debug-enable 'debug)" to your
  2883. code just after the code to use (ice-9 debug).
  2884. Changes since Guile 1.4:
  2885. * Changes to the distribution
  2886. ** A top-level TODO file is included.
  2887. ** Guile now uses a versioning scheme similar to that of the Linux kernel.
  2888. Guile now always uses three numbers to represent the version,
  2889. i.e. "1.6.5". The first number, 1, is the major version number, the
  2890. second number, 6, is the minor version number, and the third number,
  2891. 5, is the micro version number. Changes in major version number
  2892. indicate major changes in Guile.
  2893. Minor version numbers that are even denote stable releases, and odd
  2894. minor version numbers denote development versions (which may be
  2895. unstable). The micro version number indicates a minor sub-revision of
  2896. a given MAJOR.MINOR release.
  2897. In keeping with the new scheme, (minor-version) and scm_minor_version
  2898. no longer return everything but the major version number. They now
  2899. just return the minor version number. Two new functions
  2900. (micro-version) and scm_micro_version have been added to report the
  2901. micro version number.
  2902. In addition, ./GUILE-VERSION now defines GUILE_MICRO_VERSION.
  2903. ** New preprocessor definitions are available for checking versions.
  2904. version.h now #defines SCM_MAJOR_VERSION, SCM_MINOR_VERSION, and
  2905. SCM_MICRO_VERSION to the appropriate integer values.
  2906. ** Guile now actively warns about deprecated features.
  2907. The new configure option `--enable-deprecated=LEVEL' and the
  2908. environment variable GUILE_WARN_DEPRECATED control this mechanism.
  2909. See INSTALL and README for more information.
  2910. ** Guile is much more likely to work on 64-bit architectures.
  2911. Guile now compiles and passes "make check" with only two UNRESOLVED GC
  2912. cases on Alpha and ia64 based machines now. Thanks to John Goerzen
  2913. for the use of a test machine, and thanks to Stefan Jahn for ia64
  2914. patches.
  2915. ** New functions: setitimer and getitimer.
  2916. These implement a fairly direct interface to the libc functions of the
  2917. same name.
  2918. ** The #. reader extension is now disabled by default.
  2919. For safety reasons, #. evaluation is disabled by default. To
  2920. re-enable it, set the fluid read-eval? to #t. For example:
  2921. (fluid-set! read-eval? #t)
  2922. but make sure you realize the potential security risks involved. With
  2923. read-eval? enabled, reading a data file from an untrusted source can
  2924. be dangerous.
  2925. ** New SRFI modules have been added:
  2926. SRFI-0 `cond-expand' is now supported in Guile, without requiring
  2927. using a module.
  2928. (srfi srfi-1) is a library containing many useful pair- and list-processing
  2929. procedures.
  2930. (srfi srfi-2) exports and-let*.
  2931. (srfi srfi-4) implements homogeneous numeric vector datatypes.
  2932. (srfi srfi-6) is a dummy module for now, since guile already provides
  2933. all of the srfi-6 procedures by default: open-input-string,
  2934. open-output-string, get-output-string.
  2935. (srfi srfi-8) exports receive.
  2936. (srfi srfi-9) exports define-record-type.
  2937. (srfi srfi-10) exports define-reader-ctor and implements the reader
  2938. extension #,().
  2939. (srfi srfi-11) exports let-values and let*-values.
  2940. (srfi srfi-13) implements the SRFI String Library.
  2941. (srfi srfi-14) implements the SRFI Character-Set Library.
  2942. (srfi srfi-17) implements setter and getter-with-setter and redefines
  2943. some accessor procedures as procedures with getters. (such as car,
  2944. cdr, vector-ref etc.)
  2945. (srfi srfi-19) implements the SRFI Time/Date Library.
  2946. ** New scripts / "executable modules"
  2947. Subdirectory "scripts" contains Scheme modules that are packaged to
  2948. also be executable as scripts. At this time, these scripts are available:
  2949. display-commentary
  2950. doc-snarf
  2951. generate-autoload
  2952. punify
  2953. read-scheme-source
  2954. use2dot
  2955. See README there for more info.
  2956. These scripts can be invoked from the shell with the new program
  2957. "guile-tools", which keeps track of installation directory for you.
  2958. For example:
  2959. $ guile-tools display-commentary srfi/*.scm
  2960. guile-tools is copied to the standard $bindir on "make install".
  2961. ** New module (ice-9 stack-catch):
  2962. stack-catch is like catch, but saves the current state of the stack in
  2963. the fluid the-last-stack. This fluid can be useful when using the
  2964. debugger and when re-throwing an error.
  2965. ** The module (ice-9 and-let*) has been renamed to (ice-9 and-let-star)
  2966. This has been done to prevent problems on lesser operating systems
  2967. that can't tolerate `*'s in file names. The exported macro continues
  2968. to be named `and-let*', of course.
  2969. On systems that support it, there is also a compatibility module named
  2970. (ice-9 and-let*). It will go away in the next release.
  2971. ** New modules (oop goops) etc.:
  2972. (oop goops)
  2973. (oop goops describe)
  2974. (oop goops save)
  2975. (oop goops active-slot)
  2976. (oop goops composite-slot)
  2977. The Guile Object Oriented Programming System (GOOPS) has been
  2978. integrated into Guile. For further information, consult the GOOPS
  2979. manual and tutorial in the `doc' directory.
  2980. ** New module (ice-9 rdelim).
  2981. This exports the following procedures which were previously defined
  2982. in the default environment:
  2983. read-line read-line! read-delimited read-delimited! %read-delimited!
  2984. %read-line write-line
  2985. For backwards compatibility the definitions are still imported into the
  2986. default environment in this version of Guile. However you should add:
  2987. (use-modules (ice-9 rdelim))
  2988. to any program which uses the definitions, since this may change in
  2989. future.
  2990. Alternatively, if guile-scsh is installed, the (scsh rdelim) module
  2991. can be used for similar functionality.
  2992. ** New module (ice-9 rw)
  2993. This is a subset of the (scsh rw) module from guile-scsh. Currently
  2994. it defines two procedures:
  2995. *** New function: read-string!/partial str [port_or_fdes [start [end]]]
  2996. Read characters from a port or file descriptor into a string STR.
  2997. A port must have an underlying file descriptor -- a so-called
  2998. fport. This procedure is scsh-compatible and can efficiently read
  2999. large strings.
  3000. *** New function: write-string/partial str [port_or_fdes [start [end]]]
  3001. Write characters from a string STR to a port or file descriptor.
  3002. A port must have an underlying file descriptor -- a so-called
  3003. fport. This procedure is mostly compatible and can efficiently
  3004. write large strings.
  3005. ** New module (ice-9 match)
  3006. This module includes Andrew K. Wright's pattern matcher. See
  3007. ice-9/match.scm for brief description or
  3008. http://www.star-lab.com/wright/code.html
  3009. for complete documentation.
  3010. ** New module (ice-9 buffered-input)
  3011. This module provides procedures to construct an input port from an
  3012. underlying source of input that reads and returns its input in chunks.
  3013. The underlying input source is a Scheme procedure, specified by the
  3014. caller, which the port invokes whenever it needs more input.
  3015. This is useful when building an input port whose back end is Readline
  3016. or a UI element such as the GtkEntry widget.
  3017. ** Documentation
  3018. The reference and tutorial documentation that was previously
  3019. distributed separately, as `guile-doc', is now included in the core
  3020. Guile distribution. The documentation consists of the following
  3021. manuals.
  3022. - The Guile Tutorial (guile-tut.texi) contains a tutorial introduction
  3023. to using Guile.
  3024. - The Guile Reference Manual (guile.texi) contains (or is intended to
  3025. contain) reference documentation on all aspects of Guile.
  3026. - The GOOPS Manual (goops.texi) contains both tutorial-style and
  3027. reference documentation for using GOOPS, Guile's Object Oriented
  3028. Programming System.
  3029. - The Revised^5 Report on the Algorithmic Language Scheme
  3030. (r5rs.texi).
  3031. See the README file in the `doc' directory for more details.
  3032. ** There are a couple of examples in the examples/ directory now.
  3033. * Changes to the stand-alone interpreter
  3034. ** New command line option `--use-srfi'
  3035. Using this option, SRFI modules can be loaded on startup and be
  3036. available right from the beginning. This makes programming portable
  3037. Scheme programs easier.
  3038. The option `--use-srfi' expects a comma-separated list of numbers,
  3039. each representing a SRFI number to be loaded into the interpreter
  3040. before starting evaluating a script file or the REPL. Additionally,
  3041. the feature identifier for the loaded SRFIs is recognized by
  3042. `cond-expand' when using this option.
  3043. Example:
  3044. $ guile --use-srfi=8,13
  3045. guile> (receive (x z) (values 1 2) (+ 1 2))
  3046. 3
  3047. guile> (string-pad "bla" 20)
  3048. " bla"
  3049. ** Guile now always starts up in the `(guile-user)' module.
  3050. Previously, scripts executed via the `-s' option would run in the
  3051. `(guile)' module and the repl would run in the `(guile-user)' module.
  3052. Now every user action takes place in the `(guile-user)' module by
  3053. default.
  3054. * Changes to Scheme functions and syntax
  3055. ** Character classifiers work for non-ASCII characters.
  3056. The predicates `char-alphabetic?', `char-numeric?',
  3057. `char-whitespace?', `char-lower?', `char-upper?' and `char-is-both?'
  3058. no longer check whether their arguments are ASCII characters.
  3059. Previously, a character would only be considered alphabetic when it
  3060. was also ASCII, for example.
  3061. ** Previously deprecated Scheme functions have been removed:
  3062. tag - no replacement.
  3063. fseek - replaced by seek.
  3064. list* - replaced by cons*.
  3065. ** It's now possible to create modules with controlled environments
  3066. Example:
  3067. (use-modules (ice-9 safe))
  3068. (define m (make-safe-module))
  3069. ;;; m will now be a module containing only a safe subset of R5RS
  3070. (eval '(+ 1 2) m) --> 3
  3071. (eval 'load m) --> ERROR: Unbound variable: load
  3072. ** Evaluation of "()", the empty list, is now an error.
  3073. Previously, the expression "()" evaluated to the empty list. This has
  3074. been changed to signal a "missing expression" error. The correct way
  3075. to write the empty list as a literal constant is to use quote: "'()".
  3076. ** New concept of `Guile Extensions'.
  3077. A Guile Extension is just a ordinary shared library that can be linked
  3078. at run-time. We found it advantageous to give this simple concept a
  3079. dedicated name to distinguish the issues related to shared libraries
  3080. from the issues related to the module system.
  3081. *** New function: load-extension
  3082. Executing (load-extension lib init) is mostly equivalent to
  3083. (dynamic-call init (dynamic-link lib))
  3084. except when scm_register_extension has been called previously.
  3085. Whenever appropriate, you should use `load-extension' instead of
  3086. dynamic-link and dynamic-call.
  3087. *** New C function: scm_c_register_extension
  3088. This function registers a initialization function for use by
  3089. `load-extension'. Use it when you don't want specific extensions to
  3090. be loaded as shared libraries (for example on platforms that don't
  3091. support dynamic linking).
  3092. ** Auto-loading of compiled-code modules is deprecated.
  3093. Guile used to be able to automatically find and link a shared
  3094. library to satisfy requests for a module. For example, the module
  3095. `(foo bar)' could be implemented by placing a shared library named
  3096. "foo/libbar.so" (or with a different extension) in a directory on the
  3097. load path of Guile.
  3098. This has been found to be too tricky, and is no longer supported. The
  3099. shared libraries are now called "extensions". You should now write a
  3100. small Scheme file that calls `load-extension' to load the shared
  3101. library and initialize it explicitly.
  3102. The shared libraries themselves should be installed in the usual
  3103. places for shared libraries, with names like "libguile-foo-bar".
  3104. For example, place this into a file "foo/bar.scm"
  3105. (define-module (foo bar))
  3106. (load-extension "libguile-foo-bar" "foobar_init")
  3107. ** Backward incompatible change: eval EXP ENVIRONMENT-SPECIFIER
  3108. `eval' is now R5RS, that is it takes two arguments.
  3109. The second argument is an environment specifier, i.e. either
  3110. (scheme-report-environment 5)
  3111. (null-environment 5)
  3112. (interaction-environment)
  3113. or
  3114. any module.
  3115. ** The module system has been made more disciplined.
  3116. The function `eval' will save and restore the current module around
  3117. the evaluation of the specified expression. While this expression is
  3118. evaluated, `(current-module)' will now return the right module, which
  3119. is the module specified as the second argument to `eval'.
  3120. A consequence of this change is that `eval' is not particularly
  3121. useful when you want allow the evaluated code to change what module is
  3122. designated as the current module and have this change persist from one
  3123. call to `eval' to the next. The read-eval-print-loop is an example
  3124. where `eval' is now inadequate. To compensate, there is a new
  3125. function `primitive-eval' that does not take a module specifier and
  3126. that does not save/restore the current module. You should use this
  3127. function together with `set-current-module', `current-module', etc
  3128. when you want to have more control over the state that is carried from
  3129. one eval to the next.
  3130. Additionally, it has been made sure that forms that are evaluated at
  3131. the top level are always evaluated with respect to the current module.
  3132. Previously, subforms of top-level forms such as `begin', `case',
  3133. etc. did not respect changes to the current module although these
  3134. subforms are at the top-level as well.
  3135. To prevent strange behavior, the forms `define-module',
  3136. `use-modules', `use-syntax', and `export' have been restricted to only
  3137. work on the top level. The forms `define-public' and
  3138. `defmacro-public' only export the new binding on the top level. They
  3139. behave just like `define' and `defmacro', respectively, when they are
  3140. used in a lexical environment.
  3141. Also, `export' will no longer silently re-export bindings imported
  3142. from a used module. It will emit a `deprecation' warning and will
  3143. cease to perform any re-export in the next version. If you actually
  3144. want to re-export bindings, use the new `re-export' in place of
  3145. `export'. The new `re-export' will not make copies of variables when
  3146. rexporting them, as `export' did wrongly.
  3147. ** Module system now allows selection and renaming of imported bindings
  3148. Previously, when using `use-modules' or the `#:use-module' clause in
  3149. the `define-module' form, all the bindings (association of symbols to
  3150. values) for imported modules were added to the "current module" on an
  3151. as-is basis. This has been changed to allow finer control through two
  3152. new facilities: selection and renaming.
  3153. You can now select which of the imported module's bindings are to be
  3154. visible in the current module by using the `:select' clause. This
  3155. clause also can be used to rename individual bindings. For example:
  3156. ;; import all bindings no questions asked
  3157. (use-modules (ice-9 common-list))
  3158. ;; import four bindings, renaming two of them;
  3159. ;; the current module sees: every some zonk-y zonk-n
  3160. (use-modules ((ice-9 common-list)
  3161. :select (every some
  3162. (remove-if . zonk-y)
  3163. (remove-if-not . zonk-n))))
  3164. You can also programmatically rename all selected bindings using the
  3165. `:renamer' clause, which specifies a proc that takes a symbol and
  3166. returns another symbol. Because it is common practice to use a prefix,
  3167. we now provide the convenience procedure `symbol-prefix-proc'. For
  3168. example:
  3169. ;; import four bindings, renaming two of them specifically,
  3170. ;; and all four w/ prefix "CL:";
  3171. ;; the current module sees: CL:every CL:some CL:zonk-y CL:zonk-n
  3172. (use-modules ((ice-9 common-list)
  3173. :select (every some
  3174. (remove-if . zonk-y)
  3175. (remove-if-not . zonk-n))
  3176. :renamer (symbol-prefix-proc 'CL:)))
  3177. ;; import four bindings, renaming two of them specifically,
  3178. ;; and all four by upcasing.
  3179. ;; the current module sees: EVERY SOME ZONK-Y ZONK-N
  3180. (define (upcase-symbol sym)
  3181. (string->symbol (string-upcase (symbol->string sym))))
  3182. (use-modules ((ice-9 common-list)
  3183. :select (every some
  3184. (remove-if . zonk-y)
  3185. (remove-if-not . zonk-n))
  3186. :renamer upcase-symbol))
  3187. Note that programmatic renaming is done *after* individual renaming.
  3188. Also, the above examples show `use-modules', but the same facilities are
  3189. available for the `#:use-module' clause of `define-module'.
  3190. See manual for more info.
  3191. ** The semantics of guardians have changed.
  3192. The changes are for the most part compatible. An important criterion
  3193. was to keep the typical usage of guardians as simple as before, but to
  3194. make the semantics safer and (as a result) more useful.
  3195. *** All objects returned from guardians are now properly alive.
  3196. It is now guaranteed that any object referenced by an object returned
  3197. from a guardian is alive. It's now impossible for a guardian to
  3198. return a "contained" object before its "containing" object.
  3199. One incompatible (but probably not very important) change resulting
  3200. from this is that it is no longer possible to guard objects that
  3201. indirectly reference themselves (i.e. are parts of cycles). If you do
  3202. so accidentally, you'll get a warning.
  3203. *** There are now two types of guardians: greedy and sharing.
  3204. If you call (make-guardian #t) or just (make-guardian), you'll get a
  3205. greedy guardian, and for (make-guardian #f) a sharing guardian.
  3206. Greedy guardians are the default because they are more "defensive".
  3207. You can only greedily guard an object once. If you guard an object
  3208. more than once, once in a greedy guardian and the rest of times in
  3209. sharing guardians, then it is guaranteed that the object won't be
  3210. returned from sharing guardians as long as it is greedily guarded
  3211. and/or alive.
  3212. Guardians returned by calls to `make-guardian' can now take one more
  3213. optional parameter, which says whether to throw an error in case an
  3214. attempt is made to greedily guard an object that is already greedily
  3215. guarded. The default is true, i.e. throw an error. If the parameter
  3216. is false, the guardian invocation returns #t if guarding was
  3217. successful and #f if it wasn't.
  3218. Also, since greedy guarding is, in effect, a side-effecting operation
  3219. on objects, a new function is introduced: `destroy-guardian!'.
  3220. Invoking this function on a guardian renders it unoperative and, if
  3221. the guardian is greedy, clears the "greedily guarded" property of the
  3222. objects that were guarded by it, thus undoing the side effect.
  3223. Note that all this hair is hardly very important, since guardian
  3224. objects are usually permanent.
  3225. ** Continuations created by call-with-current-continuation now accept
  3226. any number of arguments, as required by R5RS.
  3227. ** New function `issue-deprecation-warning'
  3228. This function is used to display the deprecation messages that are
  3229. controlled by GUILE_WARN_DEPRECATION as explained in the README.
  3230. (define (id x)
  3231. (issue-deprecation-warning "`id' is deprecated. Use `identity' instead.")
  3232. (identity x))
  3233. guile> (id 1)
  3234. ;; `id' is deprecated. Use `identity' instead.
  3235. 1
  3236. guile> (id 1)
  3237. 1
  3238. ** New syntax `begin-deprecated'
  3239. When deprecated features are included (as determined by the configure
  3240. option --enable-deprecated), `begin-deprecated' is identical to
  3241. `begin'. When deprecated features are excluded, it always evaluates
  3242. to `#f', ignoring the body forms.
  3243. ** New function `make-object-property'
  3244. This function returns a new `procedure with setter' P that can be used
  3245. to attach a property to objects. When calling P as
  3246. (set! (P obj) val)
  3247. where `obj' is any kind of object, it attaches `val' to `obj' in such
  3248. a way that it can be retrieved by calling P as
  3249. (P obj)
  3250. This function will replace procedure properties, symbol properties and
  3251. source properties eventually.
  3252. ** Module (ice-9 optargs) now uses keywords instead of `#&'.
  3253. Instead of #&optional, #&key, etc you should now use #:optional,
  3254. #:key, etc. Since #:optional is a keyword, you can write it as just
  3255. :optional when (read-set! keywords 'prefix) is active.
  3256. The old reader syntax `#&' is still supported, but deprecated. It
  3257. will be removed in the next release.
  3258. ** New define-module option: pure
  3259. Tells the module system not to include any bindings from the root
  3260. module.
  3261. Example:
  3262. (define-module (totally-empty-module)
  3263. :pure)
  3264. ** New define-module option: export NAME1 ...
  3265. Export names NAME1 ...
  3266. This option is required if you want to be able to export bindings from
  3267. a module which doesn't import one of `define-public' or `export'.
  3268. Example:
  3269. (define-module (foo)
  3270. :pure
  3271. :use-module (ice-9 r5rs)
  3272. :export (bar))
  3273. ;;; Note that we're pure R5RS below this point!
  3274. (define (bar)
  3275. ...)
  3276. ** New function: object->string OBJ
  3277. Return a Scheme string obtained by printing a given object.
  3278. ** New function: port? X
  3279. Returns a boolean indicating whether X is a port. Equivalent to
  3280. `(or (input-port? X) (output-port? X))'.
  3281. ** New function: file-port?
  3282. Determines whether a given object is a port that is related to a file.
  3283. ** New function: port-for-each proc
  3284. Apply PROC to each port in the Guile port table in turn. The return
  3285. value is unspecified. More specifically, PROC is applied exactly once
  3286. to every port that exists in the system at the time PORT-FOR-EACH is
  3287. invoked. Changes to the port table while PORT-FOR-EACH is running
  3288. have no effect as far as PORT-FOR-EACH is concerned.
  3289. ** New function: dup2 oldfd newfd
  3290. A simple wrapper for the `dup2' system call. Copies the file
  3291. descriptor OLDFD to descriptor number NEWFD, replacing the
  3292. previous meaning of NEWFD. Both OLDFD and NEWFD must be integers.
  3293. Unlike for dup->fdes or primitive-move->fdes, no attempt is made
  3294. to move away ports which are using NEWFD. The return value is
  3295. unspecified.
  3296. ** New function: close-fdes fd
  3297. A simple wrapper for the `close' system call. Close file
  3298. descriptor FD, which must be an integer. Unlike close (*note
  3299. close: Ports and File Descriptors.), the file descriptor will be
  3300. closed even if a port is using it. The return value is
  3301. unspecified.
  3302. ** New function: crypt password salt
  3303. Encrypts `password' using the standard unix password encryption
  3304. algorithm.
  3305. ** New function: chroot path
  3306. Change the root directory of the running process to `path'.
  3307. ** New functions: getlogin, cuserid
  3308. Return the login name or the user name of the current effective user
  3309. id, respectively.
  3310. ** New functions: getpriority which who, setpriority which who prio
  3311. Get or set the priority of the running process.
  3312. ** New function: getpass prompt
  3313. Read a password from the terminal, first displaying `prompt' and
  3314. disabling echoing.
  3315. ** New function: flock file operation
  3316. Set/remove an advisory shared or exclusive lock on `file'.
  3317. ** New functions: sethostname name, gethostname
  3318. Set or get the hostname of the machine the current process is running
  3319. on.
  3320. ** New function: mkstemp! tmpl
  3321. mkstemp creates a new unique file in the file system and returns a
  3322. new buffered port open for reading and writing to the file. TMPL
  3323. is a string specifying where the file should be created: it must
  3324. end with `XXXXXX' and will be changed in place to return the name
  3325. of the temporary file.
  3326. ** New function: open-input-string string
  3327. Return an input string port which delivers the characters from
  3328. `string'. This procedure, together with `open-output-string' and
  3329. `get-output-string' implements SRFI-6.
  3330. ** New function: open-output-string
  3331. Return an output string port which collects all data written to it.
  3332. The data can then be retrieved by `get-output-string'.
  3333. ** New function: get-output-string
  3334. Return the contents of an output string port.
  3335. ** New function: identity
  3336. Return the argument.
  3337. ** socket, connect, accept etc., now have support for IPv6. IPv6 addresses
  3338. are represented in Scheme as integers with normal host byte ordering.
  3339. ** New function: inet-pton family address
  3340. Convert a printable string network address into an integer. Note that
  3341. unlike the C version of this function, the result is an integer with
  3342. normal host byte ordering. FAMILY can be `AF_INET' or `AF_INET6'.
  3343. e.g.,
  3344. (inet-pton AF_INET "127.0.0.1") => 2130706433
  3345. (inet-pton AF_INET6 "::1") => 1
  3346. ** New function: inet-ntop family address
  3347. Convert an integer network address into a printable string. Note that
  3348. unlike the C version of this function, the input is an integer with
  3349. normal host byte ordering. FAMILY can be `AF_INET' or `AF_INET6'.
  3350. e.g.,
  3351. (inet-ntop AF_INET 2130706433) => "127.0.0.1"
  3352. (inet-ntop AF_INET6 (- (expt 2 128) 1)) =>
  3353. ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
  3354. ** Deprecated: id
  3355. Use `identity' instead.
  3356. ** Deprecated: -1+
  3357. Use `1-' instead.
  3358. ** Deprecated: return-it
  3359. Do without it.
  3360. ** Deprecated: string-character-length
  3361. Use `string-length' instead.
  3362. ** Deprecated: flags
  3363. Use `logior' instead.
  3364. ** Deprecated: close-all-ports-except.
  3365. This was intended for closing ports in a child process after a fork,
  3366. but it has the undesirable side effect of flushing buffers.
  3367. port-for-each is more flexible.
  3368. ** The (ice-9 popen) module now attempts to set up file descriptors in
  3369. the child process from the current Scheme ports, instead of using the
  3370. current values of file descriptors 0, 1, and 2 in the parent process.
  3371. ** Removed function: builtin-weak-bindings
  3372. There is no such concept as a weak binding any more.
  3373. ** Removed constants: bignum-radix, scm-line-incrementors
  3374. ** define-method: New syntax mandatory.
  3375. The new method syntax is now mandatory:
  3376. (define-method (NAME ARG-SPEC ...) BODY ...)
  3377. (define-method (NAME ARG-SPEC ... . REST-ARG) BODY ...)
  3378. ARG-SPEC ::= ARG-NAME | (ARG-NAME TYPE)
  3379. REST-ARG ::= ARG-NAME
  3380. If you have old code using the old syntax, import
  3381. (oop goops old-define-method) before (oop goops) as in:
  3382. (use-modules (oop goops old-define-method) (oop goops))
  3383. ** Deprecated function: builtin-variable
  3384. Removed function: builtin-bindings
  3385. There is no longer a distinction between builtin or other variables.
  3386. Use module system operations for all variables.
  3387. ** Lazy-catch handlers are no longer allowed to return.
  3388. That is, a call to `throw', `error', etc is now guaranteed to not
  3389. return.
  3390. ** Bugfixes for (ice-9 getopt-long)
  3391. This module is now tested using test-suite/tests/getopt-long.test.
  3392. The following bugs have been fixed:
  3393. *** Parsing for options that are specified to have `optional' args now checks
  3394. if the next element is an option instead of unconditionally taking it as the
  3395. option arg.
  3396. *** An error is now thrown for `--opt=val' when the option description
  3397. does not specify `(value #t)' or `(value optional)'. This condition used to
  3398. be accepted w/o error, contrary to the documentation.
  3399. *** The error message for unrecognized options is now more informative.
  3400. It used to be "not a record", an artifact of the implementation.
  3401. *** The error message for `--opt' terminating the arg list (no value), when
  3402. `(value #t)' is specified, is now more informative. It used to be "not enough
  3403. args".
  3404. *** "Clumped" single-char args now preserve trailing string, use it as arg.
  3405. The expansion used to be like so:
  3406. ("-abc5d" "--xyz") => ("-a" "-b" "-c" "--xyz")
  3407. Note that the "5d" is dropped. Now it is like so:
  3408. ("-abc5d" "--xyz") => ("-a" "-b" "-c" "5d" "--xyz")
  3409. This enables single-char options to have adjoining arguments as long as their
  3410. constituent characters are not potential single-char options.
  3411. ** (ice-9 session) procedure `arity' now works with (ice-9 optargs) `lambda*'
  3412. The `lambda*' and derivative forms in (ice-9 optargs) now set a procedure
  3413. property `arglist', which can be retrieved by `arity'. The result is that
  3414. `arity' can give more detailed information than before:
  3415. Before:
  3416. guile> (use-modules (ice-9 optargs))
  3417. guile> (define* (foo #:optional a b c) a)
  3418. guile> (arity foo)
  3419. 0 or more arguments in `lambda*:G0'.
  3420. After:
  3421. guile> (arity foo)
  3422. 3 optional arguments: `a', `b' and `c'.
  3423. guile> (define* (bar a b #:key c d #:allow-other-keys) a)
  3424. guile> (arity bar)
  3425. 2 required arguments: `a' and `b', 2 keyword arguments: `c'
  3426. and `d', other keywords allowed.
  3427. guile> (define* (baz a b #:optional c #:rest r) a)
  3428. guile> (arity baz)
  3429. 2 required arguments: `a' and `b', 1 optional argument: `c',
  3430. the rest in `r'.
  3431. * Changes to the C interface
  3432. ** Types have been renamed from scm_*_t to scm_t_*.
  3433. This has been done for POSIX sake. It reserves identifiers ending
  3434. with "_t". What a concept.
  3435. The old names are still available with status `deprecated'.
  3436. ** scm_t_bits (former scm_bits_t) is now a unsigned type.
  3437. ** Deprecated features have been removed.
  3438. *** Macros removed
  3439. SCM_INPORTP, SCM_OUTPORTP SCM_ICHRP, SCM_ICHR, SCM_MAKICHR
  3440. SCM_SETJMPBUF SCM_NSTRINGP SCM_NRWSTRINGP SCM_NVECTORP SCM_DOUBLE_CELLP
  3441. *** C Functions removed
  3442. scm_sysmissing scm_tag scm_tc16_flo scm_tc_flo
  3443. scm_fseek - replaced by scm_seek.
  3444. gc-thunk - replaced by after-gc-hook.
  3445. gh_int2scmb - replaced by gh_bool2scm.
  3446. scm_tc_dblr - replaced by scm_tc16_real.
  3447. scm_tc_dblc - replaced by scm_tc16_complex.
  3448. scm_list_star - replaced by scm_cons_star.
  3449. ** Deprecated: scm_makfromstr
  3450. Use scm_mem2string instead.
  3451. ** Deprecated: scm_make_shared_substring
  3452. Explicit shared substrings will disappear from Guile.
  3453. Instead, "normal" strings will be implemented using sharing
  3454. internally, combined with a copy-on-write strategy.
  3455. ** Deprecated: scm_read_only_string_p
  3456. The concept of read-only strings will disappear in next release of
  3457. Guile.
  3458. ** Deprecated: scm_sloppy_memq, scm_sloppy_memv, scm_sloppy_member
  3459. Instead, use scm_c_memq or scm_memq, scm_memv, scm_member.
  3460. ** New functions: scm_call_0, scm_call_1, scm_call_2, scm_call_3
  3461. Call a procedure with the indicated number of arguments. See "Fly
  3462. Evaluation" in the manual.
  3463. ** New functions: scm_apply_0, scm_apply_1, scm_apply_2, scm_apply_3
  3464. Call a procedure with the indicated number of arguments and a list of
  3465. further arguments. See "Fly Evaluation" in the manual.
  3466. ** New functions: scm_list_1, scm_list_2, scm_list_3, scm_list_4, scm_list_5
  3467. Create a list of the given number of elements. See "List
  3468. Constructors" in the manual.
  3469. ** Renamed function: scm_listify has been replaced by scm_list_n.
  3470. ** Deprecated macros: SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4,
  3471. SCM_LIST5, SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9.
  3472. Use functions scm_list_N instead.
  3473. ** New function: scm_c_read (SCM port, void *buffer, scm_sizet size)
  3474. Used by an application to read arbitrary number of bytes from a port.
  3475. Same semantics as libc read, except that scm_c_read only returns less
  3476. than SIZE bytes if at end-of-file.
  3477. Warning: Doesn't update port line and column counts!
  3478. ** New function: scm_c_write (SCM port, const void *ptr, scm_sizet size)
  3479. Used by an application to write arbitrary number of bytes to an SCM
  3480. port. Similar semantics as libc write. However, unlike libc
  3481. write, scm_c_write writes the requested number of bytes and has no
  3482. return value.
  3483. Warning: Doesn't update port line and column counts!
  3484. ** New function: scm_init_guile ()
  3485. In contrast to scm_boot_guile, scm_init_guile will return normally
  3486. after initializing Guile. It is not available on all systems, tho.
  3487. ** New functions: scm_str2symbol, scm_mem2symbol
  3488. The function scm_str2symbol takes a const char* pointing to a zero-terminated
  3489. field of characters and creates a scheme symbol object from that C string.
  3490. The function scm_mem2symbol takes a const char* and a number of characters and
  3491. creates a symbol from the characters in that memory area.
  3492. ** New functions: scm_primitive_make_property
  3493. scm_primitive_property_ref
  3494. scm_primitive_property_set_x
  3495. scm_primitive_property_del_x
  3496. These functions implement a new way to deal with object properties.
  3497. See libguile/properties.c for their documentation.
  3498. ** New function: scm_done_free (long size)
  3499. This function is the inverse of scm_done_malloc. Use it to report the
  3500. amount of smob memory you free. The previous method, which involved
  3501. calling scm_done_malloc with negative argument, was somewhat
  3502. unintuitive (and is still available, of course).
  3503. ** New function: scm_c_memq (SCM obj, SCM list)
  3504. This function provides a fast C level alternative for scm_memq for the case
  3505. that the list parameter is known to be a proper list. The function is a
  3506. replacement for scm_sloppy_memq, but is stricter in its requirements on its
  3507. list input parameter, since for anything else but a proper list the function's
  3508. behaviour is undefined - it may even crash or loop endlessly. Further, for
  3509. the case that the object is not found in the list, scm_c_memq returns #f which
  3510. is similar to scm_memq, but different from scm_sloppy_memq's behaviour.
  3511. ** New functions: scm_remember_upto_here_1, scm_remember_upto_here_2,
  3512. scm_remember_upto_here
  3513. These functions replace the function scm_remember.
  3514. ** Deprecated function: scm_remember
  3515. Use one of the new functions scm_remember_upto_here_1,
  3516. scm_remember_upto_here_2 or scm_remember_upto_here instead.
  3517. ** New function: scm_allocate_string
  3518. This function replaces the function scm_makstr.
  3519. ** Deprecated function: scm_makstr
  3520. Use the new function scm_allocate_string instead.
  3521. ** New global variable scm_gc_running_p introduced.
  3522. Use this variable to find out if garbage collection is being executed. Up to
  3523. now applications have used scm_gc_heap_lock to test if garbage collection was
  3524. running, which also works because of the fact that up to know only the garbage
  3525. collector has set this variable. But, this is an implementation detail that
  3526. may change. Further, scm_gc_heap_lock is not set throughout gc, thus the use
  3527. of this variable is (and has been) not fully safe anyway.
  3528. ** New macros: SCM_BITVECTOR_MAX_LENGTH, SCM_UVECTOR_MAX_LENGTH
  3529. Use these instead of SCM_LENGTH_MAX.
  3530. ** New macros: SCM_CONTINUATION_LENGTH, SCM_CCLO_LENGTH, SCM_STACK_LENGTH,
  3531. SCM_STRING_LENGTH, SCM_SYMBOL_LENGTH, SCM_UVECTOR_LENGTH,
  3532. SCM_BITVECTOR_LENGTH, SCM_VECTOR_LENGTH.
  3533. Use these instead of SCM_LENGTH.
  3534. ** New macros: SCM_SET_CONTINUATION_LENGTH, SCM_SET_STRING_LENGTH,
  3535. SCM_SET_SYMBOL_LENGTH, SCM_SET_VECTOR_LENGTH, SCM_SET_UVECTOR_LENGTH,
  3536. SCM_SET_BITVECTOR_LENGTH
  3537. Use these instead of SCM_SETLENGTH
  3538. ** New macros: SCM_STRING_CHARS, SCM_SYMBOL_CHARS, SCM_CCLO_BASE,
  3539. SCM_VECTOR_BASE, SCM_UVECTOR_BASE, SCM_BITVECTOR_BASE, SCM_COMPLEX_MEM,
  3540. SCM_ARRAY_MEM
  3541. Use these instead of SCM_CHARS, SCM_UCHARS, SCM_ROCHARS, SCM_ROUCHARS or
  3542. SCM_VELTS.
  3543. ** New macros: SCM_SET_BIGNUM_BASE, SCM_SET_STRING_CHARS,
  3544. SCM_SET_SYMBOL_CHARS, SCM_SET_UVECTOR_BASE, SCM_SET_BITVECTOR_BASE,
  3545. SCM_SET_VECTOR_BASE
  3546. Use these instead of SCM_SETCHARS.
  3547. ** New macro: SCM_BITVECTOR_P
  3548. ** New macro: SCM_STRING_COERCE_0TERMINATION_X
  3549. Use instead of SCM_COERCE_SUBSTR.
  3550. ** New macros: SCM_DIR_OPEN_P, SCM_DIR_FLAG_OPEN
  3551. For directory objects, use these instead of SCM_OPDIRP and SCM_OPN.
  3552. ** Deprecated macros: SCM_OUTOFRANGE, SCM_NALLOC, SCM_HUP_SIGNAL,
  3553. SCM_INT_SIGNAL, SCM_FPE_SIGNAL, SCM_BUS_SIGNAL, SCM_SEGV_SIGNAL,
  3554. SCM_ALRM_SIGNAL, SCM_GC_SIGNAL, SCM_TICK_SIGNAL, SCM_SIG_ORD,
  3555. SCM_ORD_SIG, SCM_NUM_SIGS, SCM_SYMBOL_SLOTS, SCM_SLOTS, SCM_SLOPPY_STRINGP,
  3556. SCM_VALIDATE_STRINGORSUBSTR, SCM_FREEP, SCM_NFREEP, SCM_CHARS, SCM_UCHARS,
  3557. SCM_VALIDATE_ROSTRING, SCM_VALIDATE_ROSTRING_COPY,
  3558. SCM_VALIDATE_NULLORROSTRING_COPY, SCM_ROLENGTH, SCM_LENGTH, SCM_HUGE_LENGTH,
  3559. SCM_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET, SCM_COERCE_SUBSTR,
  3560. SCM_ROSTRINGP, SCM_RWSTRINGP, SCM_VALIDATE_RWSTRING, SCM_ROCHARS,
  3561. SCM_ROUCHARS, SCM_SETLENGTH, SCM_SETCHARS, SCM_LENGTH_MAX, SCM_GC8MARKP,
  3562. SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16, SCM_GCCDR, SCM_SUBR_DOC,
  3563. SCM_OPDIRP, SCM_VALIDATE_OPDIR, SCM_WTA, RETURN_SCM_WTA, SCM_CONST_LONG,
  3564. SCM_WNA, SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY,
  3565. SCM_VALIDATE_NUMBER_DEF_COPY, SCM_SLOPPY_CONSP, SCM_SLOPPY_NCONSP,
  3566. SCM_SETAND_CDR, SCM_SETOR_CDR, SCM_SETAND_CAR, SCM_SETOR_CAR
  3567. Use SCM_ASSERT_RANGE or SCM_VALIDATE_XXX_RANGE instead of SCM_OUTOFRANGE.
  3568. Use scm_memory_error instead of SCM_NALLOC.
  3569. Use SCM_STRINGP instead of SCM_SLOPPY_STRINGP.
  3570. Use SCM_VALIDATE_STRING instead of SCM_VALIDATE_STRINGORSUBSTR.
  3571. Use SCM_FREE_CELL_P instead of SCM_FREEP/SCM_NFREEP
  3572. Use a type specific accessor macro instead of SCM_CHARS/SCM_UCHARS.
  3573. Use a type specific accessor instead of SCM(_|_RO|_HUGE_)LENGTH.
  3574. Use SCM_VALIDATE_(SYMBOL|STRING) instead of SCM_VALIDATE_ROSTRING.
  3575. Use SCM_STRING_COERCE_0TERMINATION_X instead of SCM_COERCE_SUBSTR.
  3576. Use SCM_STRINGP or SCM_SYMBOLP instead of SCM_ROSTRINGP.
  3577. Use SCM_STRINGP instead of SCM_RWSTRINGP.
  3578. Use SCM_VALIDATE_STRING instead of SCM_VALIDATE_RWSTRING.
  3579. Use SCM_STRING_CHARS instead of SCM_ROCHARS.
  3580. Use SCM_STRING_UCHARS instead of SCM_ROUCHARS.
  3581. Use a type specific setter macro instead of SCM_SETLENGTH.
  3582. Use a type specific setter macro instead of SCM_SETCHARS.
  3583. Use a type specific length macro instead of SCM_LENGTH_MAX.
  3584. Use SCM_GCMARKP instead of SCM_GC8MARKP.
  3585. Use SCM_SETGCMARK instead of SCM_SETGC8MARK.
  3586. Use SCM_CLRGCMARK instead of SCM_CLRGC8MARK.
  3587. Use SCM_TYP16 instead of SCM_GCTYP16.
  3588. Use SCM_CDR instead of SCM_GCCDR.
  3589. Use SCM_DIR_OPEN_P instead of SCM_OPDIRP.
  3590. Use SCM_MISC_ERROR or SCM_WRONG_TYPE_ARG instead of SCM_WTA.
  3591. Use SCM_MISC_ERROR or SCM_WRONG_TYPE_ARG instead of RETURN_SCM_WTA.
  3592. Use SCM_VCELL_INIT instead of SCM_CONST_LONG.
  3593. Use SCM_WRONG_NUM_ARGS instead of SCM_WNA.
  3594. Use SCM_CONSP instead of SCM_SLOPPY_CONSP.
  3595. Use !SCM_CONSP instead of SCM_SLOPPY_NCONSP.
  3596. ** Removed function: scm_struct_init
  3597. ** Removed variable: scm_symhash_dim
  3598. ** Renamed function: scm_make_cont has been replaced by
  3599. scm_make_continuation, which has a different interface.
  3600. ** Deprecated function: scm_call_catching_errors
  3601. Use scm_catch or scm_lazy_catch from throw.[ch] instead.
  3602. ** Deprecated function: scm_strhash
  3603. Use scm_string_hash instead.
  3604. ** Deprecated function: scm_vector_set_length_x
  3605. Instead, create a fresh vector of the desired size and copy the contents.
  3606. ** scm_gensym has changed prototype
  3607. scm_gensym now only takes one argument.
  3608. ** Deprecated type tags: scm_tc7_ssymbol, scm_tc7_msymbol, scm_tcs_symbols,
  3609. scm_tc7_lvector
  3610. There is now only a single symbol type scm_tc7_symbol.
  3611. The tag scm_tc7_lvector was not used anyway.
  3612. ** Deprecated function: scm_make_smob_type_mfpe, scm_set_smob_mfpe.
  3613. Use scm_make_smob_type and scm_set_smob_XXX instead.
  3614. ** New function scm_set_smob_apply.
  3615. This can be used to set an apply function to a smob type.
  3616. ** Deprecated function: scm_strprint_obj
  3617. Use scm_object_to_string instead.
  3618. ** Deprecated function: scm_wta
  3619. Use scm_wrong_type_arg, or another appropriate error signalling function
  3620. instead.
  3621. ** Explicit support for obarrays has been deprecated.
  3622. Use `scm_str2symbol' and the generic hashtable functions instead.
  3623. ** The concept of `vcells' has been deprecated.
  3624. The data type `variable' is now used exclusively. `Vcells' have been
  3625. a low-level concept so you are likely not affected by this change.
  3626. *** Deprecated functions: scm_sym2vcell, scm_sysintern,
  3627. scm_sysintern0, scm_symbol_value0, scm_intern, scm_intern0.
  3628. Use scm_c_define or scm_c_lookup instead, as appropriate.
  3629. *** New functions: scm_c_module_lookup, scm_c_lookup,
  3630. scm_c_module_define, scm_c_define, scm_module_lookup, scm_lookup,
  3631. scm_module_define, scm_define.
  3632. These functions work with variables instead of with vcells.
  3633. ** New functions for creating and defining `subr's and `gsubr's.
  3634. The new functions more clearly distinguish between creating a subr (or
  3635. gsubr) object and adding it to the current module.
  3636. These new functions are available: scm_c_make_subr, scm_c_define_subr,
  3637. scm_c_make_subr_with_generic, scm_c_define_subr_with_generic,
  3638. scm_c_make_gsubr, scm_c_define_gsubr, scm_c_make_gsubr_with_generic,
  3639. scm_c_define_gsubr_with_generic.
  3640. ** Deprecated functions: scm_make_subr, scm_make_subr_opt,
  3641. scm_make_subr_with_generic, scm_make_gsubr,
  3642. scm_make_gsubr_with_generic.
  3643. Use the new ones from above instead.
  3644. ** C interface to the module system has changed.
  3645. While we suggest that you avoid as many explicit module system
  3646. operations from C as possible for the time being, the C interface has
  3647. been made more similar to the high-level Scheme module system.
  3648. *** New functions: scm_c_define_module, scm_c_use_module,
  3649. scm_c_export, scm_c_resolve_module.
  3650. They mostly work like their Scheme namesakes. scm_c_define_module
  3651. takes a function that is called a context where the new module is
  3652. current.
  3653. *** Deprecated functions: scm_the_root_module, scm_make_module,
  3654. scm_ensure_user_module, scm_load_scheme_module.
  3655. Use the new functions instead.
  3656. ** Renamed function: scm_internal_with_fluids becomes
  3657. scm_c_with_fluids.
  3658. scm_internal_with_fluids is available as a deprecated function.
  3659. ** New function: scm_c_with_fluid.
  3660. Just like scm_c_with_fluids, but takes one fluid and one value instead
  3661. of lists of same.
  3662. ** Deprecated typedefs: long_long, ulong_long.
  3663. They are of questionable utility and they pollute the global
  3664. namespace.
  3665. ** Deprecated typedef: scm_sizet
  3666. It is of questionable utility now that Guile requires ANSI C, and is
  3667. oddly named.
  3668. ** Deprecated typedefs: scm_port_rw_active, scm_port,
  3669. scm_ptob_descriptor, scm_debug_info, scm_debug_frame, scm_fport,
  3670. scm_option, scm_rstate, scm_rng, scm_array, scm_array_dim.
  3671. Made more compliant with the naming policy by adding a _t at the end.
  3672. ** Deprecated functions: scm_mkbig, scm_big2num, scm_adjbig,
  3673. scm_normbig, scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl
  3674. With the exception of the mysterious scm_2ulong2big, they are still
  3675. available under new names (scm_i_mkbig etc). These functions are not
  3676. intended to be used in user code. You should avoid dealing with
  3677. bignums directly, and should deal with numbers in general (which can
  3678. be bignums).
  3679. ** Change in behavior: scm_num2long, scm_num2ulong
  3680. The scm_num2[u]long functions don't any longer accept an inexact
  3681. argument. This change in behavior is motivated by concordance with
  3682. R5RS: It is more common that a primitive doesn't want to accept an
  3683. inexact for an exact.
  3684. ** New functions: scm_short2num, scm_ushort2num, scm_int2num,
  3685. scm_uint2num, scm_size2num, scm_ptrdiff2num, scm_num2short,
  3686. scm_num2ushort, scm_num2int, scm_num2uint, scm_num2ptrdiff,
  3687. scm_num2size.
  3688. These are conversion functions between the various ANSI C integral
  3689. types and Scheme numbers. NOTE: The scm_num2xxx functions don't
  3690. accept an inexact argument.
  3691. ** New functions: scm_float2num, scm_double2num,
  3692. scm_num2float, scm_num2double.
  3693. These are conversion functions between the two ANSI C float types and
  3694. Scheme numbers.
  3695. ** New number validation macros:
  3696. SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,INT,UINT}[_DEF]
  3697. See above.
  3698. ** New functions: scm_gc_protect_object, scm_gc_unprotect_object
  3699. These are just nicer-named old scm_protect_object and
  3700. scm_unprotect_object.
  3701. ** Deprecated functions: scm_protect_object, scm_unprotect_object
  3702. ** New functions: scm_gc_[un]register_root, scm_gc_[un]register_roots
  3703. These functions can be used to register pointers to locations that
  3704. hold SCM values.
  3705. ** Deprecated function: scm_create_hook.
  3706. Its sins are: misleading name, non-modularity and lack of general
  3707. usefulness.
  3708. Changes since Guile 1.3.4:
  3709. * Changes to the distribution
  3710. ** Trees from nightly snapshots and CVS now require you to run autogen.sh.
  3711. We've changed the way we handle generated files in the Guile source
  3712. repository. As a result, the procedure for building trees obtained
  3713. from the nightly FTP snapshots or via CVS has changed:
  3714. - You must have appropriate versions of autoconf, automake, and
  3715. libtool installed on your system. See README for info on how to
  3716. obtain these programs.
  3717. - Before configuring the tree, you must first run the script
  3718. `autogen.sh' at the top of the source tree.
  3719. The Guile repository used to contain not only source files, written by
  3720. humans, but also some generated files, like configure scripts and
  3721. Makefile.in files. Even though the contents of these files could be
  3722. derived mechanically from other files present, we thought it would
  3723. make the tree easier to build if we checked them into CVS.
  3724. However, this approach means that minor differences between
  3725. developer's installed tools and habits affected the whole team.
  3726. So we have removed the generated files from the repository, and
  3727. added the autogen.sh script, which will reconstruct them
  3728. appropriately.
  3729. ** configure now has experimental options to remove support for certain
  3730. features:
  3731. --disable-arrays omit array and uniform array support
  3732. --disable-posix omit posix interfaces
  3733. --disable-networking omit networking interfaces
  3734. --disable-regex omit regular expression interfaces
  3735. These are likely to become separate modules some day.
  3736. ** New configure option --enable-debug-freelist
  3737. This enables a debugging version of SCM_NEWCELL(), and also registers
  3738. an extra primitive, the setter `gc-set-debug-check-freelist!'.
  3739. Configure with the --enable-debug-freelist option to enable
  3740. the gc-set-debug-check-freelist! primitive, and then use:
  3741. (gc-set-debug-check-freelist! #t) # turn on checking of the freelist
  3742. (gc-set-debug-check-freelist! #f) # turn off checking
  3743. Checking of the freelist forces a traversal of the freelist and
  3744. a garbage collection before each allocation of a cell. This can
  3745. slow down the interpreter dramatically, so the setter should be used to
  3746. turn on this extra processing only when necessary.
  3747. ** New configure option --enable-debug-malloc
  3748. Include code for debugging of calls to scm_must_malloc/realloc/free.
  3749. Checks that
  3750. 1. objects freed by scm_must_free has been mallocated by scm_must_malloc
  3751. 2. objects reallocated by scm_must_realloc has been allocated by
  3752. scm_must_malloc
  3753. 3. reallocated objects are reallocated with the same what string
  3754. But, most importantly, it records the number of allocated objects of
  3755. each kind. This is useful when searching for memory leaks.
  3756. A Guile compiled with this option provides the primitive
  3757. `malloc-stats' which returns an alist with pairs of kind and the
  3758. number of objects of that kind.
  3759. ** All includes are now referenced relative to the root directory
  3760. Since some users have had problems with mixups between Guile and
  3761. system headers, we have decided to always refer to Guile headers via
  3762. their parent directories. This essentially creates a "private name
  3763. space" for Guile headers. This means that the compiler only is given
  3764. -I options for the root build and root source directory.
  3765. ** Header files kw.h and genio.h have been removed.
  3766. ** The module (ice-9 getopt-gnu-style) has been removed.
  3767. ** New module (ice-9 documentation)
  3768. Implements the interface to documentation strings associated with
  3769. objects.
  3770. ** New module (ice-9 time)
  3771. Provides a macro `time', which displays execution time of a given form.
  3772. ** New module (ice-9 history)
  3773. Loading this module enables value history in the repl.
  3774. * Changes to the stand-alone interpreter
  3775. ** New command line option --debug
  3776. Start Guile with debugging evaluator and backtraces enabled.
  3777. This is useful when debugging your .guile init file or scripts.
  3778. ** New help facility
  3779. Usage: (help NAME) gives documentation about objects named NAME (a symbol)
  3780. (help REGEXP) ditto for objects with names matching REGEXP (a string)
  3781. (help 'NAME) gives documentation for NAME, even if it is not an object
  3782. (help ,EXPR) gives documentation for object returned by EXPR
  3783. (help (my module)) gives module commentary for `(my module)'
  3784. (help) gives this text
  3785. `help' searches among bindings exported from loaded modules, while
  3786. `apropos' searches among bindings visible from the "current" module.
  3787. Examples: (help help)
  3788. (help cons)
  3789. (help "output-string")
  3790. ** `help' and `apropos' now prints full module names
  3791. ** Dynamic linking now uses libltdl from the libtool package.
  3792. The old system dependent code for doing dynamic linking has been
  3793. replaced with calls to the libltdl functions which do all the hairy
  3794. details for us.
  3795. The major improvement is that you can now directly pass libtool
  3796. library names like "libfoo.la" to `dynamic-link' and `dynamic-link'
  3797. will be able to do the best shared library job you can get, via
  3798. libltdl.
  3799. The way dynamic libraries are found has changed and is not really
  3800. portable across platforms, probably. It is therefore recommended to
  3801. use absolute filenames when possible.
  3802. If you pass a filename without an extension to `dynamic-link', it will
  3803. try a few appropriate ones. Thus, the most platform ignorant way is
  3804. to specify a name like "libfoo", without any directories and
  3805. extensions.
  3806. ** Guile COOP threads are now compatible with LinuxThreads
  3807. Previously, COOP threading wasn't possible in applications linked with
  3808. Linux POSIX threads due to their use of the stack pointer to find the
  3809. thread context. This has now been fixed with a workaround which uses
  3810. the pthreads to allocate the stack.
  3811. ** New primitives: `pkgdata-dir', `site-dir', `library-dir'
  3812. ** Positions of erring expression in scripts
  3813. With version 1.3.4, the location of the erring expression in Guile
  3814. scipts is no longer automatically reported. (This should have been
  3815. documented before the 1.3.4 release.)
  3816. You can get this information by enabling recording of positions of
  3817. source expressions and running the debugging evaluator. Put this at
  3818. the top of your script (or in your "site" file):
  3819. (read-enable 'positions)
  3820. (debug-enable 'debug)
  3821. ** Backtraces in scripts
  3822. It is now possible to get backtraces in scripts.
  3823. Put
  3824. (debug-enable 'debug 'backtrace)
  3825. at the top of the script.
  3826. (The first options enables the debugging evaluator.
  3827. The second enables backtraces.)
  3828. ** Part of module system symbol lookup now implemented in C
  3829. The eval closure of most modules is now implemented in C. Since this
  3830. was one of the bottlenecks for loading speed, Guile now loads code
  3831. substantially faster than before.
  3832. ** Attempting to get the value of an unbound variable now produces
  3833. an exception with a key of 'unbound-variable instead of 'misc-error.
  3834. ** The initial default output port is now unbuffered if it's using a
  3835. tty device. Previously in this situation it was line-buffered.
  3836. ** New hook: after-gc-hook
  3837. after-gc-hook takes over the role of gc-thunk. This hook is run at
  3838. the first SCM_TICK after a GC. (Thus, the code is run at the same
  3839. point during evaluation as signal handlers.)
  3840. Note that this hook should be used only for diagnostic and debugging
  3841. purposes. It is not certain that it will continue to be well-defined
  3842. when this hook is run in the future.
  3843. C programmers: Note the new C level hooks scm_before_gc_c_hook,
  3844. scm_before_sweep_c_hook, scm_after_gc_c_hook.
  3845. ** Improvements to garbage collector
  3846. Guile 1.4 has a new policy for triggering heap allocation and
  3847. determining the sizes of heap segments. It fixes a number of problems
  3848. in the old GC.
  3849. 1. The new policy can handle two separate pools of cells
  3850. (2-word/4-word) better. (The old policy would run wild, allocating
  3851. more and more memory for certain programs.)
  3852. 2. The old code would sometimes allocate far too much heap so that the
  3853. Guile process became gigantic. The new code avoids this.
  3854. 3. The old code would sometimes allocate too little so that few cells
  3855. were freed at GC so that, in turn, too much time was spent in GC.
  3856. 4. The old code would often trigger heap allocation several times in a
  3857. row. (The new scheme predicts how large the segments needs to be
  3858. in order not to need further allocation.)
  3859. All in all, the new GC policy will make larger applications more
  3860. efficient.
  3861. The new GC scheme also is prepared for POSIX threading. Threads can
  3862. allocate private pools of cells ("clusters") with just a single
  3863. function call. Allocation of single cells from such a cluster can
  3864. then proceed without any need of inter-thread synchronization.
  3865. ** New environment variables controlling GC parameters
  3866. GUILE_MAX_SEGMENT_SIZE Maximal segment size
  3867. (default = 2097000)
  3868. Allocation of 2-word cell heaps:
  3869. GUILE_INIT_SEGMENT_SIZE_1 Size of initial heap segment in bytes
  3870. (default = 360000)
  3871. GUILE_MIN_YIELD_1 Minimum number of freed cells at each
  3872. GC in percent of total heap size
  3873. (default = 40)
  3874. Allocation of 4-word cell heaps
  3875. (used for real numbers and misc other objects):
  3876. GUILE_INIT_SEGMENT_SIZE_2, GUILE_MIN_YIELD_2
  3877. (See entry "Way for application to customize GC parameters" under
  3878. section "Changes to the scm_ interface" below.)
  3879. ** Guile now implements reals using 4-word cells
  3880. This speeds up computation with reals. (They were earlier allocated
  3881. with `malloc'.) There is still some room for optimizations, however.
  3882. ** Some further steps toward POSIX thread support have been taken
  3883. *** Guile's critical sections (SCM_DEFER/ALLOW_INTS)
  3884. don't have much effect any longer, and many of them will be removed in
  3885. next release.
  3886. *** Signals
  3887. are only handled at the top of the evaluator loop, immediately after
  3888. I/O, and in scm_equalp.
  3889. *** The GC can allocate thread private pools of pairs.
  3890. * Changes to Scheme functions and syntax
  3891. ** close-input-port and close-output-port are now R5RS
  3892. These procedures have been turned into primitives and have R5RS behaviour.
  3893. ** New procedure: simple-format PORT MESSAGE ARG1 ...
  3894. (ice-9 boot) makes `format' an alias for `simple-format' until possibly
  3895. extended by the more sophisticated version in (ice-9 format)
  3896. (simple-format port message . args)
  3897. Write MESSAGE to DESTINATION, defaulting to `current-output-port'.
  3898. MESSAGE can contain ~A (was %s) and ~S (was %S) escapes. When printed,
  3899. the escapes are replaced with corresponding members of ARGS:
  3900. ~A formats using `display' and ~S formats using `write'.
  3901. If DESTINATION is #t, then use the `current-output-port',
  3902. if DESTINATION is #f, then return a string containing the formatted text.
  3903. Does not add a trailing newline."
  3904. ** string-ref: the second argument is no longer optional.
  3905. ** string, list->string: no longer accept strings in their arguments,
  3906. only characters, for compatibility with R5RS.
  3907. ** New procedure: port-closed? PORT
  3908. Returns #t if PORT is closed or #f if it is open.
  3909. ** Deprecated: list*
  3910. The list* functionality is now provided by cons* (SRFI-1 compliant)
  3911. ** New procedure: cons* ARG1 ARG2 ... ARGn
  3912. Like `list', but the last arg provides the tail of the constructed list,
  3913. returning (cons ARG1 (cons ARG2 (cons ... ARGn))).
  3914. Requires at least one argument. If given one argument, that argument
  3915. is returned as result.
  3916. This function is called `list*' in some other Schemes and in Common LISP.
  3917. ** Removed deprecated: serial-map, serial-array-copy!, serial-array-map!
  3918. ** New procedure: object-documentation OBJECT
  3919. Returns the documentation string associated with OBJECT. The
  3920. procedure uses a caching mechanism so that subsequent lookups are
  3921. faster.
  3922. Exported by (ice-9 documentation).
  3923. ** module-name now returns full names of modules
  3924. Previously, only the last part of the name was returned (`session' for
  3925. `(ice-9 session)'). Ex: `(ice-9 session)'.
  3926. * Changes to the gh_ interface
  3927. ** Deprecated: gh_int2scmb
  3928. Use gh_bool2scm instead.
  3929. * Changes to the scm_ interface
  3930. ** Guile primitives now carry docstrings!
  3931. Thanks to Greg Badros!
  3932. ** Guile primitives are defined in a new way: SCM_DEFINE/SCM_DEFINE1/SCM_PROC
  3933. Now Guile primitives are defined using the SCM_DEFINE/SCM_DEFINE1/SCM_PROC
  3934. macros and must contain a docstring that is extracted into foo.doc using a new
  3935. guile-doc-snarf script (that uses guile-doc-snarf.awk).
  3936. However, a major overhaul of these macros is scheduled for the next release of
  3937. guile.
  3938. ** Guile primitives use a new technique for validation of arguments
  3939. SCM_VALIDATE_* macros are defined to ease the redundancy and improve
  3940. the readability of argument checking.
  3941. ** All (nearly?) K&R prototypes for functions replaced with ANSI C equivalents.
  3942. ** New macros: SCM_PACK, SCM_UNPACK
  3943. Compose/decompose an SCM value.
  3944. The SCM type is now treated as an abstract data type and may be defined as a
  3945. long, a void* or as a struct, depending on the architecture and compile time
  3946. options. This makes it easier to find several types of bugs, for example when
  3947. SCM values are treated as integers without conversion. Values of the SCM type
  3948. should be treated as "atomic" values. These macros are used when
  3949. composing/decomposing an SCM value, either because you want to access
  3950. individual bits, or because you want to treat it as an integer value.
  3951. E.g., in order to set bit 7 in an SCM value x, use the expression
  3952. SCM_PACK (SCM_UNPACK (x) | 0x80)
  3953. ** The name property of hooks is deprecated.
  3954. Thus, the use of SCM_HOOK_NAME and scm_make_hook_with_name is deprecated.
  3955. You can emulate this feature by using object properties.
  3956. ** Deprecated macros: SCM_INPORTP, SCM_OUTPORTP, SCM_CRDY, SCM_ICHRP,
  3957. SCM_ICHR, SCM_MAKICHR, SCM_SETJMPBUF, SCM_NSTRINGP, SCM_NRWSTRINGP,
  3958. SCM_NVECTORP
  3959. These macros will be removed in a future release of Guile.
  3960. ** The following types, functions and macros from numbers.h are deprecated:
  3961. scm_dblproc, SCM_UNEGFIXABLE, SCM_FLOBUFLEN, SCM_INEXP, SCM_CPLXP, SCM_REAL,
  3962. SCM_IMAG, SCM_REALPART, scm_makdbl, SCM_SINGP, SCM_NUM2DBL, SCM_NO_BIGDIG
  3963. ** Port internals: the rw_random variable in the scm_port structure
  3964. must be set to non-zero in any random access port. In recent Guile
  3965. releases it was only set for bidirectional random-access ports.
  3966. ** Port internals: the seek ptob procedure is now responsible for
  3967. resetting the buffers if required. The change was made so that in the
  3968. special case of reading the current position (i.e., seek p 0 SEEK_CUR)
  3969. the fport and strport ptobs can avoid resetting the buffers,
  3970. in particular to avoid discarding unread chars. An existing port
  3971. type can be fixed by adding something like the following to the
  3972. beginning of the ptob seek procedure:
  3973. if (pt->rw_active == SCM_PORT_READ)
  3974. scm_end_input (object);
  3975. else if (pt->rw_active == SCM_PORT_WRITE)
  3976. ptob->flush (object);
  3977. although to actually avoid resetting the buffers and discard unread
  3978. chars requires further hacking that depends on the characteristics
  3979. of the ptob.
  3980. ** Deprecated functions: scm_fseek, scm_tag
  3981. These functions are no longer used and will be removed in a future version.
  3982. ** The scm_sysmissing procedure is no longer used in libguile.
  3983. Unless it turns out to be unexpectedly useful to somebody, it will be
  3984. removed in a future version.
  3985. ** The format of error message strings has changed
  3986. The two C procedures: scm_display_error and scm_error, as well as the
  3987. primitive `scm-error', now use scm_simple_format to do their work.
  3988. This means that the message strings of all code must be updated to use
  3989. ~A where %s was used before, and ~S where %S was used before.
  3990. During the period when there still are a lot of old Guiles out there,
  3991. you might want to support both old and new versions of Guile.
  3992. There are basically two methods to achieve this. Both methods use
  3993. autoconf. Put
  3994. AC_CHECK_FUNCS(scm_simple_format)
  3995. in your configure.in.
  3996. Method 1: Use the string concatenation features of ANSI C's
  3997. preprocessor.
  3998. In C:
  3999. #ifdef HAVE_SCM_SIMPLE_FORMAT
  4000. #define FMT_S "~S"
  4001. #else
  4002. #define FMT_S "%S"
  4003. #endif
  4004. Then represent each of your error messages using a preprocessor macro:
  4005. #define E_SPIDER_ERROR "There's a spider in your " ## FMT_S ## "!!!"
  4006. In Scheme:
  4007. (define fmt-s (if (defined? 'simple-format) "~S" "%S"))
  4008. (define make-message string-append)
  4009. (define e-spider-error (make-message "There's a spider in your " fmt-s "!!!"))
  4010. Method 2: Use the oldfmt function found in doc/oldfmt.c.
  4011. In C:
  4012. scm_misc_error ("picnic", scm_c_oldfmt0 ("There's a spider in your ~S!!!"),
  4013. ...);
  4014. In Scheme:
  4015. (scm-error 'misc-error "picnic" (oldfmt "There's a spider in your ~S!!!")
  4016. ...)
  4017. ** Deprecated: coop_mutex_init, coop_condition_variable_init
  4018. Don't use the functions coop_mutex_init and
  4019. coop_condition_variable_init. They will change.
  4020. Use scm_mutex_init and scm_cond_init instead.
  4021. ** New function: int scm_cond_timedwait (scm_cond_t *COND, scm_mutex_t *MUTEX, const struct timespec *ABSTIME)
  4022. `scm_cond_timedwait' atomically unlocks MUTEX and waits on
  4023. COND, as `scm_cond_wait' does, but it also bounds the duration
  4024. of the wait. If COND has not been signaled before time ABSTIME,
  4025. the mutex MUTEX is re-acquired and `scm_cond_timedwait'
  4026. returns the error code `ETIMEDOUT'.
  4027. The ABSTIME parameter specifies an absolute time, with the same
  4028. origin as `time' and `gettimeofday': an ABSTIME of 0 corresponds
  4029. to 00:00:00 GMT, January 1, 1970.
  4030. ** New function: scm_cond_broadcast (scm_cond_t *COND)
  4031. `scm_cond_broadcast' restarts all the threads that are waiting
  4032. on the condition variable COND. Nothing happens if no threads are
  4033. waiting on COND.
  4034. ** New function: scm_key_create (scm_key_t *KEY, void (*destr_function) (void *))
  4035. `scm_key_create' allocates a new TSD key. The key is stored in
  4036. the location pointed to by KEY. There is no limit on the number
  4037. of keys allocated at a given time. The value initially associated
  4038. with the returned key is `NULL' in all currently executing threads.
  4039. The DESTR_FUNCTION argument, if not `NULL', specifies a destructor
  4040. function associated with the key. When a thread terminates,
  4041. DESTR_FUNCTION is called on the value associated with the key in
  4042. that thread. The DESTR_FUNCTION is not called if a key is deleted
  4043. with `scm_key_delete' or a value is changed with
  4044. `scm_setspecific'. The order in which destructor functions are
  4045. called at thread termination time is unspecified.
  4046. Destructors are not yet implemented.
  4047. ** New function: scm_setspecific (scm_key_t KEY, const void *POINTER)
  4048. `scm_setspecific' changes the value associated with KEY in the
  4049. calling thread, storing the given POINTER instead.
  4050. ** New function: scm_getspecific (scm_key_t KEY)
  4051. `scm_getspecific' returns the value currently associated with
  4052. KEY in the calling thread.
  4053. ** New function: scm_key_delete (scm_key_t KEY)
  4054. `scm_key_delete' deallocates a TSD key. It does not check
  4055. whether non-`NULL' values are associated with that key in the
  4056. currently executing threads, nor call the destructor function
  4057. associated with the key.
  4058. ** New function: scm_c_hook_init (scm_c_hook_t *HOOK, void *HOOK_DATA, scm_c_hook_type_t TYPE)
  4059. Initialize a C level hook HOOK with associated HOOK_DATA and type
  4060. TYPE. (See scm_c_hook_run ().)
  4061. ** New function: scm_c_hook_add (scm_c_hook_t *HOOK, scm_c_hook_function_t FUNC, void *FUNC_DATA, int APPENDP)
  4062. Add hook function FUNC with associated FUNC_DATA to HOOK. If APPENDP
  4063. is true, add it last, otherwise first. The same FUNC can be added
  4064. multiple times if FUNC_DATA differ and vice versa.
  4065. ** New function: scm_c_hook_remove (scm_c_hook_t *HOOK, scm_c_hook_function_t FUNC, void *FUNC_DATA)
  4066. Remove hook function FUNC with associated FUNC_DATA from HOOK. A
  4067. function is only removed if both FUNC and FUNC_DATA matches.
  4068. ** New function: void *scm_c_hook_run (scm_c_hook_t *HOOK, void *DATA)
  4069. Run hook HOOK passing DATA to the hook functions.
  4070. If TYPE is SCM_C_HOOK_NORMAL, all hook functions are run. The value
  4071. returned is undefined.
  4072. If TYPE is SCM_C_HOOK_OR, hook functions are run until a function
  4073. returns a non-NULL value. This value is returned as the result of
  4074. scm_c_hook_run. If all functions return NULL, NULL is returned.
  4075. If TYPE is SCM_C_HOOK_AND, hook functions are run until a function
  4076. returns a NULL value, and NULL is returned. If all functions returns
  4077. a non-NULL value, the last value is returned.
  4078. ** New C level GC hooks
  4079. Five new C level hooks has been added to the garbage collector.
  4080. scm_before_gc_c_hook
  4081. scm_after_gc_c_hook
  4082. are run before locking and after unlocking the heap. The system is
  4083. thus in a mode where evaluation can take place. (Except that
  4084. scm_before_gc_c_hook must not allocate new cells.)
  4085. scm_before_mark_c_hook
  4086. scm_before_sweep_c_hook
  4087. scm_after_sweep_c_hook
  4088. are run when the heap is locked. These are intended for extension of
  4089. the GC in a modular fashion. Examples are the weaks and guardians
  4090. modules.
  4091. ** Way for application to customize GC parameters
  4092. The application can set up other default values for the GC heap
  4093. allocation parameters
  4094. GUILE_INIT_HEAP_SIZE_1, GUILE_MIN_YIELD_1,
  4095. GUILE_INIT_HEAP_SIZE_2, GUILE_MIN_YIELD_2,
  4096. GUILE_MAX_SEGMENT_SIZE,
  4097. by setting
  4098. scm_default_init_heap_size_1, scm_default_min_yield_1,
  4099. scm_default_init_heap_size_2, scm_default_min_yield_2,
  4100. scm_default_max_segment_size
  4101. respectively before callong scm_boot_guile.
  4102. (See entry "New environment variables ..." in section
  4103. "Changes to the stand-alone interpreter" above.)
  4104. ** scm_protect_object/scm_unprotect_object now nest
  4105. This means that you can call scm_protect_object multiple times on an
  4106. object and count on the object being protected until
  4107. scm_unprotect_object has been call the same number of times.
  4108. The functions also have better time complexity.
  4109. Still, it is usually possible to structure the application in a way
  4110. that you don't need to use these functions. For example, if you use a
  4111. protected standard Guile list to keep track of live objects rather
  4112. than some custom data type, objects will die a natural death when they
  4113. are no longer needed.
  4114. ** Deprecated type tags: scm_tc16_flo, scm_tc_flo, scm_tc_dblr, scm_tc_dblc
  4115. Guile does not provide the float representation for inexact real numbers any
  4116. more. Now, only doubles are used to represent inexact real numbers. Further,
  4117. the tag names scm_tc_dblr and scm_tc_dblc have been changed to scm_tc16_real
  4118. and scm_tc16_complex, respectively.
  4119. ** Removed deprecated type scm_smobfuns
  4120. ** Removed deprecated function scm_newsmob
  4121. ** Warning: scm_make_smob_type_mfpe might become deprecated in a future release
  4122. There is an ongoing discussion among the developers whether to
  4123. deprecate `scm_make_smob_type_mfpe' or not. Please use the current
  4124. standard interface (scm_make_smob_type, scm_set_smob_XXX) in new code
  4125. until this issue has been settled.
  4126. ** Removed deprecated type tag scm_tc16_kw
  4127. ** Added type tag scm_tc16_keyword
  4128. (This was introduced already in release 1.3.4 but was not documented
  4129. until now.)
  4130. ** gdb_print now prints "*** Guile not initialized ***" until Guile initialized
  4131. * Changes to system call interfaces:
  4132. ** The "select" procedure now tests port buffers for the ability to
  4133. provide input or accept output. Previously only the underlying file
  4134. descriptors were checked.
  4135. ** New variable PIPE_BUF: the maximum number of bytes that can be
  4136. atomically written to a pipe.
  4137. ** If a facility is not available on the system when Guile is
  4138. compiled, the corresponding primitive procedure will not be defined.
  4139. Previously it would have been defined but would throw a system-error
  4140. exception if called. Exception handlers which catch this case may
  4141. need minor modification: an error will be thrown with key
  4142. 'unbound-variable instead of 'system-error. Alternatively it's
  4143. now possible to use `defined?' to check whether the facility is
  4144. available.
  4145. ** Procedures which depend on the timezone should now give the correct
  4146. result on systems which cache the TZ environment variable, even if TZ
  4147. is changed without calling tzset.
  4148. * Changes to the networking interfaces:
  4149. ** New functions: htons, ntohs, htonl, ntohl: for converting short and
  4150. long integers between network and host format. For now, it's not
  4151. particularly convenient to do this kind of thing, but consider:
  4152. (define write-network-long
  4153. (lambda (value port)
  4154. (let ((v (make-uniform-vector 1 1 0)))
  4155. (uniform-vector-set! v 0 (htonl value))
  4156. (uniform-vector-write v port))))
  4157. (define read-network-long
  4158. (lambda (port)
  4159. (let ((v (make-uniform-vector 1 1 0)))
  4160. (uniform-vector-read! v port)
  4161. (ntohl (uniform-vector-ref v 0)))))
  4162. ** If inet-aton fails, it now throws an error with key 'misc-error
  4163. instead of 'system-error, since errno is not relevant.
  4164. ** Certain gethostbyname/gethostbyaddr failures now throw errors with
  4165. specific keys instead of 'system-error. The latter is inappropriate
  4166. since errno will not have been set. The keys are:
  4167. 'host-not-found, 'try-again, 'no-recovery and 'no-data.
  4168. ** sethostent, setnetent, setprotoent, setservent: now take an
  4169. optional argument STAYOPEN, which specifies whether the database
  4170. remains open after a database entry is accessed randomly (e.g., using
  4171. gethostbyname for the hosts database.) The default is #f. Previously
  4172. #t was always used.
  4173. Changes since Guile 1.3.2:
  4174. * Changes to the stand-alone interpreter
  4175. ** Debugger
  4176. An initial version of the Guile debugger written by Chris Hanson has
  4177. been added. The debugger is still under development but is included
  4178. in the distribution anyway since it is already quite useful.
  4179. Type
  4180. (debug)
  4181. after an error to enter the debugger. Type `help' inside the debugger
  4182. for a description of available commands.
  4183. If you prefer to have stack frames numbered and printed in
  4184. anti-chronological order and prefer up in the stack to be down on the
  4185. screen as is the case in gdb, you can put
  4186. (debug-enable 'backwards)
  4187. in your .guile startup file. (However, this means that Guile can't
  4188. use indentation to indicate stack level.)
  4189. The debugger is autoloaded into Guile at the first use.
  4190. ** Further enhancements to backtraces
  4191. There is a new debug option `width' which controls the maximum width
  4192. on the screen of printed stack frames. Fancy printing parameters
  4193. ("level" and "length" as in Common LISP) are adaptively adjusted for
  4194. each stack frame to give maximum information while still fitting
  4195. within the bounds. If the stack frame can't be made to fit by
  4196. adjusting parameters, it is simply cut off at the end. This is marked
  4197. with a `$'.
  4198. ** Some modules are now only loaded when the repl is started
  4199. The modules (ice-9 debug), (ice-9 session), (ice-9 threads) and (ice-9
  4200. regex) are now loaded into (guile-user) only if the repl has been
  4201. started. The effect is that the startup time for scripts has been
  4202. reduced to 30% of what it was previously.
  4203. Correctly written scripts load the modules they require at the top of
  4204. the file and should not be affected by this change.
  4205. ** Hooks are now represented as smobs
  4206. * Changes to Scheme functions and syntax
  4207. ** Readline support has changed again.
  4208. The old (readline-activator) module is gone. Use (ice-9 readline)
  4209. instead, which now contains all readline functionality. So the code
  4210. to activate readline is now
  4211. (use-modules (ice-9 readline))
  4212. (activate-readline)
  4213. This should work at any time, including from the guile prompt.
  4214. To avoid confusion about the terms of Guile's license, please only
  4215. enable readline for your personal use; please don't make it the
  4216. default for others. Here is why we make this rather odd-sounding
  4217. request:
  4218. Guile is normally licensed under a weakened form of the GNU General
  4219. Public License, which allows you to link code with Guile without
  4220. placing that code under the GPL. This exception is important to some
  4221. people.
  4222. However, since readline is distributed under the GNU General Public
  4223. License, when you link Guile with readline, either statically or
  4224. dynamically, you effectively change Guile's license to the strict GPL.
  4225. Whenever you link any strictly GPL'd code into Guile, uses of Guile
  4226. which are normally permitted become forbidden. This is a rather
  4227. non-obvious consequence of the licensing terms.
  4228. So, to make sure things remain clear, please let people choose for
  4229. themselves whether to link GPL'd libraries like readline with Guile.
  4230. ** regexp-substitute/global has changed slightly, but incompatibly.
  4231. If you include a function in the item list, the string of the match
  4232. object it receives is the same string passed to
  4233. regexp-substitute/global, not some suffix of that string.
  4234. Correspondingly, the match's positions are relative to the entire
  4235. string, not the suffix.
  4236. If the regexp can match the empty string, the way matches are chosen
  4237. from the string has changed. regexp-substitute/global recognizes the
  4238. same set of matches that list-matches does; see below.
  4239. ** New function: list-matches REGEXP STRING [FLAGS]
  4240. Return a list of match objects, one for every non-overlapping, maximal
  4241. match of REGEXP in STRING. The matches appear in left-to-right order.
  4242. list-matches only reports matches of the empty string if there are no
  4243. other matches which begin on, end at, or include the empty match's
  4244. position.
  4245. If present, FLAGS is passed as the FLAGS argument to regexp-exec.
  4246. ** New function: fold-matches REGEXP STRING INIT PROC [FLAGS]
  4247. For each match of REGEXP in STRING, apply PROC to the match object,
  4248. and the last value PROC returned, or INIT for the first call. Return
  4249. the last value returned by PROC. We apply PROC to the matches as they
  4250. appear from left to right.
  4251. This function recognizes matches according to the same criteria as
  4252. list-matches.
  4253. Thus, you could define list-matches like this:
  4254. (define (list-matches regexp string . flags)
  4255. (reverse! (apply fold-matches regexp string '() cons flags)))
  4256. If present, FLAGS is passed as the FLAGS argument to regexp-exec.
  4257. ** Hooks
  4258. *** New function: hook? OBJ
  4259. Return #t if OBJ is a hook, otherwise #f.
  4260. *** New function: make-hook-with-name NAME [ARITY]
  4261. Return a hook with name NAME and arity ARITY. The default value for
  4262. ARITY is 0. The only effect of NAME is that it will appear when the
  4263. hook object is printed to ease debugging.
  4264. *** New function: hook-empty? HOOK
  4265. Return #t if HOOK doesn't contain any procedures, otherwise #f.
  4266. *** New function: hook->list HOOK
  4267. Return a list of the procedures that are called when run-hook is
  4268. applied to HOOK.
  4269. ** `map' signals an error if its argument lists are not all the same length.
  4270. This is the behavior required by R5RS, so this change is really a bug
  4271. fix. But it seems to affect a lot of people's code, so we're
  4272. mentioning it here anyway.
  4273. ** Print-state handling has been made more transparent
  4274. Under certain circumstances, ports are represented as a port with an
  4275. associated print state. Earlier, this pair was represented as a pair
  4276. (see "Some magic has been added to the printer" below). It is now
  4277. indistinguishable (almost; see `get-print-state') from a port on the
  4278. user level.
  4279. *** New function: port-with-print-state OUTPUT-PORT PRINT-STATE
  4280. Return a new port with the associated print state PRINT-STATE.
  4281. *** New function: get-print-state OUTPUT-PORT
  4282. Return the print state associated with this port if it exists,
  4283. otherwise return #f.
  4284. *** New function: directory-stream? OBJECT
  4285. Returns true iff OBJECT is a directory stream --- the sort of object
  4286. returned by `opendir'.
  4287. ** New function: using-readline?
  4288. Return #t if readline is in use in the current repl.
  4289. ** structs will be removed in 1.4
  4290. Structs will be replaced in Guile 1.4. We will merge GOOPS into Guile
  4291. and use GOOPS objects as the fundamental record type.
  4292. * Changes to the scm_ interface
  4293. ** structs will be removed in 1.4
  4294. The entire current struct interface (struct.c, struct.h) will be
  4295. replaced in Guile 1.4. We will merge GOOPS into libguile and use
  4296. GOOPS objects as the fundamental record type.
  4297. ** The internal representation of subr's has changed
  4298. Instead of giving a hint to the subr name, the CAR field of the subr
  4299. now contains an index to a subr entry in scm_subr_table.
  4300. *** New variable: scm_subr_table
  4301. An array of subr entries. A subr entry contains the name, properties
  4302. and documentation associated with the subr. The properties and
  4303. documentation slots are not yet used.
  4304. ** A new scheme for "forwarding" calls to a builtin to a generic function
  4305. It is now possible to extend the functionality of some Guile
  4306. primitives by letting them defer a call to a GOOPS generic function on
  4307. argument mismatch. This means that there is no loss of efficiency in
  4308. normal evaluation.
  4309. Example:
  4310. (use-modules (oop goops)) ; Must be GOOPS version 0.2.
  4311. (define-method + ((x <string>) (y <string>))
  4312. (string-append x y))
  4313. + will still be as efficient as usual in numerical calculations, but
  4314. can also be used for concatenating strings.
  4315. Who will be the first one to extend Guile's numerical tower to
  4316. rationals? :) [OK, there a few other things to fix before this can
  4317. be made in a clean way.]
  4318. *** New snarf macros for defining primitives: SCM_GPROC, SCM_GPROC1
  4319. New macro: SCM_GPROC (CNAME, SNAME, REQ, OPT, VAR, CFUNC, GENERIC)
  4320. New macro: SCM_GPROC1 (CNAME, SNAME, TYPE, CFUNC, GENERIC)
  4321. These do the same job as SCM_PROC and SCM_PROC1, but they also define
  4322. a variable GENERIC which can be used by the dispatch macros below.
  4323. [This is experimental code which may change soon.]
  4324. *** New macros for forwarding control to a generic on arg type error
  4325. New macro: SCM_WTA_DISPATCH_1 (GENERIC, ARG1, POS, SUBR)
  4326. New macro: SCM_WTA_DISPATCH_2 (GENERIC, ARG1, ARG2, POS, SUBR)
  4327. These correspond to the scm_wta function call, and have the same
  4328. behaviour until the user has called the GOOPS primitive
  4329. `enable-primitive-generic!'. After that, these macros will apply the
  4330. generic function GENERIC to the argument(s) instead of calling
  4331. scm_wta.
  4332. [This is experimental code which may change soon.]
  4333. *** New macros for argument testing with generic dispatch
  4334. New macro: SCM_GASSERT1 (COND, GENERIC, ARG1, POS, SUBR)
  4335. New macro: SCM_GASSERT2 (COND, GENERIC, ARG1, ARG2, POS, SUBR)
  4336. These correspond to the SCM_ASSERT macro, but will defer control to
  4337. GENERIC on error after `enable-primitive-generic!' has been called.
  4338. [This is experimental code which may change soon.]
  4339. ** New function: SCM scm_eval_body (SCM body, SCM env)
  4340. Evaluates the body of a special form.
  4341. ** The internal representation of struct's has changed
  4342. Previously, four slots were allocated for the procedure(s) of entities
  4343. and operators. The motivation for this representation had to do with
  4344. the structure of the evaluator, the wish to support tail-recursive
  4345. generic functions, and efficiency. Since the generic function
  4346. dispatch mechanism has changed, there is no longer a need for such an
  4347. expensive representation, and the representation has been simplified.
  4348. This should not make any difference for most users.
  4349. ** GOOPS support has been cleaned up.
  4350. Some code has been moved from eval.c to objects.c and code in both of
  4351. these compilation units has been cleaned up and better structured.
  4352. *** New functions for applying generic functions
  4353. New function: SCM scm_apply_generic (GENERIC, ARGS)
  4354. New function: SCM scm_call_generic_0 (GENERIC)
  4355. New function: SCM scm_call_generic_1 (GENERIC, ARG1)
  4356. New function: SCM scm_call_generic_2 (GENERIC, ARG1, ARG2)
  4357. New function: SCM scm_call_generic_3 (GENERIC, ARG1, ARG2, ARG3)
  4358. ** Deprecated function: scm_make_named_hook
  4359. It is now replaced by:
  4360. ** New function: SCM scm_create_hook (const char *name, int arity)
  4361. Creates a hook in the same way as make-hook above but also
  4362. binds a variable named NAME to it.
  4363. This is the typical way of creating a hook from C code.
  4364. Currently, the variable is created in the "current" module.
  4365. This might change when we get the new module system.
  4366. [The behaviour is identical to scm_make_named_hook.]
  4367. Changes since Guile 1.3:
  4368. * Changes to mailing lists
  4369. ** Some of the Guile mailing lists have moved to sourceware.cygnus.com.
  4370. See the README file to find current addresses for all the Guile
  4371. mailing lists.
  4372. * Changes to the distribution
  4373. ** Readline support is no longer included with Guile by default.
  4374. Based on the different license terms of Guile and Readline, we
  4375. concluded that Guile should not *by default* cause the linking of
  4376. Readline into an application program. Readline support is now offered
  4377. as a separate module, which is linked into an application only when
  4378. you explicitly specify it.
  4379. Although Guile is GNU software, its distribution terms add a special
  4380. exception to the usual GNU General Public License (GPL). Guile's
  4381. license includes a clause that allows you to link Guile with non-free
  4382. programs. We add this exception so as not to put Guile at a
  4383. disadvantage vis-a-vis other extensibility packages that support other
  4384. languages.
  4385. In contrast, the GNU Readline library is distributed under the GNU
  4386. General Public License pure and simple. This means that you may not
  4387. link Readline, even dynamically, into an application unless it is
  4388. distributed under a free software license that is compatible the GPL.
  4389. Because of this difference in distribution terms, an application that
  4390. can use Guile may not be able to use Readline. Now users will be
  4391. explicitly offered two independent decisions about the use of these
  4392. two packages.
  4393. You can activate the readline support by issuing
  4394. (use-modules (readline-activator))
  4395. (activate-readline)
  4396. from your ".guile" file, for example.
  4397. * Changes to the stand-alone interpreter
  4398. ** All builtins now print as primitives.
  4399. Previously builtin procedures not belonging to the fundamental subr
  4400. types printed as #<compiled closure #<primitive-procedure gsubr-apply>>.
  4401. Now, they print as #<primitive-procedure NAME>.
  4402. ** Backtraces slightly more intelligible.
  4403. gsubr-apply and macro transformer application frames no longer appear
  4404. in backtraces.
  4405. * Changes to Scheme functions and syntax
  4406. ** Guile now correctly handles internal defines by rewriting them into
  4407. their equivalent letrec. Previously, internal defines would
  4408. incrementally add to the innermost environment, without checking
  4409. whether the restrictions specified in RnRS were met. This lead to the
  4410. correct behaviour when these restriction actually were met, but didn't
  4411. catch all illegal uses. Such an illegal use could lead to crashes of
  4412. the Guile interpreter or other unwanted results. An example of
  4413. incorrect internal defines that made Guile behave erratically:
  4414. (let ()
  4415. (define a 1)
  4416. (define (b) a)
  4417. (define c (1+ (b)))
  4418. (define d 3)
  4419. (b))
  4420. => 2
  4421. The problem with this example is that the definition of `c' uses the
  4422. value of `b' directly. This confuses the meoization machine of Guile
  4423. so that the second call of `b' (this time in a larger environment that
  4424. also contains bindings for `c' and `d') refers to the binding of `c'
  4425. instead of `a'. You could also make Guile crash with a variation on
  4426. this theme:
  4427. (define (foo flag)
  4428. (define a 1)
  4429. (define (b flag) (if flag a 1))
  4430. (define c (1+ (b flag)))
  4431. (define d 3)
  4432. (b #t))
  4433. (foo #f)
  4434. (foo #t)
  4435. From now on, Guile will issue an `Unbound variable: b' error message
  4436. for both examples.
  4437. ** Hooks
  4438. A hook contains a list of functions which should be called on
  4439. particular occasions in an existing program. Hooks are used for
  4440. customization.
  4441. A window manager might have a hook before-window-map-hook. The window
  4442. manager uses the function run-hooks to call all functions stored in
  4443. before-window-map-hook each time a window is mapped. The user can
  4444. store functions in the hook using add-hook!.
  4445. In Guile, hooks are first class objects.
  4446. *** New function: make-hook [N_ARGS]
  4447. Return a hook for hook functions which can take N_ARGS arguments.
  4448. The default value for N_ARGS is 0.
  4449. (See also scm_make_named_hook below.)
  4450. *** New function: add-hook! HOOK PROC [APPEND_P]
  4451. Put PROC at the beginning of the list of functions stored in HOOK.
  4452. If APPEND_P is supplied, and non-false, put PROC at the end instead.
  4453. PROC must be able to take the number of arguments specified when the
  4454. hook was created.
  4455. If PROC already exists in HOOK, then remove it first.
  4456. *** New function: remove-hook! HOOK PROC
  4457. Remove PROC from the list of functions in HOOK.
  4458. *** New function: reset-hook! HOOK
  4459. Clear the list of hook functions stored in HOOK.
  4460. *** New function: run-hook HOOK ARG1 ...
  4461. Run all hook functions stored in HOOK with arguments ARG1 ... .
  4462. The number of arguments supplied must correspond to the number given
  4463. when the hook was created.
  4464. ** The function `dynamic-link' now takes optional keyword arguments.
  4465. The only keyword argument that is currently defined is `:global
  4466. BOOL'. With it, you can control whether the shared library will be
  4467. linked in global mode or not. In global mode, the symbols from the
  4468. linked library can be used to resolve references from other
  4469. dynamically linked libraries. In non-global mode, the linked
  4470. library is essentially invisible and can only be accessed via
  4471. `dynamic-func', etc. The default is now to link in global mode.
  4472. Previously, the default has been non-global mode.
  4473. The `#:global' keyword is only effective on platforms that support
  4474. the dlopen family of functions.
  4475. ** New function `provided?'
  4476. - Function: provided? FEATURE
  4477. Return true iff FEATURE is supported by this installation of
  4478. Guile. FEATURE must be a symbol naming a feature; the global
  4479. variable `*features*' is a list of available features.
  4480. ** Changes to the module (ice-9 expect):
  4481. *** The expect-strings macro now matches `$' in a regular expression
  4482. only at a line-break or end-of-file by default. Previously it would
  4483. match the end of the string accumulated so far. The old behaviour
  4484. can be obtained by setting the variable `expect-strings-exec-flags'
  4485. to 0.
  4486. *** The expect-strings macro now uses a variable `expect-strings-exec-flags'
  4487. for the regexp-exec flags. If `regexp/noteol' is included, then `$'
  4488. in a regular expression will still match before a line-break or
  4489. end-of-file. The default is `regexp/noteol'.
  4490. *** The expect-strings macro now uses a variable
  4491. `expect-strings-compile-flags' for the flags to be supplied to
  4492. `make-regexp'. The default is `regexp/newline', which was previously
  4493. hard-coded.
  4494. *** The expect macro now supplies two arguments to a match procedure:
  4495. the current accumulated string and a flag to indicate whether
  4496. end-of-file has been reached. Previously only the string was supplied.
  4497. If end-of-file is reached, the match procedure will be called an
  4498. additional time with the same accumulated string as the previous call
  4499. but with the flag set.
  4500. ** New module (ice-9 format), implementing the Common Lisp `format' function.
  4501. This code, and the documentation for it that appears here, was
  4502. borrowed from SLIB, with minor adaptations for Guile.
  4503. - Function: format DESTINATION FORMAT-STRING . ARGUMENTS
  4504. An almost complete implementation of Common LISP format description
  4505. according to the CL reference book `Common LISP' from Guy L.
  4506. Steele, Digital Press. Backward compatible to most of the
  4507. available Scheme format implementations.
  4508. Returns `#t', `#f' or a string; has side effect of printing
  4509. according to FORMAT-STRING. If DESTINATION is `#t', the output is
  4510. to the current output port and `#t' is returned. If DESTINATION
  4511. is `#f', a formatted string is returned as the result of the call.
  4512. NEW: If DESTINATION is a string, DESTINATION is regarded as the
  4513. format string; FORMAT-STRING is then the first argument and the
  4514. output is returned as a string. If DESTINATION is a number, the
  4515. output is to the current error port if available by the
  4516. implementation. Otherwise DESTINATION must be an output port and
  4517. `#t' is returned.
  4518. FORMAT-STRING must be a string. In case of a formatting error
  4519. format returns `#f' and prints a message on the current output or
  4520. error port. Characters are output as if the string were output by
  4521. the `display' function with the exception of those prefixed by a
  4522. tilde (~). For a detailed description of the FORMAT-STRING syntax
  4523. please consult a Common LISP format reference manual. For a test
  4524. suite to verify this format implementation load `formatst.scm'.
  4525. Please send bug reports to `lutzeb@cs.tu-berlin.de'.
  4526. Note: `format' is not reentrant, i.e. only one `format'-call may
  4527. be executed at a time.
  4528. *** Format Specification (Format version 3.0)
  4529. Please consult a Common LISP format reference manual for a detailed
  4530. description of the format string syntax. For a demonstration of the
  4531. implemented directives see `formatst.scm'.
  4532. This implementation supports directive parameters and modifiers (`:'
  4533. and `@' characters). Multiple parameters must be separated by a comma
  4534. (`,'). Parameters can be numerical parameters (positive or negative),
  4535. character parameters (prefixed by a quote character (`''), variable
  4536. parameters (`v'), number of rest arguments parameter (`#'), empty and
  4537. default parameters. Directive characters are case independent. The
  4538. general form of a directive is:
  4539. DIRECTIVE ::= ~{DIRECTIVE-PARAMETER,}[:][@]DIRECTIVE-CHARACTER
  4540. DIRECTIVE-PARAMETER ::= [ [-|+]{0-9}+ | 'CHARACTER | v | # ]
  4541. *** Implemented CL Format Control Directives
  4542. Documentation syntax: Uppercase characters represent the
  4543. corresponding control directive characters. Lowercase characters
  4544. represent control directive parameter descriptions.
  4545. `~A'
  4546. Any (print as `display' does).
  4547. `~@A'
  4548. left pad.
  4549. `~MINCOL,COLINC,MINPAD,PADCHARA'
  4550. full padding.
  4551. `~S'
  4552. S-expression (print as `write' does).
  4553. `~@S'
  4554. left pad.
  4555. `~MINCOL,COLINC,MINPAD,PADCHARS'
  4556. full padding.
  4557. `~D'
  4558. Decimal.
  4559. `~@D'
  4560. print number sign always.
  4561. `~:D'
  4562. print comma separated.
  4563. `~MINCOL,PADCHAR,COMMACHARD'
  4564. padding.
  4565. `~X'
  4566. Hexadecimal.
  4567. `~@X'
  4568. print number sign always.
  4569. `~:X'
  4570. print comma separated.
  4571. `~MINCOL,PADCHAR,COMMACHARX'
  4572. padding.
  4573. `~O'
  4574. Octal.
  4575. `~@O'
  4576. print number sign always.
  4577. `~:O'
  4578. print comma separated.
  4579. `~MINCOL,PADCHAR,COMMACHARO'
  4580. padding.
  4581. `~B'
  4582. Binary.
  4583. `~@B'
  4584. print number sign always.
  4585. `~:B'
  4586. print comma separated.
  4587. `~MINCOL,PADCHAR,COMMACHARB'
  4588. padding.
  4589. `~NR'
  4590. Radix N.
  4591. `~N,MINCOL,PADCHAR,COMMACHARR'
  4592. padding.
  4593. `~@R'
  4594. print a number as a Roman numeral.
  4595. `~:@R'
  4596. print a number as an "old fashioned" Roman numeral.
  4597. `~:R'
  4598. print a number as an ordinal English number.
  4599. `~:@R'
  4600. print a number as a cardinal English number.
  4601. `~P'
  4602. Plural.
  4603. `~@P'
  4604. prints `y' and `ies'.
  4605. `~:P'
  4606. as `~P but jumps 1 argument backward.'
  4607. `~:@P'
  4608. as `~@P but jumps 1 argument backward.'
  4609. `~C'
  4610. Character.
  4611. `~@C'
  4612. prints a character as the reader can understand it (i.e. `#\'
  4613. prefixing).
  4614. `~:C'
  4615. prints a character as emacs does (eg. `^C' for ASCII 03).
  4616. `~F'
  4617. Fixed-format floating-point (prints a flonum like MMM.NNN).
  4618. `~WIDTH,DIGITS,SCALE,OVERFLOWCHAR,PADCHARF'
  4619. `~@F'
  4620. If the number is positive a plus sign is printed.
  4621. `~E'
  4622. Exponential floating-point (prints a flonum like MMM.NNN`E'EE).
  4623. `~WIDTH,DIGITS,EXPONENTDIGITS,SCALE,OVERFLOWCHAR,PADCHAR,EXPONENTCHARE'
  4624. `~@E'
  4625. If the number is positive a plus sign is printed.
  4626. `~G'
  4627. General floating-point (prints a flonum either fixed or
  4628. exponential).
  4629. `~WIDTH,DIGITS,EXPONENTDIGITS,SCALE,OVERFLOWCHAR,PADCHAR,EXPONENTCHARG'
  4630. `~@G'
  4631. If the number is positive a plus sign is printed.
  4632. `~$'
  4633. Dollars floating-point (prints a flonum in fixed with signs
  4634. separated).
  4635. `~DIGITS,SCALE,WIDTH,PADCHAR$'
  4636. `~@$'
  4637. If the number is positive a plus sign is printed.
  4638. `~:@$'
  4639. A sign is always printed and appears before the padding.
  4640. `~:$'
  4641. The sign appears before the padding.
  4642. `~%'
  4643. Newline.
  4644. `~N%'
  4645. print N newlines.
  4646. `~&'
  4647. print newline if not at the beginning of the output line.
  4648. `~N&'
  4649. prints `~&' and then N-1 newlines.
  4650. `~|'
  4651. Page Separator.
  4652. `~N|'
  4653. print N page separators.
  4654. `~~'
  4655. Tilde.
  4656. `~N~'
  4657. print N tildes.
  4658. `~'<newline>
  4659. Continuation Line.
  4660. `~:'<newline>
  4661. newline is ignored, white space left.
  4662. `~@'<newline>
  4663. newline is left, white space ignored.
  4664. `~T'
  4665. Tabulation.
  4666. `~@T'
  4667. relative tabulation.
  4668. `~COLNUM,COLINCT'
  4669. full tabulation.
  4670. `~?'
  4671. Indirection (expects indirect arguments as a list).
  4672. `~@?'
  4673. extracts indirect arguments from format arguments.
  4674. `~(STR~)'
  4675. Case conversion (converts by `string-downcase').
  4676. `~:(STR~)'
  4677. converts by `string-capitalize'.
  4678. `~@(STR~)'
  4679. converts by `string-capitalize-first'.
  4680. `~:@(STR~)'
  4681. converts by `string-upcase'.
  4682. `~*'
  4683. Argument Jumping (jumps 1 argument forward).
  4684. `~N*'
  4685. jumps N arguments forward.
  4686. `~:*'
  4687. jumps 1 argument backward.
  4688. `~N:*'
  4689. jumps N arguments backward.
  4690. `~@*'
  4691. jumps to the 0th argument.
  4692. `~N@*'
  4693. jumps to the Nth argument (beginning from 0)
  4694. `~[STR0~;STR1~;...~;STRN~]'
  4695. Conditional Expression (numerical clause conditional).
  4696. `~N['
  4697. take argument from N.
  4698. `~@['
  4699. true test conditional.
  4700. `~:['
  4701. if-else-then conditional.
  4702. `~;'
  4703. clause separator.
  4704. `~:;'
  4705. default clause follows.
  4706. `~{STR~}'
  4707. Iteration (args come from the next argument (a list)).
  4708. `~N{'
  4709. at most N iterations.
  4710. `~:{'
  4711. args from next arg (a list of lists).
  4712. `~@{'
  4713. args from the rest of arguments.
  4714. `~:@{'
  4715. args from the rest args (lists).
  4716. `~^'
  4717. Up and out.
  4718. `~N^'
  4719. aborts if N = 0
  4720. `~N,M^'
  4721. aborts if N = M
  4722. `~N,M,K^'
  4723. aborts if N <= M <= K
  4724. *** Not Implemented CL Format Control Directives
  4725. `~:A'
  4726. print `#f' as an empty list (see below).
  4727. `~:S'
  4728. print `#f' as an empty list (see below).
  4729. `~<~>'
  4730. Justification.
  4731. `~:^'
  4732. (sorry I don't understand its semantics completely)
  4733. *** Extended, Replaced and Additional Control Directives
  4734. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHD'
  4735. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHX'
  4736. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHO'
  4737. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHB'
  4738. `~N,MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHR'
  4739. COMMAWIDTH is the number of characters between two comma
  4740. characters.
  4741. `~I'
  4742. print a R4RS complex number as `~F~@Fi' with passed parameters for
  4743. `~F'.
  4744. `~Y'
  4745. Pretty print formatting of an argument for scheme code lists.
  4746. `~K'
  4747. Same as `~?.'
  4748. `~!'
  4749. Flushes the output if format DESTINATION is a port.
  4750. `~_'
  4751. Print a `#\space' character
  4752. `~N_'
  4753. print N `#\space' characters.
  4754. `~/'
  4755. Print a `#\tab' character
  4756. `~N/'
  4757. print N `#\tab' characters.
  4758. `~NC'
  4759. Takes N as an integer representation for a character. No arguments
  4760. are consumed. N is converted to a character by `integer->char'. N
  4761. must be a positive decimal number.
  4762. `~:S'
  4763. Print out readproof. Prints out internal objects represented as
  4764. `#<...>' as strings `"#<...>"' so that the format output can always
  4765. be processed by `read'.
  4766. `~:A'
  4767. Print out readproof. Prints out internal objects represented as
  4768. `#<...>' as strings `"#<...>"' so that the format output can always
  4769. be processed by `read'.
  4770. `~Q'
  4771. Prints information and a copyright notice on the format
  4772. implementation.
  4773. `~:Q'
  4774. prints format version.
  4775. `~F, ~E, ~G, ~$'
  4776. may also print number strings, i.e. passing a number as a string
  4777. and format it accordingly.
  4778. *** Configuration Variables
  4779. The format module exports some configuration variables to suit the
  4780. systems and users needs. There should be no modification necessary for
  4781. the configuration that comes with Guile. Format detects automatically
  4782. if the running scheme system implements floating point numbers and
  4783. complex numbers.
  4784. format:symbol-case-conv
  4785. Symbols are converted by `symbol->string' so the case type of the
  4786. printed symbols is implementation dependent.
  4787. `format:symbol-case-conv' is a one arg closure which is either
  4788. `#f' (no conversion), `string-upcase', `string-downcase' or
  4789. `string-capitalize'. (default `#f')
  4790. format:iobj-case-conv
  4791. As FORMAT:SYMBOL-CASE-CONV but applies for the representation of
  4792. implementation internal objects. (default `#f')
  4793. format:expch
  4794. The character prefixing the exponent value in `~E' printing.
  4795. (default `#\E')
  4796. *** Compatibility With Other Format Implementations
  4797. SLIB format 2.x:
  4798. See `format.doc'.
  4799. SLIB format 1.4:
  4800. Downward compatible except for padding support and `~A', `~S',
  4801. `~P', `~X' uppercase printing. SLIB format 1.4 uses C-style
  4802. `printf' padding support which is completely replaced by the CL
  4803. `format' padding style.
  4804. MIT C-Scheme 7.1:
  4805. Downward compatible except for `~', which is not documented
  4806. (ignores all characters inside the format string up to a newline
  4807. character). (7.1 implements `~a', `~s', ~NEWLINE, `~~', `~%',
  4808. numerical and variable parameters and `:/@' modifiers in the CL
  4809. sense).
  4810. Elk 1.5/2.0:
  4811. Downward compatible except for `~A' and `~S' which print in
  4812. uppercase. (Elk implements `~a', `~s', `~~', and `~%' (no
  4813. directive parameters or modifiers)).
  4814. Scheme->C 01nov91:
  4815. Downward compatible except for an optional destination parameter:
  4816. S2C accepts a format call without a destination which returns a
  4817. formatted string. This is equivalent to a #f destination in S2C.
  4818. (S2C implements `~a', `~s', `~c', `~%', and `~~' (no directive
  4819. parameters or modifiers)).
  4820. ** Changes to string-handling functions.
  4821. These functions were added to support the (ice-9 format) module, above.
  4822. *** New function: string-upcase STRING
  4823. *** New function: string-downcase STRING
  4824. These are non-destructive versions of the existing string-upcase! and
  4825. string-downcase! functions.
  4826. *** New function: string-capitalize! STRING
  4827. *** New function: string-capitalize STRING
  4828. These functions convert the first letter of each word in the string to
  4829. upper case. Thus:
  4830. (string-capitalize "howdy there")
  4831. => "Howdy There"
  4832. As with the other functions, string-capitalize! modifies the string in
  4833. place, while string-capitalize returns a modified copy of its argument.
  4834. *** New function: string-ci->symbol STRING
  4835. Return a symbol whose name is STRING, but having the same case as if
  4836. the symbol had be read by `read'.
  4837. Guile can be configured to be sensitive or insensitive to case
  4838. differences in Scheme identifiers. If Guile is case-insensitive, all
  4839. symbols are converted to lower case on input. The `string-ci->symbol'
  4840. function returns a symbol whose name in STRING, transformed as Guile
  4841. would if STRING were input.
  4842. *** New function: substring-move! STRING1 START END STRING2 START
  4843. Copy the substring of STRING1 from START (inclusive) to END
  4844. (exclusive) to STRING2 at START. STRING1 and STRING2 may be the same
  4845. string, and the source and destination areas may overlap; in all
  4846. cases, the function behaves as if all the characters were copied
  4847. simultanously.
  4848. *** Extended functions: substring-move-left! substring-move-right!
  4849. These functions now correctly copy arbitrarily overlapping substrings;
  4850. they are both synonyms for substring-move!.
  4851. ** New module (ice-9 getopt-long), with the function `getopt-long'.
  4852. getopt-long is a function for parsing command-line arguments in a
  4853. manner consistent with other GNU programs.
  4854. (getopt-long ARGS GRAMMAR)
  4855. Parse the arguments ARGS according to the argument list grammar GRAMMAR.
  4856. ARGS should be a list of strings. Its first element should be the
  4857. name of the program; subsequent elements should be the arguments
  4858. that were passed to the program on the command line. The
  4859. `program-arguments' procedure returns a list of this form.
  4860. GRAMMAR is a list of the form:
  4861. ((OPTION (PROPERTY VALUE) ...) ...)
  4862. Each OPTION should be a symbol. `getopt-long' will accept a
  4863. command-line option named `--OPTION'.
  4864. Each option can have the following (PROPERTY VALUE) pairs:
  4865. (single-char CHAR) --- Accept `-CHAR' as a single-character
  4866. equivalent to `--OPTION'. This is how to specify traditional
  4867. Unix-style flags.
  4868. (required? BOOL) --- If BOOL is true, the option is required.
  4869. getopt-long will raise an error if it is not found in ARGS.
  4870. (value BOOL) --- If BOOL is #t, the option accepts a value; if
  4871. it is #f, it does not; and if it is the symbol
  4872. `optional', the option may appear in ARGS with or
  4873. without a value.
  4874. (predicate FUNC) --- If the option accepts a value (i.e. you
  4875. specified `(value #t)' for this option), then getopt
  4876. will apply FUNC to the value, and throw an exception
  4877. if it returns #f. FUNC should be a procedure which
  4878. accepts a string and returns a boolean value; you may
  4879. need to use quasiquotes to get it into GRAMMAR.
  4880. The (PROPERTY VALUE) pairs may occur in any order, but each
  4881. property may occur only once. By default, options do not have
  4882. single-character equivalents, are not required, and do not take
  4883. values.
  4884. In ARGS, single-character options may be combined, in the usual
  4885. Unix fashion: ("-x" "-y") is equivalent to ("-xy"). If an option
  4886. accepts values, then it must be the last option in the
  4887. combination; the value is the next argument. So, for example, using
  4888. the following grammar:
  4889. ((apples (single-char #\a))
  4890. (blimps (single-char #\b) (value #t))
  4891. (catalexis (single-char #\c) (value #t)))
  4892. the following argument lists would be acceptable:
  4893. ("-a" "-b" "bang" "-c" "couth") ("bang" and "couth" are the values
  4894. for "blimps" and "catalexis")
  4895. ("-ab" "bang" "-c" "couth") (same)
  4896. ("-ac" "couth" "-b" "bang") (same)
  4897. ("-abc" "couth" "bang") (an error, since `-b' is not the
  4898. last option in its combination)
  4899. If an option's value is optional, then `getopt-long' decides
  4900. whether it has a value by looking at what follows it in ARGS. If
  4901. the next element is a string, and it does not appear to be an
  4902. option itself, then that string is the option's value.
  4903. The value of a long option can appear as the next element in ARGS,
  4904. or it can follow the option name, separated by an `=' character.
  4905. Thus, using the same grammar as above, the following argument lists
  4906. are equivalent:
  4907. ("--apples" "Braeburn" "--blimps" "Goodyear")
  4908. ("--apples=Braeburn" "--blimps" "Goodyear")
  4909. ("--blimps" "Goodyear" "--apples=Braeburn")
  4910. If the option "--" appears in ARGS, argument parsing stops there;
  4911. subsequent arguments are returned as ordinary arguments, even if
  4912. they resemble options. So, in the argument list:
  4913. ("--apples" "Granny Smith" "--" "--blimp" "Goodyear")
  4914. `getopt-long' will recognize the `apples' option as having the
  4915. value "Granny Smith", but it will not recognize the `blimp'
  4916. option; it will return the strings "--blimp" and "Goodyear" as
  4917. ordinary argument strings.
  4918. The `getopt-long' function returns the parsed argument list as an
  4919. assocation list, mapping option names --- the symbols from GRAMMAR
  4920. --- onto their values, or #t if the option does not accept a value.
  4921. Unused options do not appear in the alist.
  4922. All arguments that are not the value of any option are returned
  4923. as a list, associated with the empty list.
  4924. `getopt-long' throws an exception if:
  4925. - it finds an unrecognized option in ARGS
  4926. - a required option is omitted
  4927. - an option that requires an argument doesn't get one
  4928. - an option that doesn't accept an argument does get one (this can
  4929. only happen using the long option `--opt=value' syntax)
  4930. - an option predicate fails
  4931. So, for example:
  4932. (define grammar
  4933. `((lockfile-dir (required? #t)
  4934. (value #t)
  4935. (single-char #\k)
  4936. (predicate ,file-is-directory?))
  4937. (verbose (required? #f)
  4938. (single-char #\v)
  4939. (value #f))
  4940. (x-includes (single-char #\x))
  4941. (rnet-server (single-char #\y)
  4942. (predicate ,string?))))
  4943. (getopt-long '("my-prog" "-vk" "/tmp" "foo1" "--x-includes=/usr/include"
  4944. "--rnet-server=lamprod" "--" "-fred" "foo2" "foo3")
  4945. grammar)
  4946. => ((() "foo1" "-fred" "foo2" "foo3")
  4947. (rnet-server . "lamprod")
  4948. (x-includes . "/usr/include")
  4949. (lockfile-dir . "/tmp")
  4950. (verbose . #t))
  4951. ** The (ice-9 getopt-gnu-style) module is obsolete; use (ice-9 getopt-long).
  4952. It will be removed in a few releases.
  4953. ** New syntax: lambda*
  4954. ** New syntax: define*
  4955. ** New syntax: define*-public
  4956. ** New syntax: defmacro*
  4957. ** New syntax: defmacro*-public
  4958. Guile now supports optional arguments.
  4959. `lambda*', `define*', `define*-public', `defmacro*' and
  4960. `defmacro*-public' are identical to the non-* versions except that
  4961. they use an extended type of parameter list that has the following BNF
  4962. syntax (parentheses are literal, square brackets indicate grouping,
  4963. and `*', `+' and `?' have the usual meaning):
  4964. ext-param-list ::= ( [identifier]* [#&optional [ext-var-decl]+]?
  4965. [#&key [ext-var-decl]+ [#&allow-other-keys]?]?
  4966. [[#&rest identifier]|[. identifier]]? ) | [identifier]
  4967. ext-var-decl ::= identifier | ( identifier expression )
  4968. The semantics are best illustrated with the following documentation
  4969. and examples for `lambda*':
  4970. lambda* args . body
  4971. lambda extended for optional and keyword arguments
  4972. lambda* creates a procedure that takes optional arguments. These
  4973. are specified by putting them inside brackets at the end of the
  4974. paramater list, but before any dotted rest argument. For example,
  4975. (lambda* (a b #&optional c d . e) '())
  4976. creates a procedure with fixed arguments a and b, optional arguments c
  4977. and d, and rest argument e. If the optional arguments are omitted
  4978. in a call, the variables for them are unbound in the procedure. This
  4979. can be checked with the bound? macro.
  4980. lambda* can also take keyword arguments. For example, a procedure
  4981. defined like this:
  4982. (lambda* (#&key xyzzy larch) '())
  4983. can be called with any of the argument lists (#:xyzzy 11)
  4984. (#:larch 13) (#:larch 42 #:xyzzy 19) (). Whichever arguments
  4985. are given as keywords are bound to values.
  4986. Optional and keyword arguments can also be given default values
  4987. which they take on when they are not present in a call, by giving a
  4988. two-item list in place of an optional argument, for example in:
  4989. (lambda* (foo #&optional (bar 42) #&key (baz 73)) (list foo bar baz))
  4990. foo is a fixed argument, bar is an optional argument with default
  4991. value 42, and baz is a keyword argument with default value 73.
  4992. Default value expressions are not evaluated unless they are needed
  4993. and until the procedure is called.
  4994. lambda* now supports two more special parameter list keywords.
  4995. lambda*-defined procedures now throw an error by default if a
  4996. keyword other than one of those specified is found in the actual
  4997. passed arguments. However, specifying #&allow-other-keys
  4998. immediately after the kyword argument declarations restores the
  4999. previous behavior of ignoring unknown keywords. lambda* also now
  5000. guarantees that if the same keyword is passed more than once, the
  5001. last one passed is the one that takes effect. For example,
  5002. ((lambda* (#&key (heads 0) (tails 0)) (display (list heads tails)))
  5003. #:heads 37 #:tails 42 #:heads 99)
  5004. would result in (99 47) being displayed.
  5005. #&rest is also now provided as a synonym for the dotted syntax rest
  5006. argument. The argument lists (a . b) and (a #&rest b) are equivalent in
  5007. all respects to lambda*. This is provided for more similarity to DSSSL,
  5008. MIT-Scheme and Kawa among others, as well as for refugees from other
  5009. Lisp dialects.
  5010. Further documentation may be found in the optargs.scm file itself.
  5011. The optional argument module also exports the macros `let-optional',
  5012. `let-optional*', `let-keywords', `let-keywords*' and `bound?'. These
  5013. are not documented here because they may be removed in the future, but
  5014. full documentation is still available in optargs.scm.
  5015. ** New syntax: and-let*
  5016. Guile now supports the `and-let*' form, described in the draft SRFI-2.
  5017. Syntax: (land* (<clause> ...) <body> ...)
  5018. Each <clause> should have one of the following forms:
  5019. (<variable> <expression>)
  5020. (<expression>)
  5021. <bound-variable>
  5022. Each <variable> or <bound-variable> should be an identifier. Each
  5023. <expression> should be a valid expression. The <body> should be a
  5024. possibly empty sequence of expressions, like the <body> of a
  5025. lambda form.
  5026. Semantics: A LAND* expression is evaluated by evaluating the
  5027. <expression> or <bound-variable> of each of the <clause>s from
  5028. left to right. The value of the first <expression> or
  5029. <bound-variable> that evaluates to a false value is returned; the
  5030. remaining <expression>s and <bound-variable>s are not evaluated.
  5031. The <body> forms are evaluated iff all the <expression>s and
  5032. <bound-variable>s evaluate to true values.
  5033. The <expression>s and the <body> are evaluated in an environment
  5034. binding each <variable> of the preceding (<variable> <expression>)
  5035. clauses to the value of the <expression>. Later bindings
  5036. shadow earlier bindings.
  5037. Guile's and-let* macro was contributed by Michael Livshin.
  5038. ** New sorting functions
  5039. *** New function: sorted? SEQUENCE LESS?
  5040. Returns `#t' when the sequence argument is in non-decreasing order
  5041. according to LESS? (that is, there is no adjacent pair `... x y
  5042. ...' for which `(less? y x)').
  5043. Returns `#f' when the sequence contains at least one out-of-order
  5044. pair. It is an error if the sequence is neither a list nor a
  5045. vector.
  5046. *** New function: merge LIST1 LIST2 LESS?
  5047. LIST1 and LIST2 are sorted lists.
  5048. Returns the sorted list of all elements in LIST1 and LIST2.
  5049. Assume that the elements a and b1 in LIST1 and b2 in LIST2 are "equal"
  5050. in the sense that (LESS? x y) --> #f for x, y in {a, b1, b2},
  5051. and that a < b1 in LIST1. Then a < b1 < b2 in the result.
  5052. (Here "<" should read "comes before".)
  5053. *** New procedure: merge! LIST1 LIST2 LESS?
  5054. Merges two lists, re-using the pairs of LIST1 and LIST2 to build
  5055. the result. If the code is compiled, and LESS? constructs no new
  5056. pairs, no pairs at all will be allocated. The first pair of the
  5057. result will be either the first pair of LIST1 or the first pair of
  5058. LIST2.
  5059. *** New function: sort SEQUENCE LESS?
  5060. Accepts either a list or a vector, and returns a new sequence
  5061. which is sorted. The new sequence is the same type as the input.
  5062. Always `(sorted? (sort sequence less?) less?)'. The original
  5063. sequence is not altered in any way. The new sequence shares its
  5064. elements with the old one; no elements are copied.
  5065. *** New procedure: sort! SEQUENCE LESS
  5066. Returns its sorted result in the original boxes. No new storage is
  5067. allocated at all. Proper usage: (set! slist (sort! slist <))
  5068. *** New function: stable-sort SEQUENCE LESS?
  5069. Similar to `sort' but stable. That is, if "equal" elements are
  5070. ordered a < b in the original sequence, they will have the same order
  5071. in the result.
  5072. *** New function: stable-sort! SEQUENCE LESS?
  5073. Similar to `sort!' but stable.
  5074. Uses temporary storage when sorting vectors.
  5075. *** New functions: sort-list, sort-list!
  5076. Added for compatibility with scsh.
  5077. ** New built-in random number support
  5078. *** New function: random N [STATE]
  5079. Accepts a positive integer or real N and returns a number of the
  5080. same type between zero (inclusive) and N (exclusive). The values
  5081. returned have a uniform distribution.
  5082. The optional argument STATE must be of the type produced by
  5083. `copy-random-state' or `seed->random-state'. It defaults to the value
  5084. of the variable `*random-state*'. This object is used to maintain the
  5085. state of the pseudo-random-number generator and is altered as a side
  5086. effect of the `random' operation.
  5087. *** New variable: *random-state*
  5088. Holds a data structure that encodes the internal state of the
  5089. random-number generator that `random' uses by default. The nature
  5090. of this data structure is implementation-dependent. It may be
  5091. printed out and successfully read back in, but may or may not
  5092. function correctly as a random-number state object in another
  5093. implementation.
  5094. *** New function: copy-random-state [STATE]
  5095. Returns a new object of type suitable for use as the value of the
  5096. variable `*random-state*' and as a second argument to `random'.
  5097. If argument STATE is given, a copy of it is returned. Otherwise a
  5098. copy of `*random-state*' is returned.
  5099. *** New function: seed->random-state SEED
  5100. Returns a new object of type suitable for use as the value of the
  5101. variable `*random-state*' and as a second argument to `random'.
  5102. SEED is a string or a number. A new state is generated and
  5103. initialized using SEED.
  5104. *** New function: random:uniform [STATE]
  5105. Returns an uniformly distributed inexact real random number in the
  5106. range between 0 and 1.
  5107. *** New procedure: random:solid-sphere! VECT [STATE]
  5108. Fills VECT with inexact real random numbers the sum of whose
  5109. squares is less than 1.0. Thinking of VECT as coordinates in
  5110. space of dimension N = `(vector-length VECT)', the coordinates are
  5111. uniformly distributed within the unit N-shere. The sum of the
  5112. squares of the numbers is returned. VECT can be either a vector
  5113. or a uniform vector of doubles.
  5114. *** New procedure: random:hollow-sphere! VECT [STATE]
  5115. Fills VECT with inexact real random numbers the sum of whose squares
  5116. is equal to 1.0. Thinking of VECT as coordinates in space of
  5117. dimension n = `(vector-length VECT)', the coordinates are uniformly
  5118. distributed over the surface of the unit n-shere. VECT can be either
  5119. a vector or a uniform vector of doubles.
  5120. *** New function: random:normal [STATE]
  5121. Returns an inexact real in a normal distribution with mean 0 and
  5122. standard deviation 1. For a normal distribution with mean M and
  5123. standard deviation D use `(+ M (* D (random:normal)))'.
  5124. *** New procedure: random:normal-vector! VECT [STATE]
  5125. Fills VECT with inexact real random numbers which are independent and
  5126. standard normally distributed (i.e., with mean 0 and variance 1).
  5127. VECT can be either a vector or a uniform vector of doubles.
  5128. *** New function: random:exp STATE
  5129. Returns an inexact real in an exponential distribution with mean 1.
  5130. For an exponential distribution with mean U use (* U (random:exp)).
  5131. ** The range of logand, logior, logxor, logtest, and logbit? have changed.
  5132. These functions now operate on numbers in the range of a C unsigned
  5133. long.
  5134. These functions used to operate on numbers in the range of a C signed
  5135. long; however, this seems inappropriate, because Guile integers don't
  5136. overflow.
  5137. ** New function: make-guardian
  5138. This is an implementation of guardians as described in
  5139. R. Kent Dybvig, Carl Bruggeman, and David Eby (1993) "Guardians in a
  5140. Generation-Based Garbage Collector" ACM SIGPLAN Conference on
  5141. Programming Language Design and Implementation, June 1993
  5142. ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/pubs/guardians.ps.gz
  5143. ** New functions: delq1!, delv1!, delete1!
  5144. These procedures behave similar to delq! and friends but delete only
  5145. one object if at all.
  5146. ** New function: unread-string STRING PORT
  5147. Unread STRING to PORT, that is, push it back onto the port so that
  5148. next read operation will work on the pushed back characters.
  5149. ** unread-char can now be called multiple times
  5150. If unread-char is called multiple times, the unread characters will be
  5151. read again in last-in first-out order.
  5152. ** the procedures uniform-array-read! and uniform-array-write! now
  5153. work on any kind of port, not just ports which are open on a file.
  5154. ** Now 'l' in a port mode requests line buffering.
  5155. ** The procedure truncate-file now works on string ports as well
  5156. as file ports. If the size argument is omitted, the current
  5157. file position is used.
  5158. ** new procedure: seek PORT/FDES OFFSET WHENCE
  5159. The arguments are the same as for the old fseek procedure, but it
  5160. works on string ports as well as random-access file ports.
  5161. ** the fseek procedure now works on string ports, since it has been
  5162. redefined using seek.
  5163. ** the setvbuf procedure now uses a default size if mode is _IOFBF and
  5164. size is not supplied.
  5165. ** the newline procedure no longer flushes the port if it's not
  5166. line-buffered: previously it did if it was the current output port.
  5167. ** open-pipe and close-pipe are no longer primitive procedures, but
  5168. an emulation can be obtained using `(use-modules (ice-9 popen))'.
  5169. ** the freopen procedure has been removed.
  5170. ** new procedure: drain-input PORT
  5171. Drains PORT's read buffers (including any pushed-back characters)
  5172. and returns the contents as a single string.
  5173. ** New function: map-in-order PROC LIST1 LIST2 ...
  5174. Version of `map' which guarantees that the procedure is applied to the
  5175. lists in serial order.
  5176. ** Renamed `serial-array-copy!' and `serial-array-map!' to
  5177. `array-copy-in-order!' and `array-map-in-order!'. The old names are
  5178. now obsolete and will go away in release 1.5.
  5179. ** New syntax: collect BODY1 ...
  5180. Version of `begin' which returns a list of the results of the body
  5181. forms instead of the result of the last body form. In contrast to
  5182. `begin', `collect' allows an empty body.
  5183. ** New functions: read-history FILENAME, write-history FILENAME
  5184. Read/write command line history from/to file. Returns #t on success
  5185. and #f if an error occured.
  5186. ** `ls' and `lls' in module (ice-9 ls) now handle no arguments.
  5187. These procedures return a list of definitions available in the specified
  5188. argument, a relative module reference. In the case of no argument,
  5189. `(current-module)' is now consulted for definitions to return, instead
  5190. of simply returning #f, the former behavior.
  5191. ** The #/ syntax for lists is no longer supported.
  5192. Earlier versions of Scheme accepted this syntax, but printed a
  5193. warning.
  5194. ** Guile no longer consults the SCHEME_LOAD_PATH environment variable.
  5195. Instead, you should set GUILE_LOAD_PATH to tell Guile where to find
  5196. modules.
  5197. * Changes to the gh_ interface
  5198. ** gh_scm2doubles
  5199. Now takes a second argument which is the result array. If this
  5200. pointer is NULL, a new array is malloced (the old behaviour).
  5201. ** gh_chars2byvect, gh_shorts2svect, gh_floats2fvect, gh_scm2chars,
  5202. gh_scm2shorts, gh_scm2longs, gh_scm2floats
  5203. New functions.
  5204. * Changes to the scm_ interface
  5205. ** Function: scm_make_named_hook (char* name, int n_args)
  5206. Creates a hook in the same way as make-hook above but also
  5207. binds a variable named NAME to it.
  5208. This is the typical way of creating a hook from C code.
  5209. Currently, the variable is created in the "current" module. This
  5210. might change when we get the new module system.
  5211. ** The smob interface
  5212. The interface for creating smobs has changed. For documentation, see
  5213. data-rep.info (made from guile-core/doc/data-rep.texi).
  5214. *** Deprecated function: SCM scm_newsmob (scm_smobfuns *)
  5215. >>> This function will be removed in 1.3.4. <<<
  5216. It is replaced by:
  5217. *** Function: SCM scm_make_smob_type (const char *name, scm_sizet size)
  5218. This function adds a new smob type, named NAME, with instance size
  5219. SIZE to the system. The return value is a tag that is used in
  5220. creating instances of the type. If SIZE is 0, then no memory will
  5221. be allocated when instances of the smob are created, and nothing
  5222. will be freed by the default free function.
  5223. *** Function: void scm_set_smob_mark (long tc, SCM (*mark) (SCM))
  5224. This function sets the smob marking procedure for the smob type
  5225. specified by the tag TC. TC is the tag returned by
  5226. `scm_make_smob_type'.
  5227. *** Function: void scm_set_smob_free (long tc, SCM (*mark) (SCM))
  5228. This function sets the smob freeing procedure for the smob type
  5229. specified by the tag TC. TC is the tag returned by
  5230. `scm_make_smob_type'.
  5231. *** Function: void scm_set_smob_print (tc, print)
  5232. - Function: void scm_set_smob_print (long tc,
  5233. scm_sizet (*print) (SCM,
  5234. SCM,
  5235. scm_print_state *))
  5236. This function sets the smob printing procedure for the smob type
  5237. specified by the tag TC. TC is the tag returned by
  5238. `scm_make_smob_type'.
  5239. *** Function: void scm_set_smob_equalp (long tc, SCM (*equalp) (SCM, SCM))
  5240. This function sets the smob equality-testing predicate for the
  5241. smob type specified by the tag TC. TC is the tag returned by
  5242. `scm_make_smob_type'.
  5243. *** Macro: void SCM_NEWSMOB (SCM var, long tc, void *data)
  5244. Make VALUE contain a smob instance of the type with type code TC and
  5245. smob data DATA. VALUE must be previously declared as C type `SCM'.
  5246. *** Macro: fn_returns SCM_RETURN_NEWSMOB (long tc, void *data)
  5247. This macro expands to a block of code that creates a smob instance
  5248. of the type with type code TC and smob data DATA, and returns that
  5249. `SCM' value. It should be the last piece of code in a block.
  5250. ** The interfaces for using I/O ports and implementing port types
  5251. (ptobs) have changed significantly. The new interface is based on
  5252. shared access to buffers and a new set of ptob procedures.
  5253. *** scm_newptob has been removed
  5254. It is replaced by:
  5255. *** Function: SCM scm_make_port_type (type_name, fill_buffer, write_flush)
  5256. - Function: SCM scm_make_port_type (char *type_name,
  5257. int (*fill_buffer) (SCM port),
  5258. void (*write_flush) (SCM port));
  5259. Similarly to the new smob interface, there is a set of function
  5260. setters by which the user can customize the behaviour of his port
  5261. type. See ports.h (scm_set_port_XXX).
  5262. ** scm_strport_to_string: New function: creates a new string from
  5263. a string port's buffer.
  5264. ** Plug in interface for random number generators
  5265. The variable `scm_the_rng' in random.c contains a value and three
  5266. function pointers which together define the current random number
  5267. generator being used by the Scheme level interface and the random
  5268. number library functions.
  5269. The user is free to replace the default generator with the generator
  5270. of his own choice.
  5271. *** Variable: size_t scm_the_rng.rstate_size
  5272. The size of the random state type used by the current RNG
  5273. measured in chars.
  5274. *** Function: unsigned long scm_the_rng.random_bits (scm_rstate *STATE)
  5275. Given the random STATE, return 32 random bits.
  5276. *** Function: void scm_the_rng.init_rstate (scm_rstate *STATE, chars *S, int N)
  5277. Seed random state STATE using string S of length N.
  5278. *** Function: scm_rstate *scm_the_rng.copy_rstate (scm_rstate *STATE)
  5279. Given random state STATE, return a malloced copy.
  5280. ** Default RNG
  5281. The default RNG is the MWC (Multiply With Carry) random number
  5282. generator described by George Marsaglia at the Department of
  5283. Statistics and Supercomputer Computations Research Institute, The
  5284. Florida State University (http://stat.fsu.edu/~geo).
  5285. It uses 64 bits, has a period of 4578426017172946943 (4.6e18), and
  5286. passes all tests in the DIEHARD test suite
  5287. (http://stat.fsu.edu/~geo/diehard.html). The generation of 32 bits
  5288. costs one multiply and one add on platforms which either supports long
  5289. longs (gcc does this on most systems) or have 64 bit longs. The cost
  5290. is four multiply on other systems but this can be optimized by writing
  5291. scm_i_uniform32 in assembler.
  5292. These functions are provided through the scm_the_rng interface for use
  5293. by libguile and the application.
  5294. *** Function: unsigned long scm_i_uniform32 (scm_i_rstate *STATE)
  5295. Given the random STATE, return 32 random bits.
  5296. Don't use this function directly. Instead go through the plugin
  5297. interface (see "Plug in interface" above).
  5298. *** Function: void scm_i_init_rstate (scm_i_rstate *STATE, char *SEED, int N)
  5299. Initialize STATE using SEED of length N.
  5300. *** Function: scm_i_rstate *scm_i_copy_rstate (scm_i_rstate *STATE)
  5301. Return a malloc:ed copy of STATE. This function can easily be re-used
  5302. in the interfaces to other RNGs.
  5303. ** Random number library functions
  5304. These functions use the current RNG through the scm_the_rng interface.
  5305. It might be a good idea to use these functions from your C code so
  5306. that only one random generator is used by all code in your program.
  5307. The default random state is stored in:
  5308. *** Variable: SCM scm_var_random_state
  5309. Contains the vcell of the Scheme variable "*random-state*" which is
  5310. used as default state by all random number functions in the Scheme
  5311. level interface.
  5312. Example:
  5313. double x = scm_c_uniform01 (SCM_RSTATE (SCM_CDR (scm_var_random_state)));
  5314. *** Function: scm_rstate *scm_c_default_rstate (void)
  5315. This is a convenience function which returns the value of
  5316. scm_var_random_state. An error message is generated if this value
  5317. isn't a random state.
  5318. *** Function: scm_rstate *scm_c_make_rstate (char *SEED, int LENGTH)
  5319. Make a new random state from the string SEED of length LENGTH.
  5320. It is generally not a good idea to use multiple random states in a
  5321. program. While subsequent random numbers generated from one random
  5322. state are guaranteed to be reasonably independent, there is no such
  5323. guarantee for numbers generated from different random states.
  5324. *** Macro: unsigned long scm_c_uniform32 (scm_rstate *STATE)
  5325. Return 32 random bits.
  5326. *** Function: double scm_c_uniform01 (scm_rstate *STATE)
  5327. Return a sample from the uniform(0,1) distribution.
  5328. *** Function: double scm_c_normal01 (scm_rstate *STATE)
  5329. Return a sample from the normal(0,1) distribution.
  5330. *** Function: double scm_c_exp1 (scm_rstate *STATE)
  5331. Return a sample from the exp(1) distribution.
  5332. *** Function: unsigned long scm_c_random (scm_rstate *STATE, unsigned long M)
  5333. Return a sample from the discrete uniform(0,M) distribution.
  5334. *** Function: SCM scm_c_random_bignum (scm_rstate *STATE, SCM M)
  5335. Return a sample from the discrete uniform(0,M) distribution.
  5336. M must be a bignum object. The returned value may be an INUM.
  5337. Changes in Guile 1.3 (released Monday, October 19, 1998):
  5338. * Changes to the distribution
  5339. ** We renamed the SCHEME_LOAD_PATH environment variable to GUILE_LOAD_PATH.
  5340. To avoid conflicts, programs should name environment variables after
  5341. themselves, except when there's a common practice establishing some
  5342. other convention.
  5343. For now, Guile supports both GUILE_LOAD_PATH and SCHEME_LOAD_PATH,
  5344. giving the former precedence, and printing a warning message if the
  5345. latter is set. Guile 1.4 will not recognize SCHEME_LOAD_PATH at all.
  5346. ** The header files related to multi-byte characters have been removed.
  5347. They were: libguile/extchrs.h and libguile/mbstrings.h. Any C code
  5348. which referred to these explicitly will probably need to be rewritten,
  5349. since the support for the variant string types has been removed; see
  5350. below.
  5351. ** The header files append.h and sequences.h have been removed. These
  5352. files implemented non-R4RS operations which would encourage
  5353. non-portable programming style and less easy-to-read code.
  5354. * Changes to the stand-alone interpreter
  5355. ** New procedures have been added to implement a "batch mode":
  5356. *** Function: batch-mode?
  5357. Returns a boolean indicating whether the interpreter is in batch
  5358. mode.
  5359. *** Function: set-batch-mode?! ARG
  5360. If ARG is true, switches the interpreter to batch mode. The `#f'
  5361. case has not been implemented.
  5362. ** Guile now provides full command-line editing, when run interactively.
  5363. To use this feature, you must have the readline library installed.
  5364. The Guile build process will notice it, and automatically include
  5365. support for it.
  5366. The readline library is available via anonymous FTP from any GNU
  5367. mirror site; the canonical location is "ftp://prep.ai.mit.edu/pub/gnu".
  5368. ** the-last-stack is now a fluid.
  5369. * Changes to the procedure for linking libguile with your programs
  5370. ** You can now use the `guile-config' utility to build programs that use Guile.
  5371. Guile now includes a command-line utility called `guile-config', which
  5372. can provide information about how to compile and link programs that
  5373. use Guile.
  5374. *** `guile-config compile' prints any C compiler flags needed to use Guile.
  5375. You should include this command's output on the command line you use
  5376. to compile C or C++ code that #includes the Guile header files. It's
  5377. usually just a `-I' flag to help the compiler find the Guile headers.
  5378. *** `guile-config link' prints any linker flags necessary to link with Guile.
  5379. This command writes to its standard output a list of flags which you
  5380. must pass to the linker to link your code against the Guile library.
  5381. The flags include '-lguile' itself, any other libraries the Guile
  5382. library depends upon, and any `-L' flags needed to help the linker
  5383. find those libraries.
  5384. For example, here is a Makefile rule that builds a program named 'foo'
  5385. from the object files ${FOO_OBJECTS}, and links them against Guile:
  5386. foo: ${FOO_OBJECTS}
  5387. ${CC} ${CFLAGS} ${FOO_OBJECTS} `guile-config link` -o foo
  5388. Previous Guile releases recommended that you use autoconf to detect
  5389. which of a predefined set of libraries were present on your system.
  5390. It is more robust to use `guile-config', since it records exactly which
  5391. libraries the installed Guile library requires.
  5392. This was originally called `build-guile', but was renamed to
  5393. `guile-config' before Guile 1.3 was released, to be consistent with
  5394. the analogous script for the GTK+ GUI toolkit, which is called
  5395. `gtk-config'.
  5396. ** Use the GUILE_FLAGS macro in your configure.in file to find Guile.
  5397. If you are using the GNU autoconf package to configure your program,
  5398. you can use the GUILE_FLAGS autoconf macro to call `guile-config'
  5399. (described above) and gather the necessary values for use in your
  5400. Makefiles.
  5401. The GUILE_FLAGS macro expands to configure script code which runs the
  5402. `guile-config' script, to find out where Guile's header files and
  5403. libraries are installed. It sets two variables, marked for
  5404. substitution, as by AC_SUBST.
  5405. GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
  5406. code that uses Guile header files. This is almost always just a
  5407. -I flag.
  5408. GUILE_LDFLAGS --- flags to pass to the linker to link a
  5409. program against Guile. This includes `-lguile' for the Guile
  5410. library itself, any libraries that Guile itself requires (like
  5411. -lqthreads), and so on. It may also include a -L flag to tell the
  5412. compiler where to find the libraries.
  5413. GUILE_FLAGS is defined in the file guile.m4, in the top-level
  5414. directory of the Guile distribution. You can copy it into your
  5415. package's aclocal.m4 file, and then use it in your configure.in file.
  5416. If you are using the `aclocal' program, distributed with GNU automake,
  5417. to maintain your aclocal.m4 file, the Guile installation process
  5418. installs guile.m4 where aclocal will find it. All you need to do is
  5419. use GUILE_FLAGS in your configure.in file, and then run `aclocal';
  5420. this will copy the definition of GUILE_FLAGS into your aclocal.m4
  5421. file.
  5422. * Changes to Scheme functions and syntax
  5423. ** Multi-byte strings have been removed, as have multi-byte and wide
  5424. ports. We felt that these were the wrong approach to
  5425. internationalization support.
  5426. ** New function: readline [PROMPT]
  5427. Read a line from the terminal, and allow the user to edit it,
  5428. prompting with PROMPT. READLINE provides a large set of Emacs-like
  5429. editing commands, lets the user recall previously typed lines, and
  5430. works on almost every kind of terminal, including dumb terminals.
  5431. READLINE assumes that the cursor is at the beginning of the line when
  5432. it is invoked. Thus, you can't print a prompt yourself, and then call
  5433. READLINE; you need to package up your prompt as a string, pass it to
  5434. the function, and let READLINE print the prompt itself. This is
  5435. because READLINE needs to know the prompt's screen width.
  5436. For Guile to provide this function, you must have the readline
  5437. library, version 2.1 or later, installed on your system. Readline is
  5438. available via anonymous FTP from prep.ai.mit.edu in pub/gnu, or from
  5439. any GNU mirror site.
  5440. See also ADD-HISTORY function.
  5441. ** New function: add-history STRING
  5442. Add STRING as the most recent line in the history used by the READLINE
  5443. command. READLINE does not add lines to the history itself; you must
  5444. call ADD-HISTORY to make previous input available to the user.
  5445. ** The behavior of the read-line function has changed.
  5446. This function now uses standard C library functions to read the line,
  5447. for speed. This means that it doesn not respect the value of
  5448. scm-line-incrementors; it assumes that lines are delimited with
  5449. #\newline.
  5450. (Note that this is read-line, the function that reads a line of text
  5451. from a port, not readline, the function that reads a line from a
  5452. terminal, providing full editing capabilities.)
  5453. ** New module (ice-9 getopt-gnu-style): Parse command-line arguments.
  5454. This module provides some simple argument parsing. It exports one
  5455. function:
  5456. Function: getopt-gnu-style ARG-LS
  5457. Parse a list of program arguments into an alist of option
  5458. descriptions.
  5459. Each item in the list of program arguments is examined to see if
  5460. it meets the syntax of a GNU long-named option. An argument like
  5461. `--MUMBLE' produces an element of the form (MUMBLE . #t) in the
  5462. returned alist, where MUMBLE is a keyword object with the same
  5463. name as the argument. An argument like `--MUMBLE=FROB' produces
  5464. an element of the form (MUMBLE . FROB), where FROB is a string.
  5465. As a special case, the returned alist also contains a pair whose
  5466. car is the symbol `rest'. The cdr of this pair is a list
  5467. containing all the items in the argument list that are not options
  5468. of the form mentioned above.
  5469. The argument `--' is treated specially: all items in the argument
  5470. list appearing after such an argument are not examined, and are
  5471. returned in the special `rest' list.
  5472. This function does not parse normal single-character switches.
  5473. You will need to parse them out of the `rest' list yourself.
  5474. ** The read syntax for byte vectors and short vectors has changed.
  5475. Instead of #bytes(...), write #y(...).
  5476. Instead of #short(...), write #h(...).
  5477. This may seem nutty, but, like the other uniform vectors, byte vectors
  5478. and short vectors want to have the same print and read syntax (and,
  5479. more basic, want to have read syntax!). Changing the read syntax to
  5480. use multiple characters after the hash sign breaks with the
  5481. conventions used in R5RS and the conventions used for the other
  5482. uniform vectors. It also introduces complexity in the current reader,
  5483. both on the C and Scheme levels. (The Right solution is probably to
  5484. change the syntax and prototypes for uniform vectors entirely.)
  5485. ** The new module (ice-9 session) provides useful interactive functions.
  5486. *** New procedure: (apropos REGEXP OPTION ...)
  5487. Display a list of top-level variables whose names match REGEXP, and
  5488. the modules they are imported from. Each OPTION should be one of the
  5489. following symbols:
  5490. value --- Show the value of each matching variable.
  5491. shadow --- Show bindings shadowed by subsequently imported modules.
  5492. full --- Same as both `shadow' and `value'.
  5493. For example:
  5494. guile> (apropos "trace" 'full)
  5495. debug: trace #<procedure trace args>
  5496. debug: untrace #<procedure untrace args>
  5497. the-scm-module: display-backtrace #<compiled-closure #<primitive-procedure gsubr-apply>>
  5498. the-scm-module: before-backtrace-hook ()
  5499. the-scm-module: backtrace #<primitive-procedure backtrace>
  5500. the-scm-module: after-backtrace-hook ()
  5501. the-scm-module: has-shown-backtrace-hint? #f
  5502. guile>
  5503. ** There are new functions and syntax for working with macros.
  5504. Guile implements macros as a special object type. Any variable whose
  5505. top-level binding is a macro object acts as a macro. The macro object
  5506. specifies how the expression should be transformed before evaluation.
  5507. *** Macro objects now print in a reasonable way, resembling procedures.
  5508. *** New function: (macro? OBJ)
  5509. True iff OBJ is a macro object.
  5510. *** New function: (primitive-macro? OBJ)
  5511. Like (macro? OBJ), but true only if OBJ is one of the Guile primitive
  5512. macro transformers, implemented in eval.c rather than Scheme code.
  5513. Why do we have this function?
  5514. - For symmetry with procedure? and primitive-procedure?,
  5515. - to allow custom print procedures to tell whether a macro is
  5516. primitive, and display it differently, and
  5517. - to allow compilers and user-written evaluators to distinguish
  5518. builtin special forms from user-defined ones, which could be
  5519. compiled.
  5520. *** New function: (macro-type OBJ)
  5521. Return a value indicating what kind of macro OBJ is. Possible return
  5522. values are:
  5523. The symbol `syntax' --- a macro created by procedure->syntax.
  5524. The symbol `macro' --- a macro created by procedure->macro.
  5525. The symbol `macro!' --- a macro created by procedure->memoizing-macro.
  5526. The boolean #f --- if OBJ is not a macro object.
  5527. *** New function: (macro-name MACRO)
  5528. Return the name of the macro object MACRO's procedure, as returned by
  5529. procedure-name.
  5530. *** New function: (macro-transformer MACRO)
  5531. Return the transformer procedure for MACRO.
  5532. *** New syntax: (use-syntax MODULE ... TRANSFORMER)
  5533. Specify a new macro expander to use in the current module. Each
  5534. MODULE is a module name, with the same meaning as in the `use-modules'
  5535. form; each named module's exported bindings are added to the current
  5536. top-level environment. TRANSFORMER is an expression evaluated in the
  5537. resulting environment which must yield a procedure to use as the
  5538. module's eval transformer: every expression evaluated in this module
  5539. is passed to this function, and the result passed to the Guile
  5540. interpreter.
  5541. *** macro-eval! is removed. Use local-eval instead.
  5542. ** Some magic has been added to the printer to better handle user
  5543. written printing routines (like record printers, closure printers).
  5544. The problem is that these user written routines must have access to
  5545. the current `print-state' to be able to handle fancy things like
  5546. detection of circular references. These print-states have to be
  5547. passed to the builtin printing routines (display, write, etc) to
  5548. properly continue the print chain.
  5549. We didn't want to change all existing print code so that it
  5550. explicitly passes thru a print state in addition to a port. Instead,
  5551. we extented the possible values that the builtin printing routines
  5552. accept as a `port'. In addition to a normal port, they now also take
  5553. a pair of a normal port and a print-state. Printing will go to the
  5554. port and the print-state will be used to control the detection of
  5555. circular references, etc. If the builtin function does not care for a
  5556. print-state, it is simply ignored.
  5557. User written callbacks are now called with such a pair as their
  5558. `port', but because every function now accepts this pair as a PORT
  5559. argument, you don't have to worry about that. In fact, it is probably
  5560. safest to not check for these pairs.
  5561. However, it is sometimes necessary to continue a print chain on a
  5562. different port, for example to get a intermediate string
  5563. representation of the printed value, mangle that string somehow, and
  5564. then to finally print the mangled string. Use the new function
  5565. inherit-print-state OLD-PORT NEW-PORT
  5566. for this. It constructs a new `port' that prints to NEW-PORT but
  5567. inherits the print-state of OLD-PORT.
  5568. ** struct-vtable-offset renamed to vtable-offset-user
  5569. ** New constants: vtable-index-layout, vtable-index-vtable, vtable-index-printer
  5570. ** There is now a third optional argument to make-vtable-vtable
  5571. (and fourth to make-struct) when constructing new types (vtables).
  5572. This argument initializes field vtable-index-printer of the vtable.
  5573. ** The detection of circular references has been extended to structs.
  5574. That is, a structure that -- in the process of being printed -- prints
  5575. itself does not lead to infinite recursion.
  5576. ** There is now some basic support for fluids. Please read
  5577. "libguile/fluid.h" to find out more. It is accessible from Scheme with
  5578. the following functions and macros:
  5579. Function: make-fluid
  5580. Create a new fluid object. Fluids are not special variables or
  5581. some other extension to the semantics of Scheme, but rather
  5582. ordinary Scheme objects. You can store them into variables (that
  5583. are still lexically scoped, of course) or into any other place you
  5584. like. Every fluid has a initial value of `#f'.
  5585. Function: fluid? OBJ
  5586. Test whether OBJ is a fluid.
  5587. Function: fluid-ref FLUID
  5588. Function: fluid-set! FLUID VAL
  5589. Access/modify the fluid FLUID. Modifications are only visible
  5590. within the current dynamic root (that includes threads).
  5591. Function: with-fluids* FLUIDS VALUES THUNK
  5592. FLUIDS is a list of fluids and VALUES a corresponding list of
  5593. values for these fluids. Before THUNK gets called the values are
  5594. installed in the fluids and the old values of the fluids are
  5595. saved in the VALUES list. When the flow of control leaves THUNK
  5596. or reenters it, the values get swapped again. You might think of
  5597. this as a `safe-fluid-excursion'. Note that the VALUES list is
  5598. modified by `with-fluids*'.
  5599. Macro: with-fluids ((FLUID VALUE) ...) FORM ...
  5600. The same as `with-fluids*' but with a different syntax. It looks
  5601. just like `let', but both FLUID and VALUE are evaluated. Remember,
  5602. fluids are not special variables but ordinary objects. FLUID
  5603. should evaluate to a fluid.
  5604. ** Changes to system call interfaces:
  5605. *** close-port, close-input-port and close-output-port now return a
  5606. boolean instead of an `unspecified' object. #t means that the port
  5607. was successfully closed, while #f means it was already closed. It is
  5608. also now possible for these procedures to raise an exception if an
  5609. error occurs (some errors from write can be delayed until close.)
  5610. *** the first argument to chmod, fcntl, ftell and fseek can now be a
  5611. file descriptor.
  5612. *** the third argument to fcntl is now optional.
  5613. *** the first argument to chown can now be a file descriptor or a port.
  5614. *** the argument to stat can now be a port.
  5615. *** The following new procedures have been added (most use scsh
  5616. interfaces):
  5617. *** procedure: close PORT/FD
  5618. Similar to close-port (*note close-port: Closing Ports.), but also
  5619. works on file descriptors. A side effect of closing a file
  5620. descriptor is that any ports using that file descriptor are moved
  5621. to a different file descriptor and have their revealed counts set
  5622. to zero.
  5623. *** procedure: port->fdes PORT
  5624. Returns the integer file descriptor underlying PORT. As a side
  5625. effect the revealed count of PORT is incremented.
  5626. *** procedure: fdes->ports FDES
  5627. Returns a list of existing ports which have FDES as an underlying
  5628. file descriptor, without changing their revealed counts.
  5629. *** procedure: fdes->inport FDES
  5630. Returns an existing input port which has FDES as its underlying
  5631. file descriptor, if one exists, and increments its revealed count.
  5632. Otherwise, returns a new input port with a revealed count of 1.
  5633. *** procedure: fdes->outport FDES
  5634. Returns an existing output port which has FDES as its underlying
  5635. file descriptor, if one exists, and increments its revealed count.
  5636. Otherwise, returns a new output port with a revealed count of 1.
  5637. The next group of procedures perform a `dup2' system call, if NEWFD
  5638. (an integer) is supplied, otherwise a `dup'. The file descriptor to be
  5639. duplicated can be supplied as an integer or contained in a port. The
  5640. type of value returned varies depending on which procedure is used.
  5641. All procedures also have the side effect when performing `dup2' that
  5642. any ports using NEWFD are moved to a different file descriptor and have
  5643. their revealed counts set to zero.
  5644. *** procedure: dup->fdes PORT/FD [NEWFD]
  5645. Returns an integer file descriptor.
  5646. *** procedure: dup->inport PORT/FD [NEWFD]
  5647. Returns a new input port using the new file descriptor.
  5648. *** procedure: dup->outport PORT/FD [NEWFD]
  5649. Returns a new output port using the new file descriptor.
  5650. *** procedure: dup PORT/FD [NEWFD]
  5651. Returns a new port if PORT/FD is a port, with the same mode as the
  5652. supplied port, otherwise returns an integer file descriptor.
  5653. *** procedure: dup->port PORT/FD MODE [NEWFD]
  5654. Returns a new port using the new file descriptor. MODE supplies a
  5655. mode string for the port (*note open-file: File Ports.).
  5656. *** procedure: setenv NAME VALUE
  5657. Modifies the environment of the current process, which is also the
  5658. default environment inherited by child processes.
  5659. If VALUE is `#f', then NAME is removed from the environment.
  5660. Otherwise, the string NAME=VALUE is added to the environment,
  5661. replacing any existing string with name matching NAME.
  5662. The return value is unspecified.
  5663. *** procedure: truncate-file OBJ SIZE
  5664. Truncates the file referred to by OBJ to at most SIZE bytes. OBJ
  5665. can be a string containing a file name or an integer file
  5666. descriptor or port open for output on the file. The underlying
  5667. system calls are `truncate' and `ftruncate'.
  5668. The return value is unspecified.
  5669. *** procedure: setvbuf PORT MODE [SIZE]
  5670. Set the buffering mode for PORT. MODE can be:
  5671. `_IONBF'
  5672. non-buffered
  5673. `_IOLBF'
  5674. line buffered
  5675. `_IOFBF'
  5676. block buffered, using a newly allocated buffer of SIZE bytes.
  5677. However if SIZE is zero or unspecified, the port will be made
  5678. non-buffered.
  5679. This procedure should not be used after I/O has been performed with
  5680. the port.
  5681. Ports are usually block buffered by default, with a default buffer
  5682. size. Procedures e.g., *Note open-file: File Ports, which accept a
  5683. mode string allow `0' to be added to request an unbuffered port.
  5684. *** procedure: fsync PORT/FD
  5685. Copies any unwritten data for the specified output file descriptor
  5686. to disk. If PORT/FD is a port, its buffer is flushed before the
  5687. underlying file descriptor is fsync'd. The return value is
  5688. unspecified.
  5689. *** procedure: open-fdes PATH FLAGS [MODES]
  5690. Similar to `open' but returns a file descriptor instead of a port.
  5691. *** procedure: execle PATH ENV [ARG] ...
  5692. Similar to `execl', but the environment of the new process is
  5693. specified by ENV, which must be a list of strings as returned by
  5694. the `environ' procedure.
  5695. This procedure is currently implemented using the `execve' system
  5696. call, but we call it `execle' because of its Scheme calling
  5697. interface.
  5698. *** procedure: strerror ERRNO
  5699. Returns the Unix error message corresponding to ERRNO, an integer.
  5700. *** procedure: primitive-exit [STATUS]
  5701. Terminate the current process without unwinding the Scheme stack.
  5702. This is would typically be useful after a fork. The exit status
  5703. is STATUS if supplied, otherwise zero.
  5704. *** procedure: times
  5705. Returns an object with information about real and processor time.
  5706. The following procedures accept such an object as an argument and
  5707. return a selected component:
  5708. `tms:clock'
  5709. The current real time, expressed as time units relative to an
  5710. arbitrary base.
  5711. `tms:utime'
  5712. The CPU time units used by the calling process.
  5713. `tms:stime'
  5714. The CPU time units used by the system on behalf of the
  5715. calling process.
  5716. `tms:cutime'
  5717. The CPU time units used by terminated child processes of the
  5718. calling process, whose status has been collected (e.g., using
  5719. `waitpid').
  5720. `tms:cstime'
  5721. Similarly, the CPU times units used by the system on behalf of
  5722. terminated child processes.
  5723. ** Removed: list-length
  5724. ** Removed: list-append, list-append!
  5725. ** Removed: list-reverse, list-reverse!
  5726. ** array-map renamed to array-map!
  5727. ** serial-array-map renamed to serial-array-map!
  5728. ** catch doesn't take #f as first argument any longer
  5729. Previously, it was possible to pass #f instead of a key to `catch'.
  5730. That would cause `catch' to pass a jump buffer object to the procedure
  5731. passed as second argument. The procedure could then use this jump
  5732. buffer objekt as an argument to throw.
  5733. This mechanism has been removed since its utility doesn't motivate the
  5734. extra complexity it introduces.
  5735. ** The `#/' notation for lists now provokes a warning message from Guile.
  5736. This syntax will be removed from Guile in the near future.
  5737. To disable the warning message, set the GUILE_HUSH environment
  5738. variable to any non-empty value.
  5739. ** The newline character now prints as `#\newline', following the
  5740. normal Scheme notation, not `#\nl'.
  5741. * Changes to the gh_ interface
  5742. ** The gh_enter function now takes care of loading the Guile startup files.
  5743. gh_enter works by calling scm_boot_guile; see the remarks below.
  5744. ** Function: void gh_write (SCM x)
  5745. Write the printed representation of the scheme object x to the current
  5746. output port. Corresponds to the scheme level `write'.
  5747. ** gh_list_length renamed to gh_length.
  5748. ** vector handling routines
  5749. Several major changes. In particular, gh_vector() now resembles
  5750. (vector ...) (with a caveat -- see manual), and gh_make_vector() now
  5751. exists and behaves like (make-vector ...). gh_vset() and gh_vref()
  5752. have been renamed gh_vector_set_x() and gh_vector_ref(). Some missing
  5753. vector-related gh_ functions have been implemented.
  5754. ** pair and list routines
  5755. Implemented several of the R4RS pair and list functions that were
  5756. missing.
  5757. ** gh_scm2doubles, gh_doubles2scm, gh_doubles2dvect
  5758. New function. Converts double arrays back and forth between Scheme
  5759. and C.
  5760. * Changes to the scm_ interface
  5761. ** The function scm_boot_guile now takes care of loading the startup files.
  5762. Guile's primary initialization function, scm_boot_guile, now takes
  5763. care of loading `boot-9.scm', in the `ice-9' module, to initialize
  5764. Guile, define the module system, and put together some standard
  5765. bindings. It also loads `init.scm', which is intended to hold
  5766. site-specific initialization code.
  5767. Since Guile cannot operate properly until boot-9.scm is loaded, there
  5768. is no reason to separate loading boot-9.scm from Guile's other
  5769. initialization processes.
  5770. This job used to be done by scm_compile_shell_switches, which didn't
  5771. make much sense; in particular, it meant that people using Guile for
  5772. non-shell-like applications had to jump through hoops to get Guile
  5773. initialized properly.
  5774. ** The function scm_compile_shell_switches no longer loads the startup files.
  5775. Now, Guile always loads the startup files, whenever it is initialized;
  5776. see the notes above for scm_boot_guile and scm_load_startup_files.
  5777. ** Function: scm_load_startup_files
  5778. This new function takes care of loading Guile's initialization file
  5779. (`boot-9.scm'), and the site initialization file, `init.scm'. Since
  5780. this is always called by the Guile initialization process, it's
  5781. probably not too useful to call this yourself, but it's there anyway.
  5782. ** The semantics of smob marking have changed slightly.
  5783. The smob marking function (the `mark' member of the scm_smobfuns
  5784. structure) is no longer responsible for setting the mark bit on the
  5785. smob. The generic smob handling code in the garbage collector will
  5786. set this bit. The mark function need only ensure that any other
  5787. objects the smob refers to get marked.
  5788. Note that this change means that the smob's GC8MARK bit is typically
  5789. already set upon entry to the mark function. Thus, marking functions
  5790. which look like this:
  5791. {
  5792. if (SCM_GC8MARKP (ptr))
  5793. return SCM_BOOL_F;
  5794. SCM_SETGC8MARK (ptr);
  5795. ... mark objects to which the smob refers ...
  5796. }
  5797. are now incorrect, since they will return early, and fail to mark any
  5798. other objects the smob refers to. Some code in the Guile library used
  5799. to work this way.
  5800. ** The semantics of the I/O port functions in scm_ptobfuns have changed.
  5801. If you have implemented your own I/O port type, by writing the
  5802. functions required by the scm_ptobfuns and then calling scm_newptob,
  5803. you will need to change your functions slightly.
  5804. The functions in a scm_ptobfuns structure now expect the port itself
  5805. as their argument; they used to expect the `stream' member of the
  5806. port's scm_port_table structure. This allows functions in an
  5807. scm_ptobfuns structure to easily access the port's cell (and any flags
  5808. it its CAR), and the port's scm_port_table structure.
  5809. Guile now passes the I/O port itself as the `port' argument in the
  5810. following scm_ptobfuns functions:
  5811. int (*free) (SCM port);
  5812. int (*fputc) (int, SCM port);
  5813. int (*fputs) (char *, SCM port);
  5814. scm_sizet (*fwrite) SCM_P ((char *ptr,
  5815. scm_sizet size,
  5816. scm_sizet nitems,
  5817. SCM port));
  5818. int (*fflush) (SCM port);
  5819. int (*fgetc) (SCM port);
  5820. int (*fclose) (SCM port);
  5821. The interfaces to the `mark', `print', `equalp', and `fgets' methods
  5822. are unchanged.
  5823. If you have existing code which defines its own port types, it is easy
  5824. to convert your code to the new interface; simply apply SCM_STREAM to
  5825. the port argument to yield the value you code used to expect.
  5826. Note that since both the port and the stream have the same type in the
  5827. C code --- they are both SCM values --- the C compiler will not remind
  5828. you if you forget to update your scm_ptobfuns functions.
  5829. ** Function: int scm_internal_select (int fds,
  5830. SELECT_TYPE *rfds,
  5831. SELECT_TYPE *wfds,
  5832. SELECT_TYPE *efds,
  5833. struct timeval *timeout);
  5834. This is a replacement for the `select' function provided by the OS.
  5835. It enables I/O blocking and sleeping to happen for one cooperative
  5836. thread without blocking other threads. It also avoids busy-loops in
  5837. these situations. It is intended that all I/O blocking and sleeping
  5838. will finally go through this function. Currently, this function is
  5839. only available on systems providing `gettimeofday' and `select'.
  5840. ** Function: SCM scm_internal_stack_catch (SCM tag,
  5841. scm_catch_body_t body,
  5842. void *body_data,
  5843. scm_catch_handler_t handler,
  5844. void *handler_data)
  5845. A new sibling to the other two C level `catch' functions
  5846. scm_internal_catch and scm_internal_lazy_catch. Use it if you want
  5847. the stack to be saved automatically into the variable `the-last-stack'
  5848. (scm_the_last_stack_var) on error. This is necessary if you want to
  5849. use advanced error reporting, such as calling scm_display_error and
  5850. scm_display_backtrace. (They both take a stack object as argument.)
  5851. ** Function: SCM scm_spawn_thread (scm_catch_body_t body,
  5852. void *body_data,
  5853. scm_catch_handler_t handler,
  5854. void *handler_data)
  5855. Spawns a new thread. It does a job similar to
  5856. scm_call_with_new_thread but takes arguments more suitable when
  5857. spawning threads from application C code.
  5858. ** The hook scm_error_callback has been removed. It was originally
  5859. intended as a way for the user to install his own error handler. But
  5860. that method works badly since it intervenes between throw and catch,
  5861. thereby changing the semantics of expressions like (catch #t ...).
  5862. The correct way to do it is to use one of the C level catch functions
  5863. in throw.c: scm_internal_catch/lazy_catch/stack_catch.
  5864. ** Removed functions:
  5865. scm_obj_length, scm_list_length, scm_list_append, scm_list_append_x,
  5866. scm_list_reverse, scm_list_reverse_x
  5867. ** New macros: SCM_LISTn where n is one of the integers 0-9.
  5868. These can be used for pretty list creation from C. The idea is taken
  5869. from Erick Gallesio's STk.
  5870. ** scm_array_map renamed to scm_array_map_x
  5871. ** mbstrings are now removed
  5872. This means that the type codes scm_tc7_mb_string and
  5873. scm_tc7_mb_substring has been removed.
  5874. ** scm_gen_putc, scm_gen_puts, scm_gen_write, and scm_gen_getc have changed.
  5875. Since we no longer support multi-byte strings, these I/O functions
  5876. have been simplified, and renamed. Here are their old names, and
  5877. their new names and arguments:
  5878. scm_gen_putc -> void scm_putc (int c, SCM port);
  5879. scm_gen_puts -> void scm_puts (char *s, SCM port);
  5880. scm_gen_write -> void scm_lfwrite (char *ptr, scm_sizet size, SCM port);
  5881. scm_gen_getc -> void scm_getc (SCM port);
  5882. ** The macros SCM_TYP7D and SCM_TYP7SD has been removed.
  5883. ** The macro SCM_TYP7S has taken the role of the old SCM_TYP7D
  5884. SCM_TYP7S now masks away the bit which distinguishes substrings from
  5885. strings.
  5886. ** scm_catch_body_t: Backward incompatible change!
  5887. Body functions to scm_internal_catch and friends do not any longer
  5888. take a second argument. This is because it is no longer possible to
  5889. pass a #f arg to catch.
  5890. ** Calls to scm_protect_object and scm_unprotect now nest properly.
  5891. The function scm_protect_object protects its argument from being freed
  5892. by the garbage collector. scm_unprotect_object removes that
  5893. protection.
  5894. These functions now nest properly. That is, for every object O, there
  5895. is a counter which scm_protect_object(O) increments and
  5896. scm_unprotect_object(O) decrements, if the counter is greater than
  5897. zero. Every object's counter is zero when it is first created. If an
  5898. object's counter is greater than zero, the garbage collector will not
  5899. reclaim its storage.
  5900. This allows you to use scm_protect_object in your code without
  5901. worrying that some other function you call will call
  5902. scm_unprotect_object, and allow it to be freed. Assuming that the
  5903. functions you call are well-behaved, and unprotect only those objects
  5904. they protect, you can follow the same rule and have confidence that
  5905. objects will be freed only at appropriate times.
  5906. Changes in Guile 1.2 (released Tuesday, June 24 1997):
  5907. * Changes to the distribution
  5908. ** Nightly snapshots are now available from ftp.red-bean.com.
  5909. The old server, ftp.cyclic.com, has been relinquished to its rightful
  5910. owner.
  5911. Nightly snapshots of the Guile development sources are now available via
  5912. anonymous FTP from ftp.red-bean.com, as /pub/guile/guile-snap.tar.gz.
  5913. Via the web, that's: ftp://ftp.red-bean.com/pub/guile/guile-snap.tar.gz
  5914. For getit, that's: ftp.red-bean.com:/pub/guile/guile-snap.tar.gz
  5915. ** To run Guile without installing it, the procedure has changed a bit.
  5916. If you used a separate build directory to compile Guile, you'll need
  5917. to include the build directory in SCHEME_LOAD_PATH, as well as the
  5918. source directory. See the `INSTALL' file for examples.
  5919. * Changes to the procedure for linking libguile with your programs
  5920. ** The standard Guile load path for Scheme code now includes
  5921. $(datadir)/guile (usually /usr/local/share/guile). This means that
  5922. you can install your own Scheme files there, and Guile will find them.
  5923. (Previous versions of Guile only checked a directory whose name
  5924. contained the Guile version number, so you had to re-install or move
  5925. your Scheme sources each time you installed a fresh version of Guile.)
  5926. The load path also includes $(datadir)/guile/site; we recommend
  5927. putting individual Scheme files there. If you want to install a
  5928. package with multiple source files, create a directory for them under
  5929. $(datadir)/guile.
  5930. ** Guile 1.2 will now use the Rx regular expression library, if it is
  5931. installed on your system. When you are linking libguile into your own
  5932. programs, this means you will have to link against -lguile, -lqt (if
  5933. you configured Guile with thread support), and -lrx.
  5934. If you are using autoconf to generate configuration scripts for your
  5935. application, the following lines should suffice to add the appropriate
  5936. libraries to your link command:
  5937. ### Find Rx, quickthreads and libguile.
  5938. AC_CHECK_LIB(rx, main)
  5939. AC_CHECK_LIB(qt, main)
  5940. AC_CHECK_LIB(guile, scm_shell)
  5941. The Guile 1.2 distribution does not contain sources for the Rx
  5942. library, as Guile 1.0 did. If you want to use Rx, you'll need to
  5943. retrieve it from a GNU FTP site and install it separately.
  5944. * Changes to Scheme functions and syntax
  5945. ** The dynamic linking features of Guile are now enabled by default.
  5946. You can disable them by giving the `--disable-dynamic-linking' option
  5947. to configure.
  5948. (dynamic-link FILENAME)
  5949. Find the object file denoted by FILENAME (a string) and link it
  5950. into the running Guile application. When everything works out,
  5951. return a Scheme object suitable for representing the linked object
  5952. file. Otherwise an error is thrown. How object files are
  5953. searched is system dependent.
  5954. (dynamic-object? VAL)
  5955. Determine whether VAL represents a dynamically linked object file.
  5956. (dynamic-unlink DYNOBJ)
  5957. Unlink the indicated object file from the application. DYNOBJ
  5958. should be one of the values returned by `dynamic-link'.
  5959. (dynamic-func FUNCTION DYNOBJ)
  5960. Search the C function indicated by FUNCTION (a string or symbol)
  5961. in DYNOBJ and return some Scheme object that can later be used
  5962. with `dynamic-call' to actually call this function. Right now,
  5963. these Scheme objects are formed by casting the address of the
  5964. function to `long' and converting this number to its Scheme
  5965. representation.
  5966. (dynamic-call FUNCTION DYNOBJ)
  5967. Call the C function indicated by FUNCTION and DYNOBJ. The
  5968. function is passed no arguments and its return value is ignored.
  5969. When FUNCTION is something returned by `dynamic-func', call that
  5970. function and ignore DYNOBJ. When FUNCTION is a string (or symbol,
  5971. etc.), look it up in DYNOBJ; this is equivalent to
  5972. (dynamic-call (dynamic-func FUNCTION DYNOBJ) #f)
  5973. Interrupts are deferred while the C function is executing (with
  5974. SCM_DEFER_INTS/SCM_ALLOW_INTS).
  5975. (dynamic-args-call FUNCTION DYNOBJ ARGS)
  5976. Call the C function indicated by FUNCTION and DYNOBJ, but pass it
  5977. some arguments and return its return value. The C function is
  5978. expected to take two arguments and return an `int', just like
  5979. `main':
  5980. int c_func (int argc, char **argv);
  5981. ARGS must be a list of strings and is converted into an array of
  5982. `char *'. The array is passed in ARGV and its size in ARGC. The
  5983. return value is converted to a Scheme number and returned from the
  5984. call to `dynamic-args-call'.
  5985. When dynamic linking is disabled or not supported on your system,
  5986. the above functions throw errors, but they are still available.
  5987. Here is a small example that works on GNU/Linux:
  5988. (define libc-obj (dynamic-link "libc.so"))
  5989. (dynamic-args-call 'rand libc-obj '())
  5990. See the file `libguile/DYNAMIC-LINKING' for additional comments.
  5991. ** The #/ syntax for module names is depreciated, and will be removed
  5992. in a future version of Guile. Instead of
  5993. #/foo/bar/baz
  5994. instead write
  5995. (foo bar baz)
  5996. The latter syntax is more consistent with existing Lisp practice.
  5997. ** Guile now does fancier printing of structures. Structures are the
  5998. underlying implementation for records, which in turn are used to
  5999. implement modules, so all of these object now print differently and in
  6000. a more informative way.
  6001. The Scheme printer will examine the builtin variable *struct-printer*
  6002. whenever it needs to print a structure object. When this variable is
  6003. not `#f' it is deemed to be a procedure and will be applied to the
  6004. structure object and the output port. When *struct-printer* is `#f'
  6005. or the procedure return `#f' the structure object will be printed in
  6006. the boring #<struct 80458270> form.
  6007. This hook is used by some routines in ice-9/boot-9.scm to implement
  6008. type specific printing routines. Please read the comments there about
  6009. "printing structs".
  6010. One of the more specific uses of structs are records. The printing
  6011. procedure that could be passed to MAKE-RECORD-TYPE is now actually
  6012. called. It should behave like a *struct-printer* procedure (described
  6013. above).
  6014. ** Guile now supports a new R4RS-compliant syntax for keywords. A
  6015. token of the form #:NAME, where NAME has the same syntax as a Scheme
  6016. symbol, is the external representation of the keyword named NAME.
  6017. Keyword objects print using this syntax as well, so values containing
  6018. keyword objects can be read back into Guile. When used in an
  6019. expression, keywords are self-quoting objects.
  6020. Guile suports this read syntax, and uses this print syntax, regardless
  6021. of the current setting of the `keyword' read option. The `keyword'
  6022. read option only controls whether Guile recognizes the `:NAME' syntax,
  6023. which is incompatible with R4RS. (R4RS says such token represent
  6024. symbols.)
  6025. ** Guile has regular expression support again. Guile 1.0 included
  6026. functions for matching regular expressions, based on the Rx library.
  6027. In Guile 1.1, the Guile/Rx interface was removed to simplify the
  6028. distribution, and thus Guile had no regular expression support. Guile
  6029. 1.2 again supports the most commonly used functions, and supports all
  6030. of SCSH's regular expression functions.
  6031. If your system does not include a POSIX regular expression library,
  6032. and you have not linked Guile with a third-party regexp library such as
  6033. Rx, these functions will not be available. You can tell whether your
  6034. Guile installation includes regular expression support by checking
  6035. whether the `*features*' list includes the `regex' symbol.
  6036. *** regexp functions
  6037. By default, Guile supports POSIX extended regular expressions. That
  6038. means that the characters `(', `)', `+' and `?' are special, and must
  6039. be escaped if you wish to match the literal characters.
  6040. This regular expression interface was modeled after that implemented
  6041. by SCSH, the Scheme Shell. It is intended to be upwardly compatible
  6042. with SCSH regular expressions.
  6043. **** Function: string-match PATTERN STR [START]
  6044. Compile the string PATTERN into a regular expression and compare
  6045. it with STR. The optional numeric argument START specifies the
  6046. position of STR at which to begin matching.
  6047. `string-match' returns a "match structure" which describes what,
  6048. if anything, was matched by the regular expression. *Note Match
  6049. Structures::. If STR does not match PATTERN at all,
  6050. `string-match' returns `#f'.
  6051. Each time `string-match' is called, it must compile its PATTERN
  6052. argument into a regular expression structure. This operation is
  6053. expensive, which makes `string-match' inefficient if the same regular
  6054. expression is used several times (for example, in a loop). For better
  6055. performance, you can compile a regular expression in advance and then
  6056. match strings against the compiled regexp.
  6057. **** Function: make-regexp STR [FLAGS]
  6058. Compile the regular expression described by STR, and return the
  6059. compiled regexp structure. If STR does not describe a legal
  6060. regular expression, `make-regexp' throws a
  6061. `regular-expression-syntax' error.
  6062. FLAGS may be the bitwise-or of one or more of the following:
  6063. **** Constant: regexp/extended
  6064. Use POSIX Extended Regular Expression syntax when interpreting
  6065. STR. If not set, POSIX Basic Regular Expression syntax is used.
  6066. If the FLAGS argument is omitted, we assume regexp/extended.
  6067. **** Constant: regexp/icase
  6068. Do not differentiate case. Subsequent searches using the
  6069. returned regular expression will be case insensitive.
  6070. **** Constant: regexp/newline
  6071. Match-any-character operators don't match a newline.
  6072. A non-matching list ([^...]) not containing a newline matches a
  6073. newline.
  6074. Match-beginning-of-line operator (^) matches the empty string
  6075. immediately after a newline, regardless of whether the FLAGS
  6076. passed to regexp-exec contain regexp/notbol.
  6077. Match-end-of-line operator ($) matches the empty string
  6078. immediately before a newline, regardless of whether the FLAGS
  6079. passed to regexp-exec contain regexp/noteol.
  6080. **** Function: regexp-exec REGEXP STR [START [FLAGS]]
  6081. Match the compiled regular expression REGEXP against `str'. If
  6082. the optional integer START argument is provided, begin matching
  6083. from that position in the string. Return a match structure
  6084. describing the results of the match, or `#f' if no match could be
  6085. found.
  6086. FLAGS may be the bitwise-or of one or more of the following:
  6087. **** Constant: regexp/notbol
  6088. The match-beginning-of-line operator always fails to match (but
  6089. see the compilation flag regexp/newline above) This flag may be
  6090. used when different portions of a string are passed to
  6091. regexp-exec and the beginning of the string should not be
  6092. interpreted as the beginning of the line.
  6093. **** Constant: regexp/noteol
  6094. The match-end-of-line operator always fails to match (but see the
  6095. compilation flag regexp/newline above)
  6096. **** Function: regexp? OBJ
  6097. Return `#t' if OBJ is a compiled regular expression, or `#f'
  6098. otherwise.
  6099. Regular expressions are commonly used to find patterns in one string
  6100. and replace them with the contents of another string.
  6101. **** Function: regexp-substitute PORT MATCH [ITEM...]
  6102. Write to the output port PORT selected contents of the match
  6103. structure MATCH. Each ITEM specifies what should be written, and
  6104. may be one of the following arguments:
  6105. * A string. String arguments are written out verbatim.
  6106. * An integer. The submatch with that number is written.
  6107. * The symbol `pre'. The portion of the matched string preceding
  6108. the regexp match is written.
  6109. * The symbol `post'. The portion of the matched string
  6110. following the regexp match is written.
  6111. PORT may be `#f', in which case nothing is written; instead,
  6112. `regexp-substitute' constructs a string from the specified ITEMs
  6113. and returns that.
  6114. **** Function: regexp-substitute/global PORT REGEXP TARGET [ITEM...]
  6115. Similar to `regexp-substitute', but can be used to perform global
  6116. substitutions on STR. Instead of taking a match structure as an
  6117. argument, `regexp-substitute/global' takes two string arguments: a
  6118. REGEXP string describing a regular expression, and a TARGET string
  6119. which should be matched against this regular expression.
  6120. Each ITEM behaves as in REGEXP-SUBSTITUTE, with the following
  6121. exceptions:
  6122. * A function may be supplied. When this function is called, it
  6123. will be passed one argument: a match structure for a given
  6124. regular expression match. It should return a string to be
  6125. written out to PORT.
  6126. * The `post' symbol causes `regexp-substitute/global' to recurse
  6127. on the unmatched portion of STR. This *must* be supplied in
  6128. order to perform global search-and-replace on STR; if it is
  6129. not present among the ITEMs, then `regexp-substitute/global'
  6130. will return after processing a single match.
  6131. *** Match Structures
  6132. A "match structure" is the object returned by `string-match' and
  6133. `regexp-exec'. It describes which portion of a string, if any, matched
  6134. the given regular expression. Match structures include: a reference to
  6135. the string that was checked for matches; the starting and ending
  6136. positions of the regexp match; and, if the regexp included any
  6137. parenthesized subexpressions, the starting and ending positions of each
  6138. submatch.
  6139. In each of the regexp match functions described below, the `match'
  6140. argument must be a match structure returned by a previous call to
  6141. `string-match' or `regexp-exec'. Most of these functions return some
  6142. information about the original target string that was matched against a
  6143. regular expression; we will call that string TARGET for easy reference.
  6144. **** Function: regexp-match? OBJ
  6145. Return `#t' if OBJ is a match structure returned by a previous
  6146. call to `regexp-exec', or `#f' otherwise.
  6147. **** Function: match:substring MATCH [N]
  6148. Return the portion of TARGET matched by subexpression number N.
  6149. Submatch 0 (the default) represents the entire regexp match. If
  6150. the regular expression as a whole matched, but the subexpression
  6151. number N did not match, return `#f'.
  6152. **** Function: match:start MATCH [N]
  6153. Return the starting position of submatch number N.
  6154. **** Function: match:end MATCH [N]
  6155. Return the ending position of submatch number N.
  6156. **** Function: match:prefix MATCH
  6157. Return the unmatched portion of TARGET preceding the regexp match.
  6158. **** Function: match:suffix MATCH
  6159. Return the unmatched portion of TARGET following the regexp match.
  6160. **** Function: match:count MATCH
  6161. Return the number of parenthesized subexpressions from MATCH.
  6162. Note that the entire regular expression match itself counts as a
  6163. subexpression, and failed submatches are included in the count.
  6164. **** Function: match:string MATCH
  6165. Return the original TARGET string.
  6166. *** Backslash Escapes
  6167. Sometimes you will want a regexp to match characters like `*' or `$'
  6168. exactly. For example, to check whether a particular string represents
  6169. a menu entry from an Info node, it would be useful to match it against
  6170. a regexp like `^* [^:]*::'. However, this won't work; because the
  6171. asterisk is a metacharacter, it won't match the `*' at the beginning of
  6172. the string. In this case, we want to make the first asterisk un-magic.
  6173. You can do this by preceding the metacharacter with a backslash
  6174. character `\'. (This is also called "quoting" the metacharacter, and
  6175. is known as a "backslash escape".) When Guile sees a backslash in a
  6176. regular expression, it considers the following glyph to be an ordinary
  6177. character, no matter what special meaning it would ordinarily have.
  6178. Therefore, we can make the above example work by changing the regexp to
  6179. `^\* [^:]*::'. The `\*' sequence tells the regular expression engine
  6180. to match only a single asterisk in the target string.
  6181. Since the backslash is itself a metacharacter, you may force a
  6182. regexp to match a backslash in the target string by preceding the
  6183. backslash with itself. For example, to find variable references in a
  6184. TeX program, you might want to find occurrences of the string `\let\'
  6185. followed by any number of alphabetic characters. The regular expression
  6186. `\\let\\[A-Za-z]*' would do this: the double backslashes in the regexp
  6187. each match a single backslash in the target string.
  6188. **** Function: regexp-quote STR
  6189. Quote each special character found in STR with a backslash, and
  6190. return the resulting string.
  6191. *Very important:* Using backslash escapes in Guile source code (as
  6192. in Emacs Lisp or C) can be tricky, because the backslash character has
  6193. special meaning for the Guile reader. For example, if Guile encounters
  6194. the character sequence `\n' in the middle of a string while processing
  6195. Scheme code, it replaces those characters with a newline character.
  6196. Similarly, the character sequence `\t' is replaced by a horizontal tab.
  6197. Several of these "escape sequences" are processed by the Guile reader
  6198. before your code is executed. Unrecognized escape sequences are
  6199. ignored: if the characters `\*' appear in a string, they will be
  6200. translated to the single character `*'.
  6201. This translation is obviously undesirable for regular expressions,
  6202. since we want to be able to include backslashes in a string in order to
  6203. escape regexp metacharacters. Therefore, to make sure that a backslash
  6204. is preserved in a string in your Guile program, you must use *two*
  6205. consecutive backslashes:
  6206. (define Info-menu-entry-pattern (make-regexp "^\\* [^:]*"))
  6207. The string in this example is preprocessed by the Guile reader before
  6208. any code is executed. The resulting argument to `make-regexp' is the
  6209. string `^\* [^:]*', which is what we really want.
  6210. This also means that in order to write a regular expression that
  6211. matches a single backslash character, the regular expression string in
  6212. the source code must include *four* backslashes. Each consecutive pair
  6213. of backslashes gets translated by the Guile reader to a single
  6214. backslash, and the resulting double-backslash is interpreted by the
  6215. regexp engine as matching a single backslash character. Hence:
  6216. (define tex-variable-pattern (make-regexp "\\\\let\\\\=[A-Za-z]*"))
  6217. The reason for the unwieldiness of this syntax is historical. Both
  6218. regular expression pattern matchers and Unix string processing systems
  6219. have traditionally used backslashes with the special meanings described
  6220. above. The POSIX regular expression specification and ANSI C standard
  6221. both require these semantics. Attempting to abandon either convention
  6222. would cause other kinds of compatibility problems, possibly more severe
  6223. ones. Therefore, without extending the Scheme reader to support
  6224. strings with different quoting conventions (an ungainly and confusing
  6225. extension when implemented in other languages), we must adhere to this
  6226. cumbersome escape syntax.
  6227. * Changes to the gh_ interface
  6228. * Changes to the scm_ interface
  6229. * Changes to system call interfaces:
  6230. ** The value returned by `raise' is now unspecified. It throws an exception
  6231. if an error occurs.
  6232. *** A new procedure `sigaction' can be used to install signal handlers
  6233. (sigaction signum [action] [flags])
  6234. signum is the signal number, which can be specified using the value
  6235. of SIGINT etc.
  6236. If action is omitted, sigaction returns a pair: the CAR is the current
  6237. signal hander, which will be either an integer with the value SIG_DFL
  6238. (default action) or SIG_IGN (ignore), or the Scheme procedure which
  6239. handles the signal, or #f if a non-Scheme procedure handles the
  6240. signal. The CDR contains the current sigaction flags for the handler.
  6241. If action is provided, it is installed as the new handler for signum.
  6242. action can be a Scheme procedure taking one argument, or the value of
  6243. SIG_DFL (default action) or SIG_IGN (ignore), or #f to restore
  6244. whatever signal handler was installed before sigaction was first used.
  6245. Flags can optionally be specified for the new handler (SA_RESTART is
  6246. always used if the system provides it, so need not be specified.) The
  6247. return value is a pair with information about the old handler as
  6248. described above.
  6249. This interface does not provide access to the "signal blocking"
  6250. facility. Maybe this is not needed, since the thread support may
  6251. provide solutions to the problem of consistent access to data
  6252. structures.
  6253. *** A new procedure `flush-all-ports' is equivalent to running
  6254. `force-output' on every port open for output.
  6255. ** Guile now provides information on how it was built, via the new
  6256. global variable, %guile-build-info. This variable records the values
  6257. of the standard GNU makefile directory variables as an assocation
  6258. list, mapping variable names (symbols) onto directory paths (strings).
  6259. For example, to find out where the Guile link libraries were
  6260. installed, you can say:
  6261. guile -c "(display (assq-ref %guile-build-info 'libdir)) (newline)"
  6262. * Changes to the scm_ interface
  6263. ** The new function scm_handle_by_message_noexit is just like the
  6264. existing scm_handle_by_message function, except that it doesn't call
  6265. exit to terminate the process. Instead, it prints a message and just
  6266. returns #f. This might be a more appropriate catch-all handler for
  6267. new dynamic roots and threads.
  6268. Changes in Guile 1.1 (released Friday, May 16 1997):
  6269. * Changes to the distribution.
  6270. The Guile 1.0 distribution has been split up into several smaller
  6271. pieces:
  6272. guile-core --- the Guile interpreter itself.
  6273. guile-tcltk --- the interface between the Guile interpreter and
  6274. Tcl/Tk; Tcl is an interpreter for a stringy language, and Tk
  6275. is a toolkit for building graphical user interfaces.
  6276. guile-rgx-ctax --- the interface between Guile and the Rx regular
  6277. expression matcher, and the translator for the Ctax
  6278. programming language. These are packaged together because the
  6279. Ctax translator uses Rx to parse Ctax source code.
  6280. This NEWS file describes the changes made to guile-core since the 1.0
  6281. release.
  6282. We no longer distribute the documentation, since it was either out of
  6283. date, or incomplete. As soon as we have current documentation, we
  6284. will distribute it.
  6285. * Changes to the stand-alone interpreter
  6286. ** guile now accepts command-line arguments compatible with SCSH, Olin
  6287. Shivers' Scheme Shell.
  6288. In general, arguments are evaluated from left to right, but there are
  6289. exceptions. The following switches stop argument processing, and
  6290. stash all remaining command-line arguments as the value returned by
  6291. the (command-line) function.
  6292. -s SCRIPT load Scheme source code from FILE, and exit
  6293. -c EXPR evalute Scheme expression EXPR, and exit
  6294. -- stop scanning arguments; run interactively
  6295. The switches below are processed as they are encountered.
  6296. -l FILE load Scheme source code from FILE
  6297. -e FUNCTION after reading script, apply FUNCTION to
  6298. command line arguments
  6299. -ds do -s script at this point
  6300. --emacs enable Emacs protocol (experimental)
  6301. -h, --help display this help and exit
  6302. -v, --version display version information and exit
  6303. \ read arguments from following script lines
  6304. So, for example, here is a Guile script named `ekko' (thanks, Olin)
  6305. which re-implements the traditional "echo" command:
  6306. #!/usr/local/bin/guile -s
  6307. !#
  6308. (define (main args)
  6309. (map (lambda (arg) (display arg) (display " "))
  6310. (cdr args))
  6311. (newline))
  6312. (main (command-line))
  6313. Suppose we invoke this script as follows:
  6314. ekko a speckled gecko
  6315. Through the magic of Unix script processing (triggered by the `#!'
  6316. token at the top of the file), /usr/local/bin/guile receives the
  6317. following list of command-line arguments:
  6318. ("-s" "./ekko" "a" "speckled" "gecko")
  6319. Unix inserts the name of the script after the argument specified on
  6320. the first line of the file (in this case, "-s"), and then follows that
  6321. with the arguments given to the script. Guile loads the script, which
  6322. defines the `main' function, and then applies it to the list of
  6323. remaining command-line arguments, ("a" "speckled" "gecko").
  6324. In Unix, the first line of a script file must take the following form:
  6325. #!INTERPRETER ARGUMENT
  6326. where INTERPRETER is the absolute filename of the interpreter
  6327. executable, and ARGUMENT is a single command-line argument to pass to
  6328. the interpreter.
  6329. You may only pass one argument to the interpreter, and its length is
  6330. limited. These restrictions can be annoying to work around, so Guile
  6331. provides a general mechanism (borrowed from, and compatible with,
  6332. SCSH) for circumventing them.
  6333. If the ARGUMENT in a Guile script is a single backslash character,
  6334. `\', Guile will open the script file, parse arguments from its second
  6335. and subsequent lines, and replace the `\' with them. So, for example,
  6336. here is another implementation of the `ekko' script:
  6337. #!/usr/local/bin/guile \
  6338. -e main -s
  6339. !#
  6340. (define (main args)
  6341. (for-each (lambda (arg) (display arg) (display " "))
  6342. (cdr args))
  6343. (newline))
  6344. If the user invokes this script as follows:
  6345. ekko a speckled gecko
  6346. Unix expands this into
  6347. /usr/local/bin/guile \ ekko a speckled gecko
  6348. When Guile sees the `\' argument, it replaces it with the arguments
  6349. read from the second line of the script, producing:
  6350. /usr/local/bin/guile -e main -s ekko a speckled gecko
  6351. This tells Guile to load the `ekko' script, and apply the function
  6352. `main' to the argument list ("a" "speckled" "gecko").
  6353. Here is how Guile parses the command-line arguments:
  6354. - Each space character terminates an argument. This means that two
  6355. spaces in a row introduce an empty-string argument.
  6356. - The tab character is not permitted (unless you quote it with the
  6357. backslash character, as described below), to avoid confusion.
  6358. - The newline character terminates the sequence of arguments, and will
  6359. also terminate a final non-empty argument. (However, a newline
  6360. following a space will not introduce a final empty-string argument;
  6361. it only terminates the argument list.)
  6362. - The backslash character is the escape character. It escapes
  6363. backslash, space, tab, and newline. The ANSI C escape sequences
  6364. like \n and \t are also supported. These produce argument
  6365. constituents; the two-character combination \n doesn't act like a
  6366. terminating newline. The escape sequence \NNN for exactly three
  6367. octal digits reads as the character whose ASCII code is NNN. As
  6368. above, characters produced this way are argument constituents.
  6369. Backslash followed by other characters is not allowed.
  6370. * Changes to the procedure for linking libguile with your programs
  6371. ** Guile now builds and installs a shared guile library, if your
  6372. system support shared libraries. (It still builds a static library on
  6373. all systems.) Guile automatically detects whether your system
  6374. supports shared libraries. To prevent Guile from buildisg shared
  6375. libraries, pass the `--disable-shared' flag to the configure script.
  6376. Guile takes longer to compile when it builds shared libraries, because
  6377. it must compile every file twice --- once to produce position-
  6378. independent object code, and once to produce normal object code.
  6379. ** The libthreads library has been merged into libguile.
  6380. To link a program against Guile, you now need only link against
  6381. -lguile and -lqt; -lthreads is no longer needed. If you are using
  6382. autoconf to generate configuration scripts for your application, the
  6383. following lines should suffice to add the appropriate libraries to
  6384. your link command:
  6385. ### Find quickthreads and libguile.
  6386. AC_CHECK_LIB(qt, main)
  6387. AC_CHECK_LIB(guile, scm_shell)
  6388. * Changes to Scheme functions
  6389. ** Guile Scheme's special syntax for keyword objects is now optional,
  6390. and disabled by default.
  6391. The syntax variation from R4RS made it difficult to port some
  6392. interesting packages to Guile. The routines which accepted keyword
  6393. arguments (mostly in the module system) have been modified to also
  6394. accept symbols whose names begin with `:'.
  6395. To change the keyword syntax, you must first import the (ice-9 debug)
  6396. module:
  6397. (use-modules (ice-9 debug))
  6398. Then you can enable the keyword syntax as follows:
  6399. (read-set! keywords 'prefix)
  6400. To disable keyword syntax, do this:
  6401. (read-set! keywords #f)
  6402. ** Many more primitive functions accept shared substrings as
  6403. arguments. In the past, these functions required normal, mutable
  6404. strings as arguments, although they never made use of this
  6405. restriction.
  6406. ** The uniform array functions now operate on byte vectors. These
  6407. functions are `array-fill!', `serial-array-copy!', `array-copy!',
  6408. `serial-array-map', `array-map', `array-for-each', and
  6409. `array-index-map!'.
  6410. ** The new functions `trace' and `untrace' implement simple debugging
  6411. support for Scheme functions.
  6412. The `trace' function accepts any number of procedures as arguments,
  6413. and tells the Guile interpreter to display each procedure's name and
  6414. arguments each time the procedure is invoked. When invoked with no
  6415. arguments, `trace' returns the list of procedures currently being
  6416. traced.
  6417. The `untrace' function accepts any number of procedures as arguments,
  6418. and tells the Guile interpreter not to trace them any more. When
  6419. invoked with no arguments, `untrace' untraces all curretly traced
  6420. procedures.
  6421. The tracing in Guile has an advantage over most other systems: we
  6422. don't create new procedure objects, but mark the procedure objects
  6423. themselves. This means that anonymous and internal procedures can be
  6424. traced.
  6425. ** The function `assert-repl-prompt' has been renamed to
  6426. `set-repl-prompt!'. It takes one argument, PROMPT.
  6427. - If PROMPT is #f, the Guile read-eval-print loop will not prompt.
  6428. - If PROMPT is a string, we use it as a prompt.
  6429. - If PROMPT is a procedure accepting no arguments, we call it, and
  6430. display the result as a prompt.
  6431. - Otherwise, we display "> ".
  6432. ** The new function `eval-string' reads Scheme expressions from a
  6433. string and evaluates them, returning the value of the last expression
  6434. in the string. If the string contains no expressions, it returns an
  6435. unspecified value.
  6436. ** The new function `thunk?' returns true iff its argument is a
  6437. procedure of zero arguments.
  6438. ** `defined?' is now a builtin function, instead of syntax. This
  6439. means that its argument should be quoted. It returns #t iff its
  6440. argument is bound in the current module.
  6441. ** The new syntax `use-modules' allows you to add new modules to your
  6442. environment without re-typing a complete `define-module' form. It
  6443. accepts any number of module names as arguments, and imports their
  6444. public bindings into the current module.
  6445. ** The new function (module-defined? NAME MODULE) returns true iff
  6446. NAME, a symbol, is defined in MODULE, a module object.
  6447. ** The new function `builtin-bindings' creates and returns a hash
  6448. table containing copies of all the root module's bindings.
  6449. ** The new function `builtin-weak-bindings' does the same as
  6450. `builtin-bindings', but creates a doubly-weak hash table.
  6451. ** The `equal?' function now considers variable objects to be
  6452. equivalent if they have the same name and the same value.
  6453. ** The new function `command-line' returns the command-line arguments
  6454. given to Guile, as a list of strings.
  6455. When using guile as a script interpreter, `command-line' returns the
  6456. script's arguments; those processed by the interpreter (like `-s' or
  6457. `-c') are omitted. (In other words, you get the normal, expected
  6458. behavior.) Any application that uses scm_shell to process its
  6459. command-line arguments gets this behavior as well.
  6460. ** The new function `load-user-init' looks for a file called `.guile'
  6461. in the user's home directory, and loads it if it exists. This is
  6462. mostly for use by the code generated by scm_compile_shell_switches,
  6463. but we thought it might also be useful in other circumstances.
  6464. ** The new function `log10' returns the base-10 logarithm of its
  6465. argument.
  6466. ** Changes to I/O functions
  6467. *** The functions `read', `primitive-load', `read-and-eval!', and
  6468. `primitive-load-path' no longer take optional arguments controlling
  6469. case insensitivity and a `#' parser.
  6470. Case sensitivity is now controlled by a read option called
  6471. `case-insensitive'. The user can add new `#' syntaxes with the
  6472. `read-hash-extend' function (see below).
  6473. *** The new function `read-hash-extend' allows the user to change the
  6474. syntax of Guile Scheme in a somewhat controlled way.
  6475. (read-hash-extend CHAR PROC)
  6476. When parsing S-expressions, if we read a `#' character followed by
  6477. the character CHAR, use PROC to parse an object from the stream.
  6478. If PROC is #f, remove any parsing procedure registered for CHAR.
  6479. The reader applies PROC to two arguments: CHAR and an input port.
  6480. *** The new functions read-delimited and read-delimited! provide a
  6481. general mechanism for doing delimited input on streams.
  6482. (read-delimited DELIMS [PORT HANDLE-DELIM])
  6483. Read until we encounter one of the characters in DELIMS (a string),
  6484. or end-of-file. PORT is the input port to read from; it defaults to
  6485. the current input port. The HANDLE-DELIM parameter determines how
  6486. the terminating character is handled; it should be one of the
  6487. following symbols:
  6488. 'trim omit delimiter from result
  6489. 'peek leave delimiter character in input stream
  6490. 'concat append delimiter character to returned value
  6491. 'split return a pair: (RESULT . TERMINATOR)
  6492. HANDLE-DELIM defaults to 'peek.
  6493. (read-delimited! DELIMS BUF [PORT HANDLE-DELIM START END])
  6494. A side-effecting variant of `read-delimited'.
  6495. The data is written into the string BUF at the indices in the
  6496. half-open interval [START, END); the default interval is the whole
  6497. string: START = 0 and END = (string-length BUF). The values of
  6498. START and END must specify a well-defined interval in BUF, i.e.
  6499. 0 <= START <= END <= (string-length BUF).
  6500. It returns NBYTES, the number of bytes read. If the buffer filled
  6501. up without a delimiter character being found, it returns #f. If the
  6502. port is at EOF when the read starts, it returns the EOF object.
  6503. If an integer is returned (i.e., the read is successfully terminated
  6504. by reading a delimiter character), then the HANDLE-DELIM parameter
  6505. determines how to handle the terminating character. It is described
  6506. above, and defaults to 'peek.
  6507. (The descriptions of these functions were borrowed from the SCSH
  6508. manual, by Olin Shivers and Brian Carlstrom.)
  6509. *** The `%read-delimited!' function is the primitive used to implement
  6510. `read-delimited' and `read-delimited!'.
  6511. (%read-delimited! DELIMS BUF GOBBLE? [PORT START END])
  6512. This returns a pair of values: (TERMINATOR . NUM-READ).
  6513. - TERMINATOR describes why the read was terminated. If it is a
  6514. character or the eof object, then that is the value that terminated
  6515. the read. If it is #f, the function filled the buffer without finding
  6516. a delimiting character.
  6517. - NUM-READ is the number of characters read into BUF.
  6518. If the read is successfully terminated by reading a delimiter
  6519. character, then the gobble? parameter determines what to do with the
  6520. terminating character. If true, the character is removed from the
  6521. input stream; if false, the character is left in the input stream
  6522. where a subsequent read operation will retrieve it. In either case,
  6523. the character is also the first value returned by the procedure call.
  6524. (The descriptions of this function was borrowed from the SCSH manual,
  6525. by Olin Shivers and Brian Carlstrom.)
  6526. *** The `read-line' and `read-line!' functions have changed; they now
  6527. trim the terminator by default; previously they appended it to the
  6528. returned string. For the old behavior, use (read-line PORT 'concat).
  6529. *** The functions `uniform-array-read!' and `uniform-array-write!' now
  6530. take new optional START and END arguments, specifying the region of
  6531. the array to read and write.
  6532. *** The `ungetc-char-ready?' function has been removed. We feel it's
  6533. inappropriate for an interface to expose implementation details this
  6534. way.
  6535. ** Changes to the Unix library and system call interface
  6536. *** The new fcntl function provides access to the Unix `fcntl' system
  6537. call.
  6538. (fcntl PORT COMMAND VALUE)
  6539. Apply COMMAND to PORT's file descriptor, with VALUE as an argument.
  6540. Values for COMMAND are:
  6541. F_DUPFD duplicate a file descriptor
  6542. F_GETFD read the descriptor's close-on-exec flag
  6543. F_SETFD set the descriptor's close-on-exec flag to VALUE
  6544. F_GETFL read the descriptor's flags, as set on open
  6545. F_SETFL set the descriptor's flags, as set on open to VALUE
  6546. F_GETOWN return the process ID of a socket's owner, for SIGIO
  6547. F_SETOWN set the process that owns a socket to VALUE, for SIGIO
  6548. FD_CLOEXEC not sure what this is
  6549. For details, see the documentation for the fcntl system call.
  6550. *** The arguments to `select' have changed, for compatibility with
  6551. SCSH. The TIMEOUT parameter may now be non-integral, yielding the
  6552. expected behavior. The MILLISECONDS parameter has been changed to
  6553. MICROSECONDS, to more closely resemble the underlying system call.
  6554. The RVEC, WVEC, and EVEC arguments can now be vectors; the type of the
  6555. corresponding return set will be the same.
  6556. *** The arguments to the `mknod' system call have changed. They are
  6557. now:
  6558. (mknod PATH TYPE PERMS DEV)
  6559. Create a new file (`node') in the file system. PATH is the name of
  6560. the file to create. TYPE is the kind of file to create; it should
  6561. be 'fifo, 'block-special, or 'char-special. PERMS specifies the
  6562. permission bits to give the newly created file. If TYPE is
  6563. 'block-special or 'char-special, DEV specifies which device the
  6564. special file refers to; its interpretation depends on the kind of
  6565. special file being created.
  6566. *** The `fork' function has been renamed to `primitive-fork', to avoid
  6567. clashing with various SCSH forks.
  6568. *** The `recv' and `recvfrom' functions have been renamed to `recv!'
  6569. and `recvfrom!'. They no longer accept a size for a second argument;
  6570. you must pass a string to hold the received value. They no longer
  6571. return the buffer. Instead, `recv' returns the length of the message
  6572. received, and `recvfrom' returns a pair containing the packet's length
  6573. and originating address.
  6574. *** The file descriptor datatype has been removed, as have the
  6575. `read-fd', `write-fd', `close', `lseek', and `dup' functions.
  6576. We plan to replace these functions with a SCSH-compatible interface.
  6577. *** The `create' function has been removed; it's just a special case
  6578. of `open'.
  6579. *** There are new functions to break down process termination status
  6580. values. In the descriptions below, STATUS is a value returned by
  6581. `waitpid'.
  6582. (status:exit-val STATUS)
  6583. If the child process exited normally, this function returns the exit
  6584. code for the child process (i.e., the value passed to exit, or
  6585. returned from main). If the child process did not exit normally,
  6586. this function returns #f.
  6587. (status:stop-sig STATUS)
  6588. If the child process was suspended by a signal, this function
  6589. returns the signal that suspended the child. Otherwise, it returns
  6590. #f.
  6591. (status:term-sig STATUS)
  6592. If the child process terminated abnormally, this function returns
  6593. the signal that terminated the child. Otherwise, this function
  6594. returns false.
  6595. POSIX promises that exactly one of these functions will return true on
  6596. a valid STATUS value.
  6597. These functions are compatible with SCSH.
  6598. *** There are new accessors and setters for the broken-out time vectors
  6599. returned by `localtime', `gmtime', and that ilk. They are:
  6600. Component Accessor Setter
  6601. ========================= ============ ============
  6602. seconds tm:sec set-tm:sec
  6603. minutes tm:min set-tm:min
  6604. hours tm:hour set-tm:hour
  6605. day of the month tm:mday set-tm:mday
  6606. month tm:mon set-tm:mon
  6607. year tm:year set-tm:year
  6608. day of the week tm:wday set-tm:wday
  6609. day in the year tm:yday set-tm:yday
  6610. daylight saving time tm:isdst set-tm:isdst
  6611. GMT offset, seconds tm:gmtoff set-tm:gmtoff
  6612. name of time zone tm:zone set-tm:zone
  6613. *** There are new accessors for the vectors returned by `uname',
  6614. describing the host system:
  6615. Component Accessor
  6616. ============================================== ================
  6617. name of the operating system implementation utsname:sysname
  6618. network name of this machine utsname:nodename
  6619. release level of the operating system utsname:release
  6620. version level of the operating system utsname:version
  6621. machine hardware platform utsname:machine
  6622. *** There are new accessors for the vectors returned by `getpw',
  6623. `getpwnam', `getpwuid', and `getpwent', describing entries from the
  6624. system's user database:
  6625. Component Accessor
  6626. ====================== =================
  6627. user name passwd:name
  6628. user password passwd:passwd
  6629. user id passwd:uid
  6630. group id passwd:gid
  6631. real name passwd:gecos
  6632. home directory passwd:dir
  6633. shell program passwd:shell
  6634. *** There are new accessors for the vectors returned by `getgr',
  6635. `getgrnam', `getgrgid', and `getgrent', describing entries from the
  6636. system's group database:
  6637. Component Accessor
  6638. ======================= ============
  6639. group name group:name
  6640. group password group:passwd
  6641. group id group:gid
  6642. group members group:mem
  6643. *** There are new accessors for the vectors returned by `gethost',
  6644. `gethostbyaddr', `gethostbyname', and `gethostent', describing
  6645. internet hosts:
  6646. Component Accessor
  6647. ========================= ===============
  6648. official name of host hostent:name
  6649. alias list hostent:aliases
  6650. host address type hostent:addrtype
  6651. length of address hostent:length
  6652. list of addresses hostent:addr-list
  6653. *** There are new accessors for the vectors returned by `getnet',
  6654. `getnetbyaddr', `getnetbyname', and `getnetent', describing internet
  6655. networks:
  6656. Component Accessor
  6657. ========================= ===============
  6658. official name of net netent:name
  6659. alias list netent:aliases
  6660. net number type netent:addrtype
  6661. net number netent:net
  6662. *** There are new accessors for the vectors returned by `getproto',
  6663. `getprotobyname', `getprotobynumber', and `getprotoent', describing
  6664. internet protocols:
  6665. Component Accessor
  6666. ========================= ===============
  6667. official protocol name protoent:name
  6668. alias list protoent:aliases
  6669. protocol number protoent:proto
  6670. *** There are new accessors for the vectors returned by `getserv',
  6671. `getservbyname', `getservbyport', and `getservent', describing
  6672. internet protocols:
  6673. Component Accessor
  6674. ========================= ===============
  6675. official service name servent:name
  6676. alias list servent:aliases
  6677. port number servent:port
  6678. protocol to use servent:proto
  6679. *** There are new accessors for the sockaddr structures returned by
  6680. `accept', `getsockname', `getpeername', `recvfrom!':
  6681. Component Accessor
  6682. ======================================== ===============
  6683. address format (`family') sockaddr:fam
  6684. path, for file domain addresses sockaddr:path
  6685. address, for internet domain addresses sockaddr:addr
  6686. TCP or UDP port, for internet sockaddr:port
  6687. *** The `getpwent', `getgrent', `gethostent', `getnetent',
  6688. `getprotoent', and `getservent' functions now return #f at the end of
  6689. the user database. (They used to throw an exception.)
  6690. Note that calling MUMBLEent function is equivalent to calling the
  6691. corresponding MUMBLE function with no arguments.
  6692. *** The `setpwent', `setgrent', `sethostent', `setnetent',
  6693. `setprotoent', and `setservent' routines now take no arguments.
  6694. *** The `gethost', `getproto', `getnet', and `getserv' functions now
  6695. provide more useful information when they throw an exception.
  6696. *** The `lnaof' function has been renamed to `inet-lnaof'.
  6697. *** Guile now claims to have the `current-time' feature.
  6698. *** The `mktime' function now takes an optional second argument ZONE,
  6699. giving the time zone to use for the conversion. ZONE should be a
  6700. string, in the same format as expected for the "TZ" environment variable.
  6701. *** The `strptime' function now returns a pair (TIME . COUNT), where
  6702. TIME is the parsed time as a vector, and COUNT is the number of
  6703. characters from the string left unparsed. This function used to
  6704. return the remaining characters as a string.
  6705. *** The `gettimeofday' function has replaced the old `time+ticks' function.
  6706. The return value is now (SECONDS . MICROSECONDS); the fractional
  6707. component is no longer expressed in "ticks".
  6708. *** The `ticks/sec' constant has been removed, in light of the above change.
  6709. * Changes to the gh_ interface
  6710. ** gh_eval_str() now returns an SCM object which is the result of the
  6711. evaluation
  6712. ** gh_scm2str() now copies the Scheme data to a caller-provided C
  6713. array
  6714. ** gh_scm2newstr() now makes a C array, copies the Scheme data to it,
  6715. and returns the array
  6716. ** gh_scm2str0() is gone: there is no need to distinguish
  6717. null-terminated from non-null-terminated, since gh_scm2newstr() allows
  6718. the user to interpret the data both ways.
  6719. * Changes to the scm_ interface
  6720. ** The new function scm_symbol_value0 provides an easy way to get a
  6721. symbol's value from C code:
  6722. SCM scm_symbol_value0 (char *NAME)
  6723. Return the value of the symbol named by the null-terminated string
  6724. NAME in the current module. If the symbol named NAME is unbound in
  6725. the current module, return SCM_UNDEFINED.
  6726. ** The new function scm_sysintern0 creates new top-level variables,
  6727. without assigning them a value.
  6728. SCM scm_sysintern0 (char *NAME)
  6729. Create a new Scheme top-level variable named NAME. NAME is a
  6730. null-terminated string. Return the variable's value cell.
  6731. ** The function scm_internal_catch is the guts of catch. It handles
  6732. all the mechanics of setting up a catch target, invoking the catch
  6733. body, and perhaps invoking the handler if the body does a throw.
  6734. The function is designed to be usable from C code, but is general
  6735. enough to implement all the semantics Guile Scheme expects from throw.
  6736. TAG is the catch tag. Typically, this is a symbol, but this function
  6737. doesn't actually care about that.
  6738. BODY is a pointer to a C function which runs the body of the catch;
  6739. this is the code you can throw from. We call it like this:
  6740. BODY (BODY_DATA, JMPBUF)
  6741. where:
  6742. BODY_DATA is just the BODY_DATA argument we received; we pass it
  6743. through to BODY as its first argument. The caller can make
  6744. BODY_DATA point to anything useful that BODY might need.
  6745. JMPBUF is the Scheme jmpbuf object corresponding to this catch,
  6746. which we have just created and initialized.
  6747. HANDLER is a pointer to a C function to deal with a throw to TAG,
  6748. should one occur. We call it like this:
  6749. HANDLER (HANDLER_DATA, THROWN_TAG, THROW_ARGS)
  6750. where
  6751. HANDLER_DATA is the HANDLER_DATA argument we recevied; it's the
  6752. same idea as BODY_DATA above.
  6753. THROWN_TAG is the tag that the user threw to; usually this is
  6754. TAG, but it could be something else if TAG was #t (i.e., a
  6755. catch-all), or the user threw to a jmpbuf.
  6756. THROW_ARGS is the list of arguments the user passed to the THROW
  6757. function.
  6758. BODY_DATA is just a pointer we pass through to BODY. HANDLER_DATA
  6759. is just a pointer we pass through to HANDLER. We don't actually
  6760. use either of those pointers otherwise ourselves. The idea is
  6761. that, if our caller wants to communicate something to BODY or
  6762. HANDLER, it can pass a pointer to it as MUMBLE_DATA, which BODY and
  6763. HANDLER can then use. Think of it as a way to make BODY and
  6764. HANDLER closures, not just functions; MUMBLE_DATA points to the
  6765. enclosed variables.
  6766. Of course, it's up to the caller to make sure that any data a
  6767. MUMBLE_DATA needs is protected from GC. A common way to do this is
  6768. to make MUMBLE_DATA a pointer to data stored in an automatic
  6769. structure variable; since the collector must scan the stack for
  6770. references anyway, this assures that any references in MUMBLE_DATA
  6771. will be found.
  6772. ** The new function scm_internal_lazy_catch is exactly like
  6773. scm_internal_catch, except:
  6774. - It does not unwind the stack (this is the major difference).
  6775. - If handler returns, its value is returned from the throw.
  6776. - BODY always receives #f as its JMPBUF argument (since there's no
  6777. jmpbuf associated with a lazy catch, because we don't unwind the
  6778. stack.)
  6779. ** scm_body_thunk is a new body function you can pass to
  6780. scm_internal_catch if you want the body to be like Scheme's `catch'
  6781. --- a thunk, or a function of one argument if the tag is #f.
  6782. BODY_DATA is a pointer to a scm_body_thunk_data structure, which
  6783. contains the Scheme procedure to invoke as the body, and the tag
  6784. we're catching. If the tag is #f, then we pass JMPBUF (created by
  6785. scm_internal_catch) to the body procedure; otherwise, the body gets
  6786. no arguments.
  6787. ** scm_handle_by_proc is a new handler function you can pass to
  6788. scm_internal_catch if you want the handler to act like Scheme's catch
  6789. --- call a procedure with the tag and the throw arguments.
  6790. If the user does a throw to this catch, this function runs a handler
  6791. procedure written in Scheme. HANDLER_DATA is a pointer to an SCM
  6792. variable holding the Scheme procedure object to invoke. It ought to
  6793. be a pointer to an automatic variable (i.e., one living on the stack),
  6794. or the procedure object should be otherwise protected from GC.
  6795. ** scm_handle_by_message is a new handler function to use with
  6796. `scm_internal_catch' if you want Guile to print a message and die.
  6797. It's useful for dealing with throws to uncaught keys at the top level.
  6798. HANDLER_DATA, if non-zero, is assumed to be a char * pointing to a
  6799. message header to print; if zero, we use "guile" instead. That
  6800. text is followed by a colon, then the message described by ARGS.
  6801. ** The return type of scm_boot_guile is now void; the function does
  6802. not return a value, and indeed, never returns at all.
  6803. ** The new function scm_shell makes it easy for user applications to
  6804. process command-line arguments in a way that is compatible with the
  6805. stand-alone guile interpreter (which is in turn compatible with SCSH,
  6806. the Scheme shell).
  6807. To use the scm_shell function, first initialize any guile modules
  6808. linked into your application, and then call scm_shell with the values
  6809. of ARGC and ARGV your `main' function received. scm_shell will add
  6810. any SCSH-style meta-arguments from the top of the script file to the
  6811. argument vector, and then process the command-line arguments. This
  6812. generally means loading a script file or starting up an interactive
  6813. command interpreter. For details, see "Changes to the stand-alone
  6814. interpreter" above.
  6815. ** The new functions scm_get_meta_args and scm_count_argv help you
  6816. implement the SCSH-style meta-argument, `\'.
  6817. char **scm_get_meta_args (int ARGC, char **ARGV)
  6818. If the second element of ARGV is a string consisting of a single
  6819. backslash character (i.e. "\\" in Scheme notation), open the file
  6820. named by the following argument, parse arguments from it, and return
  6821. the spliced command line. The returned array is terminated by a
  6822. null pointer.
  6823. For details of argument parsing, see above, under "guile now accepts
  6824. command-line arguments compatible with SCSH..."
  6825. int scm_count_argv (char **ARGV)
  6826. Count the arguments in ARGV, assuming it is terminated by a null
  6827. pointer.
  6828. For an example of how these functions might be used, see the source
  6829. code for the function scm_shell in libguile/script.c.
  6830. You will usually want to use scm_shell instead of calling this
  6831. function yourself.
  6832. ** The new function scm_compile_shell_switches turns an array of
  6833. command-line arguments into Scheme code to carry out the actions they
  6834. describe. Given ARGC and ARGV, it returns a Scheme expression to
  6835. evaluate, and calls scm_set_program_arguments to make any remaining
  6836. command-line arguments available to the Scheme code. For example,
  6837. given the following arguments:
  6838. -e main -s ekko a speckled gecko
  6839. scm_set_program_arguments will return the following expression:
  6840. (begin (load "ekko") (main (command-line)) (quit))
  6841. You will usually want to use scm_shell instead of calling this
  6842. function yourself.
  6843. ** The function scm_shell_usage prints a usage message appropriate for
  6844. an interpreter that uses scm_compile_shell_switches to handle its
  6845. command-line arguments.
  6846. void scm_shell_usage (int FATAL, char *MESSAGE)
  6847. Print a usage message to the standard error output. If MESSAGE is
  6848. non-zero, write it before the usage message, followed by a newline.
  6849. If FATAL is non-zero, exit the process, using FATAL as the
  6850. termination status. (If you want to be compatible with Guile,
  6851. always use 1 as the exit status when terminating due to command-line
  6852. usage problems.)
  6853. You will usually want to use scm_shell instead of calling this
  6854. function yourself.
  6855. ** scm_eval_0str now returns SCM_UNSPECIFIED if the string contains no
  6856. expressions. It used to return SCM_EOL. Earth-shattering.
  6857. ** The macros for declaring scheme objects in C code have been
  6858. rearranged slightly. They are now:
  6859. SCM_SYMBOL (C_NAME, SCHEME_NAME)
  6860. Declare a static SCM variable named C_NAME, and initialize it to
  6861. point to the Scheme symbol whose name is SCHEME_NAME. C_NAME should
  6862. be a C identifier, and SCHEME_NAME should be a C string.
  6863. SCM_GLOBAL_SYMBOL (C_NAME, SCHEME_NAME)
  6864. Just like SCM_SYMBOL, but make C_NAME globally visible.
  6865. SCM_VCELL (C_NAME, SCHEME_NAME)
  6866. Create a global variable at the Scheme level named SCHEME_NAME.
  6867. Declare a static SCM variable named C_NAME, and initialize it to
  6868. point to the Scheme variable's value cell.
  6869. SCM_GLOBAL_VCELL (C_NAME, SCHEME_NAME)
  6870. Just like SCM_VCELL, but make C_NAME globally visible.
  6871. The `guile-snarf' script writes initialization code for these macros
  6872. to its standard output, given C source code as input.
  6873. The SCM_GLOBAL macro is gone.
  6874. ** The scm_read_line and scm_read_line_x functions have been replaced
  6875. by Scheme code based on the %read-delimited! procedure (known to C
  6876. code as scm_read_delimited_x). See its description above for more
  6877. information.
  6878. ** The function scm_sys_open has been renamed to scm_open. It now
  6879. returns a port instead of an FD object.
  6880. * The dynamic linking support has changed. For more information, see
  6881. libguile/DYNAMIC-LINKING.
  6882. Guile 1.0b3
  6883. User-visible changes from Thursday, September 5, 1996 until Guile 1.0
  6884. (Sun 5 Jan 1997):
  6885. * Changes to the 'guile' program:
  6886. ** Guile now loads some new files when it starts up. Guile first
  6887. searches the load path for init.scm, and loads it if found. Then, if
  6888. Guile is not being used to execute a script, and the user's home
  6889. directory contains a file named `.guile', Guile loads that.
  6890. ** You can now use Guile as a shell script interpreter.
  6891. To paraphrase the SCSH manual:
  6892. When Unix tries to execute an executable file whose first two
  6893. characters are the `#!', it treats the file not as machine code to
  6894. be directly executed by the native processor, but as source code
  6895. to be executed by some interpreter. The interpreter to use is
  6896. specified immediately after the #! sequence on the first line of
  6897. the source file. The kernel reads in the name of the interpreter,
  6898. and executes that instead. It passes the interpreter the source
  6899. filename as its first argument, with the original arguments
  6900. following. Consult the Unix man page for the `exec' system call
  6901. for more information.
  6902. Now you can use Guile as an interpreter, using a mechanism which is a
  6903. compatible subset of that provided by SCSH.
  6904. Guile now recognizes a '-s' command line switch, whose argument is the
  6905. name of a file of Scheme code to load. It also treats the two
  6906. characters `#!' as the start of a comment, terminated by `!#'. Thus,
  6907. to make a file of Scheme code directly executable by Unix, insert the
  6908. following two lines at the top of the file:
  6909. #!/usr/local/bin/guile -s
  6910. !#
  6911. Guile treats the argument of the `-s' command-line switch as the name
  6912. of a file of Scheme code to load, and treats the sequence `#!' as the
  6913. start of a block comment, terminated by `!#'.
  6914. For example, here's a version of 'echo' written in Scheme:
  6915. #!/usr/local/bin/guile -s
  6916. !#
  6917. (let loop ((args (cdr (program-arguments))))
  6918. (if (pair? args)
  6919. (begin
  6920. (display (car args))
  6921. (if (pair? (cdr args))
  6922. (display " "))
  6923. (loop (cdr args)))))
  6924. (newline)
  6925. Why does `#!' start a block comment terminated by `!#', instead of the
  6926. end of the line? That is the notation SCSH uses, and although we
  6927. don't yet support the other SCSH features that motivate that choice,
  6928. we would like to be backward-compatible with any existing Guile
  6929. scripts once we do. Furthermore, if the path to Guile on your system
  6930. is too long for your kernel, you can start the script with this
  6931. horrible hack:
  6932. #!/bin/sh
  6933. exec /really/long/path/to/guile -s "$0" ${1+"$@"}
  6934. !#
  6935. Note that some very old Unix systems don't support the `#!' syntax.
  6936. ** You can now run Guile without installing it.
  6937. Previous versions of the interactive Guile interpreter (`guile')
  6938. couldn't start up unless Guile's Scheme library had been installed;
  6939. they used the value of the environment variable `SCHEME_LOAD_PATH'
  6940. later on in the startup process, but not to find the startup code
  6941. itself. Now Guile uses `SCHEME_LOAD_PATH' in all searches for Scheme
  6942. code.
  6943. To run Guile without installing it, build it in the normal way, and
  6944. then set the environment variable `SCHEME_LOAD_PATH' to a
  6945. colon-separated list of directories, including the top-level directory
  6946. of the Guile sources. For example, if you unpacked Guile so that the
  6947. full filename of this NEWS file is /home/jimb/guile-1.0b3/NEWS, then
  6948. you might say
  6949. export SCHEME_LOAD_PATH=/home/jimb/my-scheme:/home/jimb/guile-1.0b3
  6950. ** Guile's read-eval-print loop no longer prints #<unspecified>
  6951. results. If the user wants to see this, she can evaluate the
  6952. expression (assert-repl-print-unspecified #t), perhaps in her startup
  6953. file.
  6954. ** Guile no longer shows backtraces by default when an error occurs;
  6955. however, it does display a message saying how to get one, and how to
  6956. request that they be displayed by default. After an error, evaluate
  6957. (backtrace)
  6958. to see a backtrace, and
  6959. (debug-enable 'backtrace)
  6960. to see them by default.
  6961. * Changes to Guile Scheme:
  6962. ** Guile now distinguishes between #f and the empty list.
  6963. This is for compatibility with the IEEE standard, the (possibly)
  6964. upcoming Revised^5 Report on Scheme, and many extant Scheme
  6965. implementations.
  6966. Guile used to have #f and '() denote the same object, to make Scheme's
  6967. type system more compatible with Emacs Lisp's. However, the change
  6968. caused too much trouble for Scheme programmers, and we found another
  6969. way to reconcile Emacs Lisp with Scheme that didn't require this.
  6970. ** Guile's delq, delv, delete functions, and their destructive
  6971. counterparts, delq!, delv!, and delete!, now remove all matching
  6972. elements from the list, not just the first. This matches the behavior
  6973. of the corresponding Emacs Lisp functions, and (I believe) the Maclisp
  6974. functions which inspired them.
  6975. I recognize that this change may break code in subtle ways, but it
  6976. seems best to make the change before the FSF's first Guile release,
  6977. rather than after.
  6978. ** The compiled-library-path function has been deleted from libguile.
  6979. ** The facilities for loading Scheme source files have changed.
  6980. *** The variable %load-path now tells Guile which directories to search
  6981. for Scheme code. Its value is a list of strings, each of which names
  6982. a directory.
  6983. *** The variable %load-extensions now tells Guile which extensions to
  6984. try appending to a filename when searching the load path. Its value
  6985. is a list of strings. Its default value is ("" ".scm").
  6986. *** (%search-load-path FILENAME) searches the directories listed in the
  6987. value of the %load-path variable for a Scheme file named FILENAME,
  6988. with all the extensions listed in %load-extensions. If it finds a
  6989. match, then it returns its full filename. If FILENAME is absolute, it
  6990. returns it unchanged. Otherwise, it returns #f.
  6991. %search-load-path will not return matches that refer to directories.
  6992. *** (primitive-load FILENAME :optional CASE-INSENSITIVE-P SHARP)
  6993. uses %seach-load-path to find a file named FILENAME, and loads it if
  6994. it finds it. If it can't read FILENAME for any reason, it throws an
  6995. error.
  6996. The arguments CASE-INSENSITIVE-P and SHARP are interpreted as by the
  6997. `read' function.
  6998. *** load uses the same searching semantics as primitive-load.
  6999. *** The functions %try-load, try-load-with-path, %load, load-with-path,
  7000. basic-try-load-with-path, basic-load-with-path, try-load-module-with-
  7001. path, and load-module-with-path have been deleted. The functions
  7002. above should serve their purposes.
  7003. *** If the value of the variable %load-hook is a procedure,
  7004. `primitive-load' applies its value to the name of the file being
  7005. loaded (without the load path directory name prepended). If its value
  7006. is #f, it is ignored. Otherwise, an error occurs.
  7007. This is mostly useful for printing load notification messages.
  7008. ** The function `eval!' is no longer accessible from the scheme level.
  7009. We can't allow operations which introduce glocs into the scheme level,
  7010. because Guile's type system can't handle these as data. Use `eval' or
  7011. `read-and-eval!' (see below) as replacement.
  7012. ** The new function read-and-eval! reads an expression from PORT,
  7013. evaluates it, and returns the result. This is more efficient than
  7014. simply calling `read' and `eval', since it is not necessary to make a
  7015. copy of the expression for the evaluator to munge.
  7016. Its optional arguments CASE_INSENSITIVE_P and SHARP are interpreted as
  7017. for the `read' function.
  7018. ** The function `int?' has been removed; its definition was identical
  7019. to that of `integer?'.
  7020. ** The functions `<?', `<?', `<=?', `=?', `>?', and `>=?'. Code should
  7021. use the R4RS names for these functions.
  7022. ** The function object-properties no longer returns the hash handle;
  7023. it simply returns the object's property list.
  7024. ** Many functions have been changed to throw errors, instead of
  7025. returning #f on failure. The point of providing exception handling in
  7026. the language is to simplify the logic of user code, but this is less
  7027. useful if Guile's primitives don't throw exceptions.
  7028. ** The function `fileno' has been renamed from `%fileno'.
  7029. ** The function primitive-mode->fdes returns #t or #f now, not 1 or 0.
  7030. * Changes to Guile's C interface:
  7031. ** The library's initialization procedure has been simplified.
  7032. scm_boot_guile now has the prototype:
  7033. void scm_boot_guile (int ARGC,
  7034. char **ARGV,
  7035. void (*main_func) (),
  7036. void *closure);
  7037. scm_boot_guile calls MAIN_FUNC, passing it CLOSURE, ARGC, and ARGV.
  7038. MAIN_FUNC should do all the work of the program (initializing other
  7039. packages, reading user input, etc.) before returning. When MAIN_FUNC
  7040. returns, call exit (0); this function never returns. If you want some
  7041. other exit value, MAIN_FUNC may call exit itself.
  7042. scm_boot_guile arranges for program-arguments to return the strings
  7043. given by ARGC and ARGV. If MAIN_FUNC modifies ARGC/ARGV, should call
  7044. scm_set_program_arguments with the final list, so Scheme code will
  7045. know which arguments have been processed.
  7046. scm_boot_guile establishes a catch-all catch handler which prints an
  7047. error message and exits the process. This means that Guile exits in a
  7048. coherent way when system errors occur and the user isn't prepared to
  7049. handle it. If the user doesn't like this behavior, they can establish
  7050. their own universal catcher in MAIN_FUNC to shadow this one.
  7051. Why must the caller do all the real work from MAIN_FUNC? The garbage
  7052. collector assumes that all local variables of type SCM will be above
  7053. scm_boot_guile's stack frame on the stack. If you try to manipulate
  7054. SCM values after this function returns, it's the luck of the draw
  7055. whether the GC will be able to find the objects you allocate. So,
  7056. scm_boot_guile function exits, rather than returning, to discourage
  7057. people from making that mistake.
  7058. The IN, OUT, and ERR arguments were removed; there are other
  7059. convenient ways to override these when desired.
  7060. The RESULT argument was deleted; this function should never return.
  7061. The BOOT_CMD argument was deleted; the MAIN_FUNC argument is more
  7062. general.
  7063. ** Guile's header files should no longer conflict with your system's
  7064. header files.
  7065. In order to compile code which #included <libguile.h>, previous
  7066. versions of Guile required you to add a directory containing all the
  7067. Guile header files to your #include path. This was a problem, since
  7068. Guile's header files have names which conflict with many systems'
  7069. header files.
  7070. Now only <libguile.h> need appear in your #include path; you must
  7071. refer to all Guile's other header files as <libguile/mumble.h>.
  7072. Guile's installation procedure puts libguile.h in $(includedir), and
  7073. the rest in $(includedir)/libguile.
  7074. ** Two new C functions, scm_protect_object and scm_unprotect_object,
  7075. have been added to the Guile library.
  7076. scm_protect_object (OBJ) protects OBJ from the garbage collector.
  7077. OBJ will not be freed, even if all other references are dropped,
  7078. until someone does scm_unprotect_object (OBJ). Both functions
  7079. return OBJ.
  7080. Note that calls to scm_protect_object do not nest. You can call
  7081. scm_protect_object any number of times on a given object, and the
  7082. next call to scm_unprotect_object will unprotect it completely.
  7083. Basically, scm_protect_object and scm_unprotect_object just
  7084. maintain a list of references to things. Since the GC knows about
  7085. this list, all objects it mentions stay alive. scm_protect_object
  7086. adds its argument to the list; scm_unprotect_object remove its
  7087. argument from the list.
  7088. ** scm_eval_0str now returns the value of the last expression
  7089. evaluated.
  7090. ** The new function scm_read_0str reads an s-expression from a
  7091. null-terminated string, and returns it.
  7092. ** The new function `scm_stdio_to_port' converts a STDIO file pointer
  7093. to a Scheme port object.
  7094. ** The new function `scm_set_program_arguments' allows C code to set
  7095. the value returned by the Scheme `program-arguments' function.
  7096. Older changes:
  7097. * Guile no longer includes sophisticated Tcl/Tk support.
  7098. The old Tcl/Tk support was unsatisfying to us, because it required the
  7099. user to link against the Tcl library, as well as Tk and Guile. The
  7100. interface was also un-lispy, in that it preserved Tcl/Tk's practice of
  7101. referring to widgets by names, rather than exporting widgets to Scheme
  7102. code as a special datatype.
  7103. In the Usenix Tk Developer's Workshop held in July 1996, the Tcl/Tk
  7104. maintainers described some very interesting changes in progress to the
  7105. Tcl/Tk internals, which would facilitate clean interfaces between lone
  7106. Tk and other interpreters --- even for garbage-collected languages
  7107. like Scheme. They expected the new Tk to be publicly available in the
  7108. fall of 1996.
  7109. Since it seems that Guile might soon have a new, cleaner interface to
  7110. lone Tk, and that the old Guile/Tk glue code would probably need to be
  7111. completely rewritten, we (Jim Blandy and Richard Stallman) have
  7112. decided not to support the old code. We'll spend the time instead on
  7113. a good interface to the newer Tk, as soon as it is available.
  7114. Until then, gtcltk-lib provides trivial, low-maintenance functionality.
  7115. Copyright information:
  7116. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
  7117. Permission is granted to anyone to make or distribute verbatim copies
  7118. of this document as received, in any medium, provided that the
  7119. copyright notice and this permission notice are preserved,
  7120. thus giving the recipient permission to redistribute in turn.
  7121. Permission is granted to distribute modified versions
  7122. of this document, or of portions of it,
  7123. under the above conditions, provided also that they
  7124. carry prominent notices stating who last changed them.
  7125. Local variables:
  7126. mode: outline
  7127. paragraph-separate: "[ ]*$"
  7128. end: