NEWS 270 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398
  1. Guile NEWS --- history of user-visible changes.
  2. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 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 1.8.7 (since 1.8.6)
  6. * Bugs fixed
  7. ** Fix %fast-slot-ref/set!, to avoid possible segmentation fault
  8. ** Fix MinGW build problem caused by HAVE_STRUCT_TIMESPEC confusion
  9. ** Fix build problem when scm_t_timespec is different from struct timespec
  10. ** Fix build when compiled with -Wundef -Werror
  11. ** Allow @ macro to work with (ice-9 syncase)
  12. Previously, use of the @ macro in a module whose code is being
  13. transformed by (ice-9 syncase) would cause an "Invalid syntax" error.
  14. Now it works as you would expect (giving the value of the specified
  15. module binding).
  16. ** Have `scm_take_locale_symbol ()' return an interned symbol (bug #25865)
  17. ** Fix potential deadlocks when running on multiple threads
  18. Changes in 1.8.6 (since 1.8.5)
  19. * New features (see the manual for details)
  20. ** New convenience function `scm_c_symbol_length ()'
  21. ** Single stepping through code from Emacs
  22. When you use GDS to evaluate Scheme code from Emacs, you can now use
  23. `C-u' to indicate that you want to single step through that code. See
  24. `Evaluating Scheme Code' in the manual for more details.
  25. ** New "guile(1)" man page!
  26. * Changes to the distribution
  27. ** Automake's `AM_MAINTAINER_MODE' is no longer used
  28. Thus, the `--enable-maintainer-mode' configure option is no longer
  29. available: Guile is now always configured in "maintainer mode".
  30. ** `ChangeLog' files are no longer updated
  31. Instead, changes are detailed in the version control system's logs. See
  32. the top-level `ChangeLog' files for details.
  33. * Bugs fixed
  34. ** `symbol->string' now returns a read-only string, as per R5RS
  35. ** Fix incorrect handling of the FLAGS argument of `fold-matches'
  36. ** `guile-config link' now prints `-L$libdir' before `-lguile'
  37. ** Fix memory corruption involving GOOPS' `class-redefinition'
  38. ** Fix possible deadlock in `mutex-lock'
  39. ** Fix build issue on Tru64 and ia64-hp-hpux11.23 (`SCM_UNPACK' macro)
  40. ** Fix build issue on mips, mipsel, powerpc and ia64 (stack direction)
  41. ** Fix build issue on hppa2.0w-hp-hpux11.11 (`dirent64' and `readdir64_r')
  42. ** Fix build issue on i386-unknown-freebsd7.0 ("break strict-aliasing rules")
  43. ** Fix misleading output from `(help rationalize)'
  44. ** Fix build failure on Debian hppa architecture (bad stack growth detection)
  45. ** Fix `gcd' when called with a single, negative argument.
  46. ** Fix `Stack overflow' errors seen when building on some platforms
  47. ** Fix bug when `scm_with_guile ()' was called several times from the
  48. same thread
  49. ** The handler of SRFI-34 `with-exception-handler' is now invoked in the
  50. dynamic environment of the call to `raise'
  51. ** Fix potential deadlock in `make-struct'
  52. ** Fix compilation problem with libltdl from Libtool 2.2.x
  53. ** Fix sloppy bound checking in `string-{ref,set!}' with the empty string
  54. Changes in 1.8.5 (since 1.8.4)
  55. * Infrastructure changes
  56. ** Guile repository switched from CVS to Git
  57. The new repository can be accessed using
  58. "git-clone git://git.sv.gnu.org/guile.git", or can be browsed on-line at
  59. http://git.sv.gnu.org/gitweb/?p=guile.git . See `README' for details.
  60. ** Add support for `pkg-config'
  61. See "Autoconf Support" in the manual for details.
  62. * New modules (see the manual for details)
  63. ** `(srfi srfi-88)'
  64. * New features (see the manual for details)
  65. ** New `postfix' read option, for SRFI-88 keyword syntax
  66. ** Some I/O primitives have been inlined, which improves I/O performance
  67. ** New object-based traps infrastructure
  68. This is a GOOPS-based infrastructure that builds on Guile's low-level
  69. evaluator trap calls and facilitates the development of debugging
  70. features like single-stepping, breakpoints, tracing and profiling.
  71. See the `Traps' node of the manual for details.
  72. ** New support for working on Guile code from within Emacs
  73. Guile now incorporates the `GDS' library (previously distributed
  74. separately) for working on Guile code from within Emacs. See the
  75. `Using Guile In Emacs' node of the manual for details.
  76. * Bugs fixed
  77. ** `scm_add_slot ()' no longer segfaults (fixes bug #22369)
  78. ** Fixed `(ice-9 match)' for patterns like `((_ ...) ...)'
  79. Previously, expressions like `(match '((foo) (bar)) (((_ ...) ...) #t))'
  80. would trigger an unbound variable error for `match:andmap'.
  81. ** `(oop goops describe)' now properly provides the `describe' feature
  82. ** Fixed `args-fold' from `(srfi srfi-37)'
  83. Previously, parsing short option names of argument-less options would
  84. lead to a stack overflow.
  85. ** `(srfi srfi-35)' is now visible through `cond-expand'
  86. ** Fixed type-checking for the second argument of `eval'
  87. ** Fixed type-checking for SRFI-1 `partition'
  88. ** Fixed `struct-ref' and `struct-set!' on "light structs"
  89. ** Honor struct field access rights in GOOPS
  90. ** Changed the storage strategy of source properties, which fixes a deadlock
  91. ** Allow compilation of Guile-using programs in C99 mode with GCC 4.3 and later
  92. ** Fixed build issue for GNU/Linux on IA64
  93. ** Fixed build issues on NetBSD 1.6
  94. ** Fixed build issue on Solaris 2.10 x86_64
  95. ** Fixed build issue with DEC/Compaq/HP's compiler
  96. ** Fixed `scm_from_complex_double' build issue on FreeBSD
  97. ** Fixed `alloca' build issue on FreeBSD 6
  98. ** Removed use of non-portable makefile constructs
  99. ** Fixed shadowing of libc's <random.h> on Tru64, which broke compilation
  100. ** Make sure all tests honor `$TMPDIR'
  101. * Changes to the distribution
  102. ** New FAQ
  103. We've started collecting Frequently Asked Questions (FAQ), and will
  104. distribute these (with answers!) in future Guile releases.
  105. Changes in 1.8.4 (since 1.8.3)
  106. * Bugs fixed
  107. ** CR (ASCII 0x0d) is (again) recognized as a token delimiter by the reader
  108. ** Fixed a segmentation fault which occurred when displaying the
  109. backtrace of a stack with a promise object (made by `delay') in it.
  110. ** Make `accept' leave guile mode while blocking
  111. ** `scm_c_read ()' and `scm_c_write ()' now type-check their port argument
  112. ** Fixed a build problem on AIX (use of func_data identifier)
  113. ** Fixed a segmentation fault which occurred when hashx-ref or hashx-set! was
  114. called with an associator proc that returns neither a pair nor #f.
  115. ** Secondary threads now always return a valid module for (current-module).
  116. ** Avoid MacOS build problems caused by incorrect combination of "64"
  117. system and library calls.
  118. ** `guile-snarf' now honors `$TMPDIR'
  119. ** `guile-config compile' now reports CPPFLAGS used at compile-time
  120. ** Fixed build with Sun Studio (Solaris 9)
  121. ** Fixed wrong-type-arg errors when creating zero length SRFI-4
  122. uniform vectors on AIX.
  123. ** Fixed a deadlock that occurs upon GC with multiple threads.
  124. ** Fixed compile problem with GCC on Solaris and AIX (use of _Complex_I)
  125. ** Fixed autotool-derived build problems on AIX 6.1.
  126. ** Fixed NetBSD/alpha support
  127. ** Fixed MacOS build problem caused by use of rl_get_keymap(_name)
  128. * New modules (see the manual for details)
  129. ** `(srfi srfi-69)'
  130. * Documentation fixes and improvements
  131. ** Removed premature breakpoint documentation
  132. The features described are not available in the series of 1.8.x
  133. releases, so the documentation was misleading and has been removed.
  134. ** More about Guile's default *random-state* variable
  135. ** GOOPS: more about how to use `next-method'
  136. * Changes to the distribution
  137. ** Corrected a few files that referred incorrectly to the old GPL + special exception licence
  138. In fact Guile since 1.8.0 has been licensed with the GNU Lesser
  139. General Public License, and the few incorrect files have now been
  140. fixed to agree with the rest of the Guile distribution.
  141. ** Removed unnecessary extra copies of COPYING*
  142. The distribution now contains a single COPYING.LESSER at its top level.
  143. Changes in 1.8.3 (since 1.8.2)
  144. * New modules (see the manual for details)
  145. ** `(srfi srfi-35)'
  146. ** `(srfi srfi-37)'
  147. * Bugs fixed
  148. ** The `(ice-9 slib)' module now works as expected
  149. ** Expressions like "(set! 'x #t)" no longer yield a crash
  150. ** Warnings about duplicate bindings now go to stderr
  151. ** A memory leak in `make-socket-address' was fixed
  152. ** Alignment issues (e.g., on SPARC) in network routines were fixed
  153. ** A threading issue that showed up at least on NetBSD was fixed
  154. ** Build problems on Solaris and IRIX fixed
  155. * Implementation improvements
  156. ** The reader is now faster, which reduces startup time
  157. ** Procedures returned by `record-accessor' and `record-modifier' are faster
  158. Changes in 1.8.2 (since 1.8.1):
  159. * New procedures (see the manual for details)
  160. ** set-program-arguments
  161. ** make-vtable
  162. * Incompatible changes
  163. ** The body of a top-level `define' no longer sees the binding being created
  164. In a top-level `define', the binding being created is no longer visible
  165. from the `define' body. This breaks code like
  166. "(define foo (begin (set! foo 1) (+ foo 1)))", where `foo' is now
  167. unbound in the body. However, such code was not R5RS-compliant anyway,
  168. per Section 5.2.1.
  169. * Bugs fixed
  170. ** Fractions were not `equal?' if stored in unreduced form.
  171. (A subtle problem, since printing a value reduced it, making it work.)
  172. ** srfi-60 `copy-bit' failed on 64-bit systems
  173. ** "guile --use-srfi" option at the REPL can replace core functions
  174. (Programs run with that option were ok, but in the interactive REPL
  175. the core bindings got priority, preventing SRFI replacements or
  176. extensions.)
  177. ** `regexp-exec' doesn't abort() on #\nul in the input or bad flags arg
  178. ** `kill' on mingw throws an error for a PID other than oneself
  179. ** Procedure names are attached to procedure-with-setters
  180. ** Array read syntax works with negative lower bound
  181. ** `array-in-bounds?' fix if an array has different lower bounds on each index
  182. ** `*' returns exact 0 for "(* inexact 0)"
  183. This follows what it always did for "(* 0 inexact)".
  184. ** SRFI-19: Value returned by `(current-time time-process)' was incorrect
  185. ** SRFI-19: `date->julian-day' did not account for timezone offset
  186. ** `ttyname' no longer crashes when passed a non-tty argument
  187. ** `inet-ntop' no longer crashes on SPARC when passed an `AF_INET' address
  188. ** Small memory leaks have been fixed in `make-fluid' and `add-history'
  189. ** GOOPS: Fixed a bug in `method-more-specific?'
  190. ** Build problems on Solaris fixed
  191. ** Build problems on HP-UX IA64 fixed
  192. ** Build problems on MinGW fixed
  193. Changes in 1.8.1 (since 1.8.0):
  194. * LFS functions are now used to access 64-bit files on 32-bit systems.
  195. * New procedures (see the manual for details)
  196. ** primitive-_exit - [Scheme] the-root-module
  197. ** scm_primitive__exit - [C]
  198. ** make-completion-function - [Scheme] (ice-9 readline)
  199. ** scm_c_locale_stringn_to_number - [C]
  200. ** scm_srfi1_append_reverse [C]
  201. ** scm_srfi1_append_reverse_x [C]
  202. ** scm_log - [C]
  203. ** scm_log10 - [C]
  204. ** scm_exp - [C]
  205. ** scm_sqrt - [C]
  206. * Bugs fixed
  207. ** Build problems have been fixed on MacOS, SunOS, and QNX.
  208. ** `strftime' fix sign of %z timezone offset.
  209. ** A one-dimensional array can now be 'equal?' to a vector.
  210. ** Structures, records, and SRFI-9 records can now be compared with `equal?'.
  211. ** SRFI-14 standard char sets are recomputed upon a successful `setlocale'.
  212. ** `record-accessor' and `record-modifier' now have strict type checks.
  213. Record accessor and modifier procedures now throw an error if the
  214. record type of the record they're given is not the type expected.
  215. (Previously accessors returned #f and modifiers silently did nothing).
  216. ** It is now OK to use both autoload and use-modules on a given module.
  217. ** `apply' checks the number of arguments more carefully on "0 or 1" funcs.
  218. Previously there was no checking on primatives like make-vector that
  219. accept "one or two" arguments. Now there is.
  220. ** The srfi-1 assoc function now calls its equality predicate properly.
  221. Previously srfi-1 assoc would call the equality predicate with the key
  222. last. According to the SRFI, the key should be first.
  223. ** A bug in n-par-for-each and n-for-each-par-map has been fixed.
  224. ** The array-set! procedure no longer segfaults when given a bit vector.
  225. ** Bugs in make-shared-array have been fixed.
  226. ** string<? and friends now follow char<? etc order on 8-bit chars.
  227. ** The format procedure now handles inf and nan values for ~f correctly.
  228. ** exact->inexact should no longer overflow when given certain large fractions.
  229. ** srfi-9 accessor and modifier procedures now have strict record type checks.
  230. This matches the srfi-9 specification.
  231. ** (ice-9 ftw) procedures won't ignore different files with same inode number.
  232. Previously the (ice-9 ftw) procedures would ignore any file that had
  233. the same inode number as a file they had already seen, even if that
  234. file was on a different device.
  235. Changes in 1.8.0 (changes since the 1.6.x series):
  236. * Changes to the distribution
  237. ** Guile is now licensed with the GNU Lesser General Public License.
  238. ** The manual is now licensed with the GNU Free Documentation License.
  239. ** Guile now requires GNU MP (http://swox.com/gmp).
  240. Guile now uses the GNU MP library for arbitrary precision arithmetic.
  241. ** Guile now has separate private and public configuration headers.
  242. That is, things like HAVE_STRING_H no longer leak from Guile's
  243. headers.
  244. ** Guile now provides and uses an "effective" version number.
  245. Guile now provides scm_effective_version and effective-version
  246. functions which return the "effective" version number. This is just
  247. the normal full version string without the final micro-version number,
  248. so the current effective-version is "1.8". The effective version
  249. should remain unchanged during a stable series, and should be used for
  250. items like the versioned share directory name
  251. i.e. /usr/share/guile/1.8.
  252. Providing an unchanging version number during a stable release for
  253. things like the versioned share directory can be particularly
  254. important for Guile "add-on" packages, since it provides a directory
  255. that they can install to that won't be changed out from under them
  256. with each micro release during a stable series.
  257. ** Thread implementation has changed.
  258. When you configure "--with-threads=null", you will get the usual
  259. threading API (call-with-new-thread, make-mutex, etc), but you can't
  260. actually create new threads. Also, "--with-threads=no" is now
  261. equivalent to "--with-threads=null". This means that the thread API
  262. is always present, although you might not be able to create new
  263. threads.
  264. When you configure "--with-threads=pthreads" or "--with-threads=yes",
  265. you will get threads that are implemented with the portable POSIX
  266. threads. These threads can run concurrently (unlike the previous
  267. "coop" thread implementation), but need to cooperate for things like
  268. the GC.
  269. The default is "pthreads", unless your platform doesn't have pthreads,
  270. in which case "null" threads are used.
  271. See the manual for details, nodes "Initialization", "Multi-Threading",
  272. "Blocking", and others.
  273. ** There is the new notion of 'discouraged' features.
  274. This is a milder form of deprecation.
  275. Things that are discouraged should not be used in new code, but it is
  276. OK to leave them in old code for now. When a discouraged feature is
  277. used, no warning message is printed like there is for 'deprecated'
  278. features. Also, things that are merely discouraged are nevertheless
  279. implemented efficiently, while deprecated features can be very slow.
  280. You can omit discouraged features from libguile by configuring it with
  281. the '--disable-discouraged' option.
  282. ** Deprecation warnings can be controlled at run-time.
  283. (debug-enable 'warn-deprecated) switches them on and (debug-disable
  284. 'warn-deprecated) switches them off.
  285. ** Support for SRFI 61, extended cond syntax for multiple values has
  286. been added.
  287. This SRFI is always available.
  288. ** Support for require-extension, SRFI-55, has been added.
  289. The SRFI-55 special form `require-extension' has been added. It is
  290. available at startup, and provides a portable way to load Scheme
  291. extensions. SRFI-55 only requires support for one type of extension,
  292. "srfi"; so a set of SRFIs may be loaded via (require-extension (srfi 1
  293. 13 14)).
  294. ** New module (srfi srfi-26) provides support for `cut' and `cute'.
  295. The (srfi srfi-26) module is an implementation of SRFI-26 which
  296. provides the `cut' and `cute' syntax. These may be used to specialize
  297. parameters without currying.
  298. ** New module (srfi srfi-31)
  299. This is an implementation of SRFI-31 which provides a special form
  300. `rec' for recursive evaluation.
  301. ** The modules (srfi srfi-13), (srfi srfi-14) and (srfi srfi-4) have
  302. been merged with the core, making their functionality always
  303. available.
  304. The modules are still available, tho, and you could use them together
  305. with a renaming import, for example.
  306. ** Guile no longer includes its own version of libltdl.
  307. The official version is good enough now.
  308. ** The --enable-htmldoc option has been removed from 'configure'.
  309. Support for translating the documentation into HTML is now always
  310. provided. Use 'make html'.
  311. ** New module (ice-9 serialize):
  312. (serialize FORM1 ...) and (parallelize FORM1 ...) are useful when you
  313. don't trust the thread safety of most of your program, but where you
  314. have some section(s) of code which you consider can run in parallel to
  315. other sections. See ice-9/serialize.scm for more information.
  316. ** The configure option '--disable-arrays' has been removed.
  317. Support for arrays and uniform numeric arrays is now always included
  318. in Guile.
  319. * Changes to the stand-alone interpreter
  320. ** New command line option `-L'.
  321. This option adds a directory to the front of the load path.
  322. ** New command line option `--no-debug'.
  323. Specifying `--no-debug' on the command line will keep the debugging
  324. evaluator turned off, even for interactive sessions.
  325. ** User-init file ~/.guile is now loaded with the debugging evaluator.
  326. Previously, the normal evaluator would have been used. Using the
  327. debugging evaluator gives better error messages.
  328. ** The '-e' option now 'read's its argument.
  329. This is to allow the new '(@ MODULE-NAME VARIABLE-NAME)' construct to
  330. be used with '-e'. For example, you can now write a script like
  331. #! /bin/sh
  332. exec guile -e '(@ (demo) main)' -s "$0" "$@"
  333. !#
  334. (define-module (demo)
  335. :export (main))
  336. (define (main args)
  337. (format #t "Demo: ~a~%" args))
  338. * Changes to Scheme functions and syntax
  339. ** Guardians have changed back to their original semantics
  340. Guardians now behave like described in the paper by Dybvig et al. In
  341. particular, they no longer make guarantees about the order in which
  342. they return objects, and they can no longer be greedy.
  343. They no longer drop cyclic data structures.
  344. The C function scm_make_guardian has been changed incompatibly and no
  345. longer takes the 'greedy_p' argument.
  346. ** New function hashx-remove!
  347. This function completes the set of 'hashx' functions.
  348. ** The concept of dynamic roots has been factored into continuation
  349. barriers and dynamic states.
  350. Each thread has a current dynamic state that carries the values of the
  351. fluids. You can create and copy dynamic states and use them as the
  352. second argument for 'eval'. See "Fluids and Dynamic States" in the
  353. manual.
  354. To restrict the influence that captured continuations can have on the
  355. control flow, you can errect continuation barriers. See "Continuation
  356. Barriers" in the manual.
  357. The function call-with-dynamic-root now essentially temporarily
  358. installs a new dynamic state and errects a continuation barrier.
  359. ** The default load path no longer includes "." at the end.
  360. Automatically loading modules from the current directory should not
  361. happen by default. If you want to allow it in a more controlled
  362. manner, set the environment variable GUILE_LOAD_PATH or the Scheme
  363. variable %load-path.
  364. ** The uniform vector and array support has been overhauled.
  365. It now complies with SRFI-4 and the weird prototype based uniform
  366. array creation has been deprecated. See the manual for more details.
  367. Some non-compatible changes have been made:
  368. - characters can no longer be stored into byte arrays.
  369. - strings and bit vectors are no longer considered to be uniform numeric
  370. vectors.
  371. - array-rank throws an error for non-arrays instead of returning zero.
  372. - array-ref does no longer accept non-arrays when no indices are given.
  373. There is the new notion of 'generalized vectors' and corresponding
  374. procedures like 'generalized-vector-ref'. Generalized vectors include
  375. strings, bitvectors, ordinary vectors, and uniform numeric vectors.
  376. Arrays use generalized vectors as their storage, so that you still
  377. have arrays of characters, bits, etc. However, uniform-array-read!
  378. and uniform-array-write can no longer read/write strings and
  379. bitvectors.
  380. ** There is now support for copy-on-write substrings, mutation-sharing
  381. substrings and read-only strings.
  382. Three new procedures are related to this: substring/shared,
  383. substring/copy, and substring/read-only. See the manual for more
  384. information.
  385. ** Backtraces will now highlight the value that caused the error.
  386. By default, these values are enclosed in "{...}", such as in this
  387. example:
  388. guile> (car 'a)
  389. Backtrace:
  390. In current input:
  391. 1: 0* [car {a}]
  392. <unnamed port>:1:1: In procedure car in expression (car (quote a)):
  393. <unnamed port>:1:1: Wrong type (expecting pair): a
  394. ABORT: (wrong-type-arg)
  395. The prefix and suffix used for highlighting can be set via the two new
  396. printer options 'highlight-prefix' and 'highlight-suffix'. For
  397. example, putting this into ~/.guile will output the bad value in bold
  398. on an ANSI terminal:
  399. (print-set! highlight-prefix "\x1b[1m")
  400. (print-set! highlight-suffix "\x1b[22m")
  401. ** 'gettext' support for internationalization has been added.
  402. See the manual for details.
  403. ** New syntax '@' and '@@':
  404. You can now directly refer to variables exported from a module by
  405. writing
  406. (@ MODULE-NAME VARIABLE-NAME)
  407. For example (@ (ice-9 pretty-print) pretty-print) will directly access
  408. the pretty-print variable exported from the (ice-9 pretty-print)
  409. module. You don't need to 'use' that module first. You can also use
  410. '@' as a target of 'set!', as in (set! (@ mod var) val).
  411. The related syntax (@@ MODULE-NAME VARIABLE-NAME) works just like '@',
  412. but it can also access variables that have not been exported. It is
  413. intended only for kluges and temporary fixes and for debugging, not
  414. for ordinary code.
  415. ** Keyword syntax has been made more disciplined.
  416. Previously, the name of a keyword was read as a 'token' but printed as
  417. a symbol. Now, it is read as a general Scheme datum which must be a
  418. symbol.
  419. Previously:
  420. guile> #:12
  421. #:#{12}#
  422. guile> #:#{12}#
  423. #:#{\#{12}\#}#
  424. guile> #:(a b c)
  425. #:#{}#
  426. ERROR: In expression (a b c):
  427. Unbound variable: a
  428. guile> #: foo
  429. #:#{}#
  430. ERROR: Unbound variable: foo
  431. Now:
  432. guile> #:12
  433. ERROR: Wrong type (expecting symbol): 12
  434. guile> #:#{12}#
  435. #:#{12}#
  436. guile> #:(a b c)
  437. ERROR: Wrong type (expecting symbol): (a b c)
  438. guile> #: foo
  439. #:foo
  440. ** The printing of symbols that might look like keywords can be
  441. controlled.
  442. The new printer option 'quote-keywordish-symbols' controls how symbols
  443. are printed that have a colon as their first or last character. The
  444. default now is to only quote a symbol with #{...}# when the read
  445. option 'keywords' is not '#f'. Thus:
  446. guile> (define foo (string->symbol ":foo"))
  447. guile> (read-set! keywords #f)
  448. guile> foo
  449. :foo
  450. guile> (read-set! keywords 'prefix)
  451. guile> foo
  452. #{:foo}#
  453. guile> (print-set! quote-keywordish-symbols #f)
  454. guile> foo
  455. :foo
  456. ** 'while' now provides 'break' and 'continue'
  457. break and continue were previously bound in a while loop, but not
  458. documented, and continue didn't quite work properly. The undocumented
  459. parameter to break which gave a return value for the while has been
  460. dropped.
  461. ** 'call-with-current-continuation' is now also available under the name
  462. 'call/cc'.
  463. ** The module system now checks for duplicate bindings.
  464. The module system now can check for name conflicts among imported
  465. bindings.
  466. The behavior can be controlled by specifying one or more 'duplicates'
  467. handlers. For example, to make Guile return an error for every name
  468. collision, write:
  469. (define-module (foo)
  470. :use-module (bar)
  471. :use-module (baz)
  472. :duplicates check)
  473. The new default behavior of the module system when a name collision
  474. has been detected is to
  475. 1. Give priority to bindings marked as a replacement.
  476. 2. Issue a warning (different warning if overriding core binding).
  477. 3. Give priority to the last encountered binding (this corresponds to
  478. the old behavior).
  479. If you want the old behavior back without replacements or warnings you
  480. can add the line:
  481. (default-duplicate-binding-handler 'last)
  482. to your .guile init file.
  483. ** New define-module option: :replace
  484. :replace works as :export, but, in addition, marks the binding as a
  485. replacement.
  486. A typical example is `format' in (ice-9 format) which is a replacement
  487. for the core binding `format'.
  488. ** Adding prefixes to imported bindings in the module system
  489. There is now a new :use-module option :prefix. It can be used to add
  490. a prefix to all imported bindings.
  491. (define-module (foo)
  492. :use-module ((bar) :prefix bar:))
  493. will import all bindings exported from bar, but rename them by adding
  494. the prefix `bar:'.
  495. ** Conflicting generic functions can be automatically merged.
  496. When two imported bindings conflict and they are both generic
  497. functions, the two functions can now be merged automatically. This is
  498. activated with the 'duplicates' handler 'merge-generics'.
  499. ** New function: effective-version
  500. Returns the "effective" version number. This is just the normal full
  501. version string without the final micro-version number. See "Changes
  502. to the distribution" above.
  503. ** New threading functions: parallel, letpar, par-map, and friends
  504. These are convenient ways to run calculations in parallel in new
  505. threads. See "Parallel forms" in the manual for details.
  506. ** New function 'try-mutex'.
  507. This function will attempt to lock a mutex but will return immediately
  508. instead of blocking and indicate failure.
  509. ** Waiting on a condition variable can have a timeout.
  510. The function 'wait-condition-variable' now takes a third, optional
  511. argument that specifies the point in time where the waiting should be
  512. aborted.
  513. ** New function 'broadcast-condition-variable'.
  514. ** New functions 'all-threads' and 'current-thread'.
  515. ** Signals and system asyncs work better with threads.
  516. The function 'sigaction' now takes a fourth, optional, argument that
  517. specifies the thread that the handler should run in. When the
  518. argument is omitted, the handler will run in the thread that called
  519. 'sigaction'.
  520. Likewise, 'system-async-mark' takes a second, optional, argument that
  521. specifies the thread that the async should run in. When it is
  522. omitted, the async will run in the thread that called
  523. 'system-async-mark'.
  524. C code can use the new functions scm_sigaction_for_thread and
  525. scm_system_async_mark_for_thread to pass the new thread argument.
  526. When a thread blocks on a mutex, a condition variable or is waiting
  527. for IO to be possible, it will still execute system asyncs. This can
  528. be used to interrupt such a thread by making it execute a 'throw', for
  529. example.
  530. ** The function 'system-async' is deprecated.
  531. You can now pass any zero-argument procedure to 'system-async-mark'.
  532. The function 'system-async' will just return its argument unchanged
  533. now.
  534. ** New functions 'call-with-blocked-asyncs' and
  535. 'call-with-unblocked-asyncs'
  536. The expression (call-with-blocked-asyncs PROC) will call PROC and will
  537. block execution of system asyncs for the current thread by one level
  538. while PROC runs. Likewise, call-with-unblocked-asyncs will call a
  539. procedure and will unblock the execution of system asyncs by one
  540. level for the current thread.
  541. Only system asyncs are affected by these functions.
  542. ** The functions 'mask-signals' and 'unmask-signals' are deprecated.
  543. Use 'call-with-blocked-asyncs' or 'call-with-unblocked-asyncs'
  544. instead. Those functions are easier to use correctly and can be
  545. nested.
  546. ** New function 'unsetenv'.
  547. ** New macro 'define-syntax-public'.
  548. It works like 'define-syntax' and also exports the defined macro (but
  549. only on top-level).
  550. ** There is support for Infinity and NaNs.
  551. Following PLT Scheme, Guile can now work with infinite numbers, and
  552. 'not-a-numbers'.
  553. There is new syntax for numbers: "+inf.0" (infinity), "-inf.0"
  554. (negative infinity), "+nan.0" (not-a-number), and "-nan.0" (same as
  555. "+nan.0"). These numbers are inexact and have no exact counterpart.
  556. Dividing by an inexact zero returns +inf.0 or -inf.0, depending on the
  557. sign of the dividend. The infinities are integers, and they answer #t
  558. for both 'even?' and 'odd?'. The +nan.0 value is not an integer and is
  559. not '=' to itself, but '+nan.0' is 'eqv?' to itself.
  560. For example
  561. (/ 1 0.0)
  562. => +inf.0
  563. (/ 0 0.0)
  564. => +nan.0
  565. (/ 0)
  566. ERROR: Numerical overflow
  567. Two new predicates 'inf?' and 'nan?' can be used to test for the
  568. special values.
  569. ** Inexact zero can have a sign.
  570. Guile can now distinguish between plus and minus inexact zero, if your
  571. platform supports this, too. The two zeros are equal according to
  572. '=', but not according to 'eqv?'. For example
  573. (- 0.0)
  574. => -0.0
  575. (= 0.0 (- 0.0))
  576. => #t
  577. (eqv? 0.0 (- 0.0))
  578. => #f
  579. ** Guile now has exact rationals.
  580. Guile can now represent fractions such as 1/3 exactly. Computing with
  581. them is also done exactly, of course:
  582. (* 1/3 3/2)
  583. => 1/2
  584. ** 'floor', 'ceiling', 'round' and 'truncate' now return exact numbers
  585. for exact arguments.
  586. For example: (floor 2) now returns an exact 2 where in the past it
  587. returned an inexact 2.0. Likewise, (floor 5/4) returns an exact 1.
  588. ** inexact->exact no longer returns only integers.
  589. Without exact rationals, the closest exact number was always an
  590. integer, but now inexact->exact returns the fraction that is exactly
  591. equal to a floating point number. For example:
  592. (inexact->exact 1.234)
  593. => 694680242521899/562949953421312
  594. When you want the old behavior, use 'round' explicitly:
  595. (inexact->exact (round 1.234))
  596. => 1
  597. ** New function 'rationalize'.
  598. This function finds a simple fraction that is close to a given real
  599. number. For example (and compare with inexact->exact above):
  600. (rationalize (inexact->exact 1.234) 1/2000)
  601. => 58/47
  602. Note that, as required by R5RS, rationalize returns only then an exact
  603. result when both its arguments are exact.
  604. ** 'odd?' and 'even?' work also for inexact integers.
  605. Previously, (odd? 1.0) would signal an error since only exact integers
  606. were recognized as integers. Now (odd? 1.0) returns #t, (odd? 2.0)
  607. returns #f and (odd? 1.5) signals an error.
  608. ** Guile now has uninterned symbols.
  609. The new function 'make-symbol' will return an uninterned symbol. This
  610. is a symbol that is unique and is guaranteed to remain unique.
  611. However, uninterned symbols can not yet be read back in.
  612. Use the new function 'symbol-interned?' to check whether a symbol is
  613. interned or not.
  614. ** pretty-print has more options.
  615. The function pretty-print from the (ice-9 pretty-print) module can now
  616. also be invoked with keyword arguments that control things like
  617. maximum output width. See the manual for details.
  618. ** Variables have no longer a special behavior for `equal?'.
  619. Previously, comparing two variables with `equal?' would recursivly
  620. compare their values. This is no longer done. Variables are now only
  621. `equal?' if they are `eq?'.
  622. ** `(begin)' is now valid.
  623. You can now use an empty `begin' form. It will yield #<unspecified>
  624. when evaluated and simply be ignored in a definition context.
  625. ** Deprecated: procedure->macro
  626. Change your code to use 'define-macro' or r5rs macros. Also, be aware
  627. that macro expansion will not be done during evaluation, but prior to
  628. evaluation.
  629. ** Soft ports now allow a `char-ready?' procedure
  630. The vector argument to `make-soft-port' can now have a length of
  631. either 5 or 6. (Previously the length had to be 5.) The optional 6th
  632. element is interpreted as an `input-waiting' thunk -- i.e. a thunk
  633. that returns the number of characters that can be read immediately
  634. without the soft port blocking.
  635. ** Deprecated: undefine
  636. There is no replacement for undefine.
  637. ** The functions make-keyword-from-dash-symbol and keyword-dash-symbol
  638. have been discouraged.
  639. They are relics from a time where a keyword like #:foo was used
  640. directly as a Tcl option "-foo" and thus keywords were internally
  641. stored as a symbol with a starting dash. We now store a symbol
  642. without the dash.
  643. Use symbol->keyword and keyword->symbol instead.
  644. ** The `cheap' debug option is now obsolete
  645. Evaluator trap calls are now unconditionally "cheap" - in other words,
  646. they pass a debug object to the trap handler rather than a full
  647. continuation. The trap handler code can capture a full continuation
  648. by using `call-with-current-continuation' in the usual way, if it so
  649. desires.
  650. The `cheap' option is retained for now so as not to break existing
  651. code which gets or sets it, but setting it now has no effect. It will
  652. be removed in the next major Guile release.
  653. ** Evaluator trap calls now support `tweaking'
  654. `Tweaking' means that the trap handler code can modify the Scheme
  655. expression that is about to be evaluated (in the case of an
  656. enter-frame trap) or the value that is being returned (in the case of
  657. an exit-frame trap). The trap handler code indicates that it wants to
  658. do this by returning a pair whose car is the symbol 'instead and whose
  659. cdr is the modified expression or return value.
  660. * Changes to the C interface
  661. ** The functions scm_hash_fn_remove_x and scm_hashx_remove_x no longer
  662. take a 'delete' function argument.
  663. This argument makes no sense since the delete function is used to
  664. remove a pair from an alist, and this must not be configurable.
  665. This is an incompatible change.
  666. ** The GH interface is now subject to the deprecation mechanism
  667. The GH interface has been deprecated for quite some time but now it is
  668. actually removed from Guile when it is configured with
  669. --disable-deprecated.
  670. See the manual "Transitioning away from GH" for more information.
  671. ** A new family of functions for converting between C values and
  672. Scheme values has been added.
  673. These functions follow a common naming scheme and are designed to be
  674. easier to use, thread-safe and more future-proof than the older
  675. alternatives.
  676. - int scm_is_* (...)
  677. These are predicates that return a C boolean: 1 or 0. Instead of
  678. SCM_NFALSEP, you can now use scm_is_true, for example.
  679. - <type> scm_to_<type> (SCM val, ...)
  680. These are functions that convert a Scheme value into an appropriate
  681. C value. For example, you can use scm_to_int to safely convert from
  682. a SCM to an int.
  683. - SCM scm_from_<type> (<type> val, ...)
  684. These functions convert from a C type to a SCM value; for example,
  685. scm_from_int for ints.
  686. There is a huge number of these functions, for numbers, strings,
  687. symbols, vectors, etc. They are documented in the reference manual in
  688. the API section together with the types that they apply to.
  689. ** New functions for dealing with complex numbers in C have been added.
  690. The new functions are scm_c_make_rectangular, scm_c_make_polar,
  691. scm_c_real_part, scm_c_imag_part, scm_c_magnitude and scm_c_angle.
  692. They work like scm_make_rectangular etc but take or return doubles
  693. directly.
  694. ** The function scm_make_complex has been discouraged.
  695. Use scm_c_make_rectangular instead.
  696. ** The INUM macros have been deprecated.
  697. A lot of code uses these macros to do general integer conversions,
  698. although the macros only work correctly with fixnums. Use the
  699. following alternatives.
  700. SCM_INUMP -> scm_is_integer or similar
  701. SCM_NINUMP -> !scm_is_integer or similar
  702. SCM_MAKINUM -> scm_from_int or similar
  703. SCM_INUM -> scm_to_int or similar
  704. SCM_VALIDATE_INUM_* -> Do not use these; scm_to_int, etc. will
  705. do the validating for you.
  706. ** The scm_num2<type> and scm_<type>2num functions and scm_make_real
  707. have been discouraged.
  708. Use the newer scm_to_<type> and scm_from_<type> functions instead for
  709. new code. The functions have been discouraged since they don't fit
  710. the naming scheme.
  711. ** The 'boolean' macros SCM_FALSEP etc have been discouraged.
  712. They have strange names, especially SCM_NFALSEP, and SCM_BOOLP
  713. evaluates its argument twice. Use scm_is_true, etc. instead for new
  714. code.
  715. ** The macro SCM_EQ_P has been discouraged.
  716. Use scm_is_eq for new code, which fits better into the naming
  717. conventions.
  718. ** The macros SCM_CONSP, SCM_NCONSP, SCM_NULLP, and SCM_NNULLP have
  719. been discouraged.
  720. Use the function scm_is_pair or scm_is_null instead.
  721. ** The functions scm_round and scm_truncate have been deprecated and
  722. are now available as scm_c_round and scm_c_truncate, respectively.
  723. These functions occupy the names that scm_round_number and
  724. scm_truncate_number should have.
  725. ** The functions scm_c_string2str, scm_c_substring2str, and
  726. scm_c_symbol2str have been deprecated.
  727. Use scm_to_locale_stringbuf or similar instead, maybe together with
  728. scm_substring.
  729. ** New functions scm_c_make_string, scm_c_string_length,
  730. scm_c_string_ref, scm_c_string_set_x, scm_c_substring,
  731. scm_c_substring_shared, scm_c_substring_copy.
  732. These are like scm_make_string, scm_length, etc. but are slightly
  733. easier to use from C.
  734. ** The macros SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_LENGTH,
  735. SCM_SYMBOL_CHARS, and SCM_SYMBOL_LENGTH have been deprecated.
  736. They export too many assumptions about the implementation of strings
  737. and symbols that are no longer true in the presence of
  738. mutation-sharing substrings and when Guile switches to some form of
  739. Unicode.
  740. When working with strings, it is often best to use the normal string
  741. functions provided by Guile, such as scm_c_string_ref,
  742. scm_c_string_set_x, scm_string_append, etc. Be sure to look in the
  743. manual since many more such functions are now provided than
  744. previously.
  745. When you want to convert a SCM string to a C string, use the
  746. scm_to_locale_string function or similar instead. For symbols, use
  747. scm_symbol_to_string and then work with that string. Because of the
  748. new string representation, scm_symbol_to_string does not need to copy
  749. and is thus quite efficient.
  750. ** Some string, symbol and keyword functions have been discouraged.
  751. They don't fit into the uniform naming scheme and are not explicit
  752. about the character encoding.
  753. Replace according to the following table:
  754. scm_allocate_string -> scm_c_make_string
  755. scm_take_str -> scm_take_locale_stringn
  756. scm_take0str -> scm_take_locale_string
  757. scm_mem2string -> scm_from_locale_stringn
  758. scm_str2string -> scm_from_locale_string
  759. scm_makfrom0str -> scm_from_locale_string
  760. scm_mem2symbol -> scm_from_locale_symboln
  761. scm_mem2uninterned_symbol -> scm_from_locale_stringn + scm_make_symbol
  762. scm_str2symbol -> scm_from_locale_symbol
  763. SCM_SYMBOL_HASH -> scm_hashq
  764. SCM_SYMBOL_INTERNED_P -> scm_symbol_interned_p
  765. scm_c_make_keyword -> scm_from_locale_keyword
  766. ** The functions scm_keyword_to_symbol and sym_symbol_to_keyword are
  767. now also available to C code.
  768. ** SCM_KEYWORDP and SCM_KEYWORDSYM have been deprecated.
  769. Use scm_is_keyword and scm_keyword_to_symbol instead, but note that
  770. the latter returns the true name of the keyword, not the 'dash name',
  771. as SCM_KEYWORDSYM used to do.
  772. ** A new way to access arrays in a thread-safe and efficient way has
  773. been added.
  774. See the manual, node "Accessing Arrays From C".
  775. ** The old uniform vector and bitvector implementations have been
  776. unceremoniously removed.
  777. This implementation exposed the details of the tagging system of
  778. Guile. Use the new C API explained in the manual in node "Uniform
  779. Numeric Vectors" and "Bit Vectors", respectively.
  780. The following macros are gone: SCM_UVECTOR_BASE, SCM_SET_UVECTOR_BASE,
  781. SCM_UVECTOR_MAXLENGTH, SCM_UVECTOR_LENGTH, SCM_MAKE_UVECTOR_TAG,
  782. SCM_SET_UVECTOR_LENGTH, SCM_BITVECTOR_P, SCM_BITVECTOR_BASE,
  783. SCM_SET_BITVECTOR_BASE, SCM_BITVECTOR_MAX_LENGTH,
  784. SCM_BITVECTOR_LENGTH, SCM_MAKE_BITVECTOR_TAG,
  785. SCM_SET_BITVECTOR_LENGTH, SCM_BITVEC_REF, SCM_BITVEC_SET,
  786. SCM_BITVEC_CLR.
  787. ** The macros dealing with vectors have been deprecated.
  788. Use the new functions scm_is_vector, scm_vector_elements,
  789. scm_vector_writable_elements, etc, or scm_is_simple_vector,
  790. SCM_SIMPLE_VECTOR_REF, SCM_SIMPLE_VECTOR_SET, etc instead. See the
  791. manual for more details.
  792. Deprecated are SCM_VECTORP, SCM_VELTS, SCM_VECTOR_MAX_LENGTH,
  793. SCM_VECTOR_LENGTH, SCM_VECTOR_REF, SCM_VECTOR_SET, SCM_WRITABLE_VELTS.
  794. The following macros have been removed: SCM_VECTOR_BASE,
  795. SCM_SET_VECTOR_BASE, SCM_MAKE_VECTOR_TAG, SCM_SET_VECTOR_LENGTH,
  796. SCM_VELTS_AS_STACKITEMS, SCM_SETVELTS, SCM_GC_WRITABLE_VELTS.
  797. ** Some C functions and macros related to arrays have been deprecated.
  798. Migrate according to the following table:
  799. scm_make_uve -> scm_make_typed_array, scm_make_u8vector etc.
  800. scm_make_ra -> scm_make_array
  801. scm_shap2ra -> scm_make_array
  802. scm_cvref -> scm_c_generalized_vector_ref
  803. scm_ra_set_contp -> do not use
  804. scm_aind -> scm_array_handle_pos
  805. scm_raprin1 -> scm_display or scm_write
  806. SCM_ARRAYP -> scm_is_array
  807. SCM_ARRAY_NDIM -> scm_c_array_rank
  808. SCM_ARRAY_DIMS -> scm_array_handle_dims
  809. SCM_ARRAY_CONTP -> do not use
  810. SCM_ARRAY_MEM -> do not use
  811. SCM_ARRAY_V -> scm_array_handle_elements or similar
  812. SCM_ARRAY_BASE -> do not use
  813. ** SCM_CELL_WORD_LOC has been deprecated.
  814. Use the new macro SCM_CELL_OBJECT_LOC instead, which returns a pointer
  815. to a SCM, as opposed to a pointer to a scm_t_bits.
  816. This was done to allow the correct use of pointers into the Scheme
  817. heap. Previously, the heap words were of type scm_t_bits and local
  818. variables and function arguments were of type SCM, making it
  819. non-standards-conformant to have a pointer that can point to both.
  820. ** New macros SCM_SMOB_DATA_2, SCM_SMOB_DATA_3, etc.
  821. These macros should be used instead of SCM_CELL_WORD_2/3 to access the
  822. second and third words of double smobs. Likewise for
  823. SCM_SET_SMOB_DATA_2 and SCM_SET_SMOB_DATA_3.
  824. Also, there is SCM_SMOB_FLAGS and SCM_SET_SMOB_FLAGS that should be
  825. used to get and set the 16 exra bits in the zeroth word of a smob.
  826. And finally, there is SCM_SMOB_OBJECT and SCM_SMOB_SET_OBJECT for
  827. accesing the first immediate word of a smob as a SCM value, and there
  828. is SCM_SMOB_OBJECT_LOC for getting a pointer to the first immediate
  829. smob word. Like wise for SCM_SMOB_OBJECT_2, etc.
  830. ** New way to deal with non-local exits and re-entries.
  831. There is a new set of functions that essentially do what
  832. scm_internal_dynamic_wind does, but in a way that is more convenient
  833. for C code in some situations. Here is a quick example of how to
  834. prevent a potential memory leak:
  835. void
  836. foo ()
  837. {
  838. char *mem;
  839. scm_dynwind_begin (0);
  840. mem = scm_malloc (100);
  841. scm_dynwind_unwind_handler (free, mem, SCM_F_WIND_EXPLICITLY);
  842. /* MEM would leak if BAR throws an error.
  843. SCM_DYNWIND_UNWIND_HANDLER frees it nevertheless.
  844. */
  845. bar ();
  846. scm_dynwind_end ();
  847. /* Because of SCM_F_WIND_EXPLICITLY, MEM will be freed by
  848. SCM_DYNWIND_END as well.
  849. */
  850. }
  851. For full documentation, see the node "Dynamic Wind" in the manual.
  852. ** New function scm_dynwind_free
  853. This function calls 'free' on a given pointer when a dynwind context
  854. is left. Thus the call to scm_dynwind_unwind_handler above could be
  855. replaced with simply scm_dynwind_free (mem).
  856. ** New functions scm_c_call_with_blocked_asyncs and
  857. scm_c_call_with_unblocked_asyncs
  858. Like scm_call_with_blocked_asyncs etc. but for C functions.
  859. ** New functions scm_dynwind_block_asyncs and scm_dynwind_unblock_asyncs
  860. In addition to scm_c_call_with_blocked_asyncs you can now also use
  861. scm_dynwind_block_asyncs in a 'dynwind context' (see above). Likewise for
  862. scm_c_call_with_unblocked_asyncs and scm_dynwind_unblock_asyncs.
  863. ** The macros SCM_DEFER_INTS, SCM_ALLOW_INTS, SCM_REDEFER_INTS,
  864. SCM_REALLOW_INTS have been deprecated.
  865. They do no longer fulfill their original role of blocking signal
  866. delivery. Depending on what you want to achieve, replace a pair of
  867. SCM_DEFER_INTS and SCM_ALLOW_INTS with a dynwind context that locks a
  868. mutex, blocks asyncs, or both. See node "Critical Sections" in the
  869. manual.
  870. ** The value 'scm_mask_ints' is no longer writable.
  871. Previously, you could set scm_mask_ints directly. This is no longer
  872. possible. Use scm_c_call_with_blocked_asyncs and
  873. scm_c_call_with_unblocked_asyncs instead.
  874. ** New way to temporarily set the current input, output or error ports
  875. C code can now use scm_dynwind_current_<foo>_port in a 'dynwind
  876. context' (see above). <foo> is one of "input", "output" or "error".
  877. ** New way to temporarily set fluids
  878. C code can now use scm_dynwind_fluid in a 'dynwind context' (see
  879. above) to temporarily set the value of a fluid.
  880. ** New types scm_t_intmax and scm_t_uintmax.
  881. On platforms that have them, these types are identical to intmax_t and
  882. uintmax_t, respectively. On other platforms, they are identical to
  883. the largest integer types that Guile knows about.
  884. ** The functions scm_unmemocopy and scm_unmemoize have been removed.
  885. You should not have used them.
  886. ** Many public #defines with generic names have been made private.
  887. #defines with generic names like HAVE_FOO or SIZEOF_FOO have been made
  888. private or renamed with a more suitable public name.
  889. ** The macro SCM_TYP16S has been deprecated.
  890. This macro is not intended for public use.
  891. ** The macro SCM_SLOPPY_INEXACTP has been deprecated.
  892. Use scm_is_true (scm_inexact_p (...)) instead.
  893. ** The macro SCM_SLOPPY_REALP has been deprecated.
  894. Use scm_is_real instead.
  895. ** The macro SCM_SLOPPY_COMPLEXP has been deprecated.
  896. Use scm_is_complex instead.
  897. ** Some preprocessor defines have been deprecated.
  898. These defines indicated whether a certain feature was present in Guile
  899. or not. Going forward, assume that the features are always present.
  900. The macros are: USE_THREADS, GUILE_ISELECT, READER_EXTENSIONS,
  901. DEBUG_EXTENSIONS, DYNAMIC_LINKING.
  902. The following macros have been removed completely: MEMOIZE_LOCALS,
  903. SCM_RECKLESS, SCM_CAUTIOUS.
  904. ** The preprocessor define STACK_DIRECTION has been deprecated.
  905. There should be no need to know about the stack direction for ordinary
  906. programs.
  907. ** New function: scm_effective_version
  908. Returns the "effective" version number. This is just the normal full
  909. version string without the final micro-version number. See "Changes
  910. to the distribution" above.
  911. ** The function scm_call_with_new_thread has a new prototype.
  912. Instead of taking a list with the thunk and handler, these two
  913. arguments are now passed directly:
  914. SCM scm_call_with_new_thread (SCM thunk, SCM handler);
  915. This is an incompatible change.
  916. ** New snarfer macro SCM_DEFINE_PUBLIC.
  917. This is like SCM_DEFINE, but also calls scm_c_export for the defined
  918. function in the init section.
  919. ** The snarfer macro SCM_SNARF_INIT is now officially supported.
  920. ** Garbage collector rewrite.
  921. The garbage collector is cleaned up a lot, and now uses lazy
  922. sweeping. This is reflected in the output of (gc-stats); since cells
  923. are being freed when they are allocated, the cells-allocated field
  924. stays roughly constant.
  925. For malloc related triggers, the behavior is changed. It uses the same
  926. heuristic as the cell-triggered collections. It may be tuned with the
  927. environment variables GUILE_MIN_YIELD_MALLOC. This is the percentage
  928. for minimum yield of malloc related triggers. The default is 40.
  929. GUILE_INIT_MALLOC_LIMIT sets the initial trigger for doing a GC. The
  930. default is 200 kb.
  931. Debugging operations for the freelist have been deprecated, along with
  932. the C variables that control garbage collection. The environment
  933. variables GUILE_MAX_SEGMENT_SIZE, GUILE_INIT_SEGMENT_SIZE_2,
  934. GUILE_INIT_SEGMENT_SIZE_1, and GUILE_MIN_YIELD_2 should be used.
  935. For understanding the memory usage of a GUILE program, the routine
  936. gc-live-object-stats returns an alist containing the number of live
  937. objects for every type.
  938. ** The function scm_definedp has been renamed to scm_defined_p
  939. The name scm_definedp is deprecated.
  940. ** The struct scm_cell type has been renamed to scm_t_cell
  941. This is in accordance to Guile's naming scheme for types. Note that
  942. the name scm_cell is now used for a function that allocates and
  943. initializes a new cell (see below).
  944. ** New functions for memory management
  945. A new set of functions for memory management has been added since the
  946. old way (scm_must_malloc, scm_must_free, etc) was error prone and
  947. indeed, Guile itself contained some long standing bugs that could
  948. cause aborts in long running programs.
  949. The new functions are more symmetrical and do not need cooperation
  950. from smob free routines, among other improvements.
  951. The new functions are scm_malloc, scm_realloc, scm_calloc, scm_strdup,
  952. scm_strndup, scm_gc_malloc, scm_gc_calloc, scm_gc_realloc,
  953. scm_gc_free, scm_gc_register_collectable_memory, and
  954. scm_gc_unregister_collectable_memory. Refer to the manual for more
  955. details and for upgrading instructions.
  956. The old functions for memory management have been deprecated. They
  957. are: scm_must_malloc, scm_must_realloc, scm_must_free,
  958. scm_must_strdup, scm_must_strndup, scm_done_malloc, scm_done_free.
  959. ** Declarations of exported features are marked with SCM_API.
  960. Every declaration of a feature that belongs to the exported Guile API
  961. has been marked by adding the macro "SCM_API" to the start of the
  962. declaration. This macro can expand into different things, the most
  963. common of which is just "extern" for Unix platforms. On Win32, it can
  964. be used to control which symbols are exported from a DLL.
  965. If you `#define SCM_IMPORT' before including <libguile.h>, SCM_API
  966. will expand into "__declspec (dllimport) extern", which is needed for
  967. linking to the Guile DLL in Windows.
  968. There are also SCM_RL_IMPORT, SCM_SRFI1314_IMPORT, and
  969. SCM_SRFI4_IMPORT, for the corresponding libraries.
  970. ** SCM_NEWCELL and SCM_NEWCELL2 have been deprecated.
  971. Use the new functions scm_cell and scm_double_cell instead. The old
  972. macros had problems because with them allocation and initialization
  973. was separated and the GC could sometimes observe half initialized
  974. cells. Only careful coding by the user of SCM_NEWCELL and
  975. SCM_NEWCELL2 could make this safe and efficient.
  976. ** CHECK_ENTRY, CHECK_APPLY and CHECK_EXIT have been deprecated.
  977. Use the variables scm_check_entry_p, scm_check_apply_p and scm_check_exit_p
  978. instead.
  979. ** SRCBRKP has been deprecated.
  980. Use scm_c_source_property_breakpoint_p instead.
  981. ** Deprecated: scm_makmacro
  982. Change your code to use either scm_makmmacro or to define macros in
  983. Scheme, using 'define-macro'.
  984. ** New function scm_c_port_for_each.
  985. This function is like scm_port_for_each but takes a pointer to a C
  986. function as the callback instead of a SCM value.
  987. ** The names scm_internal_select, scm_thread_sleep, and
  988. scm_thread_usleep have been discouraged.
  989. Use scm_std_select, scm_std_sleep, scm_std_usleep instead.
  990. ** The GC can no longer be blocked.
  991. The global flags scm_gc_heap_lock and scm_block_gc have been removed.
  992. The GC can now run (partially) concurrently with other code and thus
  993. blocking it is not well defined.
  994. ** Many definitions have been removed that were previously deprecated.
  995. scm_lisp_nil, scm_lisp_t, s_nil_ify, scm_m_nil_ify, s_t_ify,
  996. scm_m_t_ify, s_0_cond, scm_m_0_cond, s_0_ify, scm_m_0_ify, s_1_ify,
  997. scm_m_1_ify, scm_debug_newcell, scm_debug_newcell2,
  998. scm_tc16_allocated, SCM_SET_SYMBOL_HASH, SCM_IM_NIL_IFY, SCM_IM_T_IFY,
  999. SCM_IM_0_COND, SCM_IM_0_IFY, SCM_IM_1_IFY, SCM_GC_SET_ALLOCATED,
  1000. scm_debug_newcell, scm_debug_newcell2, SCM_HUP_SIGNAL, SCM_INT_SIGNAL,
  1001. SCM_FPE_SIGNAL, SCM_BUS_SIGNAL, SCM_SEGV_SIGNAL, SCM_ALRM_SIGNAL,
  1002. SCM_GC_SIGNAL, SCM_TICK_SIGNAL, SCM_SIG_ORD, SCM_ORD_SIG,
  1003. SCM_NUM_SIGS, scm_top_level_lookup_closure_var,
  1004. *top-level-lookup-closure*, scm_system_transformer, scm_eval_3,
  1005. scm_eval2, root_module_lookup_closure, SCM_SLOPPY_STRINGP,
  1006. SCM_RWSTRINGP, scm_read_only_string_p, scm_make_shared_substring,
  1007. scm_tc7_substring, sym_huh, SCM_VARVCELL, SCM_UDVARIABLEP,
  1008. SCM_DEFVARIABLEP, scm_mkbig, scm_big2inum, scm_adjbig, scm_normbig,
  1009. scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl, SCM_FIXNUM_BIT,
  1010. SCM_SETCHARS, SCM_SLOPPY_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET,
  1011. SCM_LENGTH_MAX, SCM_SETLENGTH, SCM_ROSTRINGP, SCM_ROLENGTH,
  1012. SCM_ROCHARS, SCM_ROUCHARS, SCM_SUBSTRP, SCM_COERCE_SUBSTR,
  1013. scm_sym2vcell, scm_intern, scm_intern0, scm_sysintern, scm_sysintern0,
  1014. scm_sysintern0_no_module_lookup, scm_init_symbols_deprecated,
  1015. scm_vector_set_length_x, scm_contregs, scm_debug_info,
  1016. scm_debug_frame, SCM_DSIDEVAL, SCM_CONST_LONG, SCM_VCELL,
  1017. SCM_GLOBAL_VCELL, SCM_VCELL_INIT, SCM_GLOBAL_VCELL_INIT,
  1018. SCM_HUGE_LENGTH, SCM_VALIDATE_STRINGORSUBSTR, SCM_VALIDATE_ROSTRING,
  1019. SCM_VALIDATE_ROSTRING_COPY, SCM_VALIDATE_NULLORROSTRING_COPY,
  1020. SCM_VALIDATE_RWSTRING, DIGITS, scm_small_istr2int, scm_istr2int,
  1021. scm_istr2flo, scm_istring2number, scm_istr2int, scm_istr2flo,
  1022. scm_istring2number, scm_vtable_index_vcell, scm_si_vcell, SCM_ECONSP,
  1023. SCM_NECONSP, SCM_GLOC_VAR, SCM_GLOC_VAL, SCM_GLOC_SET_VAL,
  1024. SCM_GLOC_VAL_LOC, scm_make_gloc, scm_gloc_p, scm_tc16_variable,
  1025. SCM_CHARS, SCM_LENGTH, SCM_SET_STRING_CHARS, SCM_SET_STRING_LENGTH.
  1026. * Changes to bundled modules
  1027. ** (ice-9 debug)
  1028. Using the (ice-9 debug) module no longer automatically switches Guile
  1029. to use the debugging evaluator. If you want to switch to the
  1030. debugging evaluator (which is needed for backtrace information if you
  1031. hit an error), please add an explicit "(debug-enable 'debug)" to your
  1032. code just after the code to use (ice-9 debug).
  1033. Changes since Guile 1.4:
  1034. * Changes to the distribution
  1035. ** A top-level TODO file is included.
  1036. ** Guile now uses a versioning scheme similar to that of the Linux kernel.
  1037. Guile now always uses three numbers to represent the version,
  1038. i.e. "1.6.5". The first number, 1, is the major version number, the
  1039. second number, 6, is the minor version number, and the third number,
  1040. 5, is the micro version number. Changes in major version number
  1041. indicate major changes in Guile.
  1042. Minor version numbers that are even denote stable releases, and odd
  1043. minor version numbers denote development versions (which may be
  1044. unstable). The micro version number indicates a minor sub-revision of
  1045. a given MAJOR.MINOR release.
  1046. In keeping with the new scheme, (minor-version) and scm_minor_version
  1047. no longer return everything but the major version number. They now
  1048. just return the minor version number. Two new functions
  1049. (micro-version) and scm_micro_version have been added to report the
  1050. micro version number.
  1051. In addition, ./GUILE-VERSION now defines GUILE_MICRO_VERSION.
  1052. ** New preprocessor definitions are available for checking versions.
  1053. version.h now #defines SCM_MAJOR_VERSION, SCM_MINOR_VERSION, and
  1054. SCM_MICRO_VERSION to the appropriate integer values.
  1055. ** Guile now actively warns about deprecated features.
  1056. The new configure option `--enable-deprecated=LEVEL' and the
  1057. environment variable GUILE_WARN_DEPRECATED control this mechanism.
  1058. See INSTALL and README for more information.
  1059. ** Guile is much more likely to work on 64-bit architectures.
  1060. Guile now compiles and passes "make check" with only two UNRESOLVED GC
  1061. cases on Alpha and ia64 based machines now. Thanks to John Goerzen
  1062. for the use of a test machine, and thanks to Stefan Jahn for ia64
  1063. patches.
  1064. ** New functions: setitimer and getitimer.
  1065. These implement a fairly direct interface to the libc functions of the
  1066. same name.
  1067. ** The #. reader extension is now disabled by default.
  1068. For safety reasons, #. evaluation is disabled by default. To
  1069. re-enable it, set the fluid read-eval? to #t. For example:
  1070. (fluid-set! read-eval? #t)
  1071. but make sure you realize the potential security risks involved. With
  1072. read-eval? enabled, reading a data file from an untrusted source can
  1073. be dangerous.
  1074. ** New SRFI modules have been added:
  1075. SRFI-0 `cond-expand' is now supported in Guile, without requiring
  1076. using a module.
  1077. (srfi srfi-1) is a library containing many useful pair- and list-processing
  1078. procedures.
  1079. (srfi srfi-2) exports and-let*.
  1080. (srfi srfi-4) implements homogeneous numeric vector datatypes.
  1081. (srfi srfi-6) is a dummy module for now, since guile already provides
  1082. all of the srfi-6 procedures by default: open-input-string,
  1083. open-output-string, get-output-string.
  1084. (srfi srfi-8) exports receive.
  1085. (srfi srfi-9) exports define-record-type.
  1086. (srfi srfi-10) exports define-reader-ctor and implements the reader
  1087. extension #,().
  1088. (srfi srfi-11) exports let-values and let*-values.
  1089. (srfi srfi-13) implements the SRFI String Library.
  1090. (srfi srfi-14) implements the SRFI Character-Set Library.
  1091. (srfi srfi-17) implements setter and getter-with-setter and redefines
  1092. some accessor procedures as procedures with getters. (such as car,
  1093. cdr, vector-ref etc.)
  1094. (srfi srfi-19) implements the SRFI Time/Date Library.
  1095. ** New scripts / "executable modules"
  1096. Subdirectory "scripts" contains Scheme modules that are packaged to
  1097. also be executable as scripts. At this time, these scripts are available:
  1098. display-commentary
  1099. doc-snarf
  1100. generate-autoload
  1101. punify
  1102. read-scheme-source
  1103. use2dot
  1104. See README there for more info.
  1105. These scripts can be invoked from the shell with the new program
  1106. "guile-tools", which keeps track of installation directory for you.
  1107. For example:
  1108. $ guile-tools display-commentary srfi/*.scm
  1109. guile-tools is copied to the standard $bindir on "make install".
  1110. ** New module (ice-9 stack-catch):
  1111. stack-catch is like catch, but saves the current state of the stack in
  1112. the fluid the-last-stack. This fluid can be useful when using the
  1113. debugger and when re-throwing an error.
  1114. ** The module (ice-9 and-let*) has been renamed to (ice-9 and-let-star)
  1115. This has been done to prevent problems on lesser operating systems
  1116. that can't tolerate `*'s in file names. The exported macro continues
  1117. to be named `and-let*', of course.
  1118. On systems that support it, there is also a compatibility module named
  1119. (ice-9 and-let*). It will go away in the next release.
  1120. ** New modules (oop goops) etc.:
  1121. (oop goops)
  1122. (oop goops describe)
  1123. (oop goops save)
  1124. (oop goops active-slot)
  1125. (oop goops composite-slot)
  1126. The Guile Object Oriented Programming System (GOOPS) has been
  1127. integrated into Guile. For further information, consult the GOOPS
  1128. manual and tutorial in the `doc' directory.
  1129. ** New module (ice-9 rdelim).
  1130. This exports the following procedures which were previously defined
  1131. in the default environment:
  1132. read-line read-line! read-delimited read-delimited! %read-delimited!
  1133. %read-line write-line
  1134. For backwards compatibility the definitions are still imported into the
  1135. default environment in this version of Guile. However you should add:
  1136. (use-modules (ice-9 rdelim))
  1137. to any program which uses the definitions, since this may change in
  1138. future.
  1139. Alternatively, if guile-scsh is installed, the (scsh rdelim) module
  1140. can be used for similar functionality.
  1141. ** New module (ice-9 rw)
  1142. This is a subset of the (scsh rw) module from guile-scsh. Currently
  1143. it defines two procedures:
  1144. *** New function: read-string!/partial str [port_or_fdes [start [end]]]
  1145. Read characters from a port or file descriptor into a string STR.
  1146. A port must have an underlying file descriptor -- a so-called
  1147. fport. This procedure is scsh-compatible and can efficiently read
  1148. large strings.
  1149. *** New function: write-string/partial str [port_or_fdes [start [end]]]
  1150. Write characters from a string STR to a port or file descriptor.
  1151. A port must have an underlying file descriptor -- a so-called
  1152. fport. This procedure is mostly compatible and can efficiently
  1153. write large strings.
  1154. ** New module (ice-9 match)
  1155. This module includes Andrew K. Wright's pattern matcher. See
  1156. ice-9/match.scm for brief description or
  1157. http://www.star-lab.com/wright/code.html
  1158. for complete documentation.
  1159. ** New module (ice-9 buffered-input)
  1160. This module provides procedures to construct an input port from an
  1161. underlying source of input that reads and returns its input in chunks.
  1162. The underlying input source is a Scheme procedure, specified by the
  1163. caller, which the port invokes whenever it needs more input.
  1164. This is useful when building an input port whose back end is Readline
  1165. or a UI element such as the GtkEntry widget.
  1166. ** Documentation
  1167. The reference and tutorial documentation that was previously
  1168. distributed separately, as `guile-doc', is now included in the core
  1169. Guile distribution. The documentation consists of the following
  1170. manuals.
  1171. - The Guile Tutorial (guile-tut.texi) contains a tutorial introduction
  1172. to using Guile.
  1173. - The Guile Reference Manual (guile.texi) contains (or is intended to
  1174. contain) reference documentation on all aspects of Guile.
  1175. - The GOOPS Manual (goops.texi) contains both tutorial-style and
  1176. reference documentation for using GOOPS, Guile's Object Oriented
  1177. Programming System.
  1178. - The Revised^5 Report on the Algorithmic Language Scheme
  1179. (r5rs.texi).
  1180. See the README file in the `doc' directory for more details.
  1181. ** There are a couple of examples in the examples/ directory now.
  1182. * Changes to the stand-alone interpreter
  1183. ** New command line option `--use-srfi'
  1184. Using this option, SRFI modules can be loaded on startup and be
  1185. available right from the beginning. This makes programming portable
  1186. Scheme programs easier.
  1187. The option `--use-srfi' expects a comma-separated list of numbers,
  1188. each representing a SRFI number to be loaded into the interpreter
  1189. before starting evaluating a script file or the REPL. Additionally,
  1190. the feature identifier for the loaded SRFIs is recognized by
  1191. `cond-expand' when using this option.
  1192. Example:
  1193. $ guile --use-srfi=8,13
  1194. guile> (receive (x z) (values 1 2) (+ 1 2))
  1195. 3
  1196. guile> (string-pad "bla" 20)
  1197. " bla"
  1198. ** Guile now always starts up in the `(guile-user)' module.
  1199. Previously, scripts executed via the `-s' option would run in the
  1200. `(guile)' module and the repl would run in the `(guile-user)' module.
  1201. Now every user action takes place in the `(guile-user)' module by
  1202. default.
  1203. * Changes to Scheme functions and syntax
  1204. ** Character classifiers work for non-ASCII characters.
  1205. The predicates `char-alphabetic?', `char-numeric?',
  1206. `char-whitespace?', `char-lower?', `char-upper?' and `char-is-both?'
  1207. no longer check whether their arguments are ASCII characters.
  1208. Previously, a character would only be considered alphabetic when it
  1209. was also ASCII, for example.
  1210. ** Previously deprecated Scheme functions have been removed:
  1211. tag - no replacement.
  1212. fseek - replaced by seek.
  1213. list* - replaced by cons*.
  1214. ** It's now possible to create modules with controlled environments
  1215. Example:
  1216. (use-modules (ice-9 safe))
  1217. (define m (make-safe-module))
  1218. ;;; m will now be a module containing only a safe subset of R5RS
  1219. (eval '(+ 1 2) m) --> 3
  1220. (eval 'load m) --> ERROR: Unbound variable: load
  1221. ** Evaluation of "()", the empty list, is now an error.
  1222. Previously, the expression "()" evaluated to the empty list. This has
  1223. been changed to signal a "missing expression" error. The correct way
  1224. to write the empty list as a literal constant is to use quote: "'()".
  1225. ** New concept of `Guile Extensions'.
  1226. A Guile Extension is just a ordinary shared library that can be linked
  1227. at run-time. We found it advantageous to give this simple concept a
  1228. dedicated name to distinguish the issues related to shared libraries
  1229. from the issues related to the module system.
  1230. *** New function: load-extension
  1231. Executing (load-extension lib init) is mostly equivalent to
  1232. (dynamic-call init (dynamic-link lib))
  1233. except when scm_register_extension has been called previously.
  1234. Whenever appropriate, you should use `load-extension' instead of
  1235. dynamic-link and dynamic-call.
  1236. *** New C function: scm_c_register_extension
  1237. This function registers a initialization function for use by
  1238. `load-extension'. Use it when you don't want specific extensions to
  1239. be loaded as shared libraries (for example on platforms that don't
  1240. support dynamic linking).
  1241. ** Auto-loading of compiled-code modules is deprecated.
  1242. Guile used to be able to automatically find and link a shared
  1243. library to satisfy requests for a module. For example, the module
  1244. `(foo bar)' could be implemented by placing a shared library named
  1245. "foo/libbar.so" (or with a different extension) in a directory on the
  1246. load path of Guile.
  1247. This has been found to be too tricky, and is no longer supported. The
  1248. shared libraries are now called "extensions". You should now write a
  1249. small Scheme file that calls `load-extension' to load the shared
  1250. library and initialize it explicitly.
  1251. The shared libraries themselves should be installed in the usual
  1252. places for shared libraries, with names like "libguile-foo-bar".
  1253. For example, place this into a file "foo/bar.scm"
  1254. (define-module (foo bar))
  1255. (load-extension "libguile-foo-bar" "foobar_init")
  1256. ** Backward incompatible change: eval EXP ENVIRONMENT-SPECIFIER
  1257. `eval' is now R5RS, that is it takes two arguments.
  1258. The second argument is an environment specifier, i.e. either
  1259. (scheme-report-environment 5)
  1260. (null-environment 5)
  1261. (interaction-environment)
  1262. or
  1263. any module.
  1264. ** The module system has been made more disciplined.
  1265. The function `eval' will save and restore the current module around
  1266. the evaluation of the specified expression. While this expression is
  1267. evaluated, `(current-module)' will now return the right module, which
  1268. is the module specified as the second argument to `eval'.
  1269. A consequence of this change is that `eval' is not particularly
  1270. useful when you want allow the evaluated code to change what module is
  1271. designated as the current module and have this change persist from one
  1272. call to `eval' to the next. The read-eval-print-loop is an example
  1273. where `eval' is now inadequate. To compensate, there is a new
  1274. function `primitive-eval' that does not take a module specifier and
  1275. that does not save/restore the current module. You should use this
  1276. function together with `set-current-module', `current-module', etc
  1277. when you want to have more control over the state that is carried from
  1278. one eval to the next.
  1279. Additionally, it has been made sure that forms that are evaluated at
  1280. the top level are always evaluated with respect to the current module.
  1281. Previously, subforms of top-level forms such as `begin', `case',
  1282. etc. did not respect changes to the current module although these
  1283. subforms are at the top-level as well.
  1284. To prevent strange behavior, the forms `define-module',
  1285. `use-modules', `use-syntax', and `export' have been restricted to only
  1286. work on the top level. The forms `define-public' and
  1287. `defmacro-public' only export the new binding on the top level. They
  1288. behave just like `define' and `defmacro', respectively, when they are
  1289. used in a lexical environment.
  1290. Also, `export' will no longer silently re-export bindings imported
  1291. from a used module. It will emit a `deprecation' warning and will
  1292. cease to perform any re-export in the next version. If you actually
  1293. want to re-export bindings, use the new `re-export' in place of
  1294. `export'. The new `re-export' will not make copies of variables when
  1295. rexporting them, as `export' did wrongly.
  1296. ** Module system now allows selection and renaming of imported bindings
  1297. Previously, when using `use-modules' or the `#:use-module' clause in
  1298. the `define-module' form, all the bindings (association of symbols to
  1299. values) for imported modules were added to the "current module" on an
  1300. as-is basis. This has been changed to allow finer control through two
  1301. new facilities: selection and renaming.
  1302. You can now select which of the imported module's bindings are to be
  1303. visible in the current module by using the `:select' clause. This
  1304. clause also can be used to rename individual bindings. For example:
  1305. ;; import all bindings no questions asked
  1306. (use-modules (ice-9 common-list))
  1307. ;; import four bindings, renaming two of them;
  1308. ;; the current module sees: every some zonk-y zonk-n
  1309. (use-modules ((ice-9 common-list)
  1310. :select (every some
  1311. (remove-if . zonk-y)
  1312. (remove-if-not . zonk-n))))
  1313. You can also programmatically rename all selected bindings using the
  1314. `:renamer' clause, which specifies a proc that takes a symbol and
  1315. returns another symbol. Because it is common practice to use a prefix,
  1316. we now provide the convenience procedure `symbol-prefix-proc'. For
  1317. example:
  1318. ;; import four bindings, renaming two of them specifically,
  1319. ;; and all four w/ prefix "CL:";
  1320. ;; the current module sees: CL:every CL:some CL:zonk-y CL:zonk-n
  1321. (use-modules ((ice-9 common-list)
  1322. :select (every some
  1323. (remove-if . zonk-y)
  1324. (remove-if-not . zonk-n))
  1325. :renamer (symbol-prefix-proc 'CL:)))
  1326. ;; import four bindings, renaming two of them specifically,
  1327. ;; and all four by upcasing.
  1328. ;; the current module sees: EVERY SOME ZONK-Y ZONK-N
  1329. (define (upcase-symbol sym)
  1330. (string->symbol (string-upcase (symbol->string sym))))
  1331. (use-modules ((ice-9 common-list)
  1332. :select (every some
  1333. (remove-if . zonk-y)
  1334. (remove-if-not . zonk-n))
  1335. :renamer upcase-symbol))
  1336. Note that programmatic renaming is done *after* individual renaming.
  1337. Also, the above examples show `use-modules', but the same facilities are
  1338. available for the `#:use-module' clause of `define-module'.
  1339. See manual for more info.
  1340. ** The semantics of guardians have changed.
  1341. The changes are for the most part compatible. An important criterion
  1342. was to keep the typical usage of guardians as simple as before, but to
  1343. make the semantics safer and (as a result) more useful.
  1344. *** All objects returned from guardians are now properly alive.
  1345. It is now guaranteed that any object referenced by an object returned
  1346. from a guardian is alive. It's now impossible for a guardian to
  1347. return a "contained" object before its "containing" object.
  1348. One incompatible (but probably not very important) change resulting
  1349. from this is that it is no longer possible to guard objects that
  1350. indirectly reference themselves (i.e. are parts of cycles). If you do
  1351. so accidentally, you'll get a warning.
  1352. *** There are now two types of guardians: greedy and sharing.
  1353. If you call (make-guardian #t) or just (make-guardian), you'll get a
  1354. greedy guardian, and for (make-guardian #f) a sharing guardian.
  1355. Greedy guardians are the default because they are more "defensive".
  1356. You can only greedily guard an object once. If you guard an object
  1357. more than once, once in a greedy guardian and the rest of times in
  1358. sharing guardians, then it is guaranteed that the object won't be
  1359. returned from sharing guardians as long as it is greedily guarded
  1360. and/or alive.
  1361. Guardians returned by calls to `make-guardian' can now take one more
  1362. optional parameter, which says whether to throw an error in case an
  1363. attempt is made to greedily guard an object that is already greedily
  1364. guarded. The default is true, i.e. throw an error. If the parameter
  1365. is false, the guardian invocation returns #t if guarding was
  1366. successful and #f if it wasn't.
  1367. Also, since greedy guarding is, in effect, a side-effecting operation
  1368. on objects, a new function is introduced: `destroy-guardian!'.
  1369. Invoking this function on a guardian renders it unoperative and, if
  1370. the guardian is greedy, clears the "greedily guarded" property of the
  1371. objects that were guarded by it, thus undoing the side effect.
  1372. Note that all this hair is hardly very important, since guardian
  1373. objects are usually permanent.
  1374. ** Continuations created by call-with-current-continuation now accept
  1375. any number of arguments, as required by R5RS.
  1376. ** New function `issue-deprecation-warning'
  1377. This function is used to display the deprecation messages that are
  1378. controlled by GUILE_WARN_DEPRECATION as explained in the README.
  1379. (define (id x)
  1380. (issue-deprecation-warning "`id' is deprecated. Use `identity' instead.")
  1381. (identity x))
  1382. guile> (id 1)
  1383. ;; `id' is deprecated. Use `identity' instead.
  1384. 1
  1385. guile> (id 1)
  1386. 1
  1387. ** New syntax `begin-deprecated'
  1388. When deprecated features are included (as determined by the configure
  1389. option --enable-deprecated), `begin-deprecated' is identical to
  1390. `begin'. When deprecated features are excluded, it always evaluates
  1391. to `#f', ignoring the body forms.
  1392. ** New function `make-object-property'
  1393. This function returns a new `procedure with setter' P that can be used
  1394. to attach a property to objects. When calling P as
  1395. (set! (P obj) val)
  1396. where `obj' is any kind of object, it attaches `val' to `obj' in such
  1397. a way that it can be retrieved by calling P as
  1398. (P obj)
  1399. This function will replace procedure properties, symbol properties and
  1400. source properties eventually.
  1401. ** Module (ice-9 optargs) now uses keywords instead of `#&'.
  1402. Instead of #&optional, #&key, etc you should now use #:optional,
  1403. #:key, etc. Since #:optional is a keyword, you can write it as just
  1404. :optional when (read-set! keywords 'prefix) is active.
  1405. The old reader syntax `#&' is still supported, but deprecated. It
  1406. will be removed in the next release.
  1407. ** New define-module option: pure
  1408. Tells the module system not to include any bindings from the root
  1409. module.
  1410. Example:
  1411. (define-module (totally-empty-module)
  1412. :pure)
  1413. ** New define-module option: export NAME1 ...
  1414. Export names NAME1 ...
  1415. This option is required if you want to be able to export bindings from
  1416. a module which doesn't import one of `define-public' or `export'.
  1417. Example:
  1418. (define-module (foo)
  1419. :pure
  1420. :use-module (ice-9 r5rs)
  1421. :export (bar))
  1422. ;;; Note that we're pure R5RS below this point!
  1423. (define (bar)
  1424. ...)
  1425. ** New function: object->string OBJ
  1426. Return a Scheme string obtained by printing a given object.
  1427. ** New function: port? X
  1428. Returns a boolean indicating whether X is a port. Equivalent to
  1429. `(or (input-port? X) (output-port? X))'.
  1430. ** New function: file-port?
  1431. Determines whether a given object is a port that is related to a file.
  1432. ** New function: port-for-each proc
  1433. Apply PROC to each port in the Guile port table in turn. The return
  1434. value is unspecified. More specifically, PROC is applied exactly once
  1435. to every port that exists in the system at the time PORT-FOR-EACH is
  1436. invoked. Changes to the port table while PORT-FOR-EACH is running
  1437. have no effect as far as PORT-FOR-EACH is concerned.
  1438. ** New function: dup2 oldfd newfd
  1439. A simple wrapper for the `dup2' system call. Copies the file
  1440. descriptor OLDFD to descriptor number NEWFD, replacing the
  1441. previous meaning of NEWFD. Both OLDFD and NEWFD must be integers.
  1442. Unlike for dup->fdes or primitive-move->fdes, no attempt is made
  1443. to move away ports which are using NEWFD. The return value is
  1444. unspecified.
  1445. ** New function: close-fdes fd
  1446. A simple wrapper for the `close' system call. Close file
  1447. descriptor FD, which must be an integer. Unlike close (*note
  1448. close: Ports and File Descriptors.), the file descriptor will be
  1449. closed even if a port is using it. The return value is
  1450. unspecified.
  1451. ** New function: crypt password salt
  1452. Encrypts `password' using the standard unix password encryption
  1453. algorithm.
  1454. ** New function: chroot path
  1455. Change the root directory of the running process to `path'.
  1456. ** New functions: getlogin, cuserid
  1457. Return the login name or the user name of the current effective user
  1458. id, respectively.
  1459. ** New functions: getpriority which who, setpriority which who prio
  1460. Get or set the priority of the running process.
  1461. ** New function: getpass prompt
  1462. Read a password from the terminal, first displaying `prompt' and
  1463. disabling echoing.
  1464. ** New function: flock file operation
  1465. Set/remove an advisory shared or exclusive lock on `file'.
  1466. ** New functions: sethostname name, gethostname
  1467. Set or get the hostname of the machine the current process is running
  1468. on.
  1469. ** New function: mkstemp! tmpl
  1470. mkstemp creates a new unique file in the file system and returns a
  1471. new buffered port open for reading and writing to the file. TMPL
  1472. is a string specifying where the file should be created: it must
  1473. end with `XXXXXX' and will be changed in place to return the name
  1474. of the temporary file.
  1475. ** New function: open-input-string string
  1476. Return an input string port which delivers the characters from
  1477. `string'. This procedure, together with `open-output-string' and
  1478. `get-output-string' implements SRFI-6.
  1479. ** New function: open-output-string
  1480. Return an output string port which collects all data written to it.
  1481. The data can then be retrieved by `get-output-string'.
  1482. ** New function: get-output-string
  1483. Return the contents of an output string port.
  1484. ** New function: identity
  1485. Return the argument.
  1486. ** socket, connect, accept etc., now have support for IPv6. IPv6 addresses
  1487. are represented in Scheme as integers with normal host byte ordering.
  1488. ** New function: inet-pton family address
  1489. Convert a printable string network address into an integer. Note that
  1490. unlike the C version of this function, the result is an integer with
  1491. normal host byte ordering. FAMILY can be `AF_INET' or `AF_INET6'.
  1492. e.g.,
  1493. (inet-pton AF_INET "127.0.0.1") => 2130706433
  1494. (inet-pton AF_INET6 "::1") => 1
  1495. ** New function: inet-ntop family address
  1496. Convert an integer network address into a printable string. Note that
  1497. unlike the C version of this function, the input is an integer with
  1498. normal host byte ordering. FAMILY can be `AF_INET' or `AF_INET6'.
  1499. e.g.,
  1500. (inet-ntop AF_INET 2130706433) => "127.0.0.1"
  1501. (inet-ntop AF_INET6 (- (expt 2 128) 1)) =>
  1502. ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
  1503. ** Deprecated: id
  1504. Use `identity' instead.
  1505. ** Deprecated: -1+
  1506. Use `1-' instead.
  1507. ** Deprecated: return-it
  1508. Do without it.
  1509. ** Deprecated: string-character-length
  1510. Use `string-length' instead.
  1511. ** Deprecated: flags
  1512. Use `logior' instead.
  1513. ** Deprecated: close-all-ports-except.
  1514. This was intended for closing ports in a child process after a fork,
  1515. but it has the undesirable side effect of flushing buffers.
  1516. port-for-each is more flexible.
  1517. ** The (ice-9 popen) module now attempts to set up file descriptors in
  1518. the child process from the current Scheme ports, instead of using the
  1519. current values of file descriptors 0, 1, and 2 in the parent process.
  1520. ** Removed function: builtin-weak-bindings
  1521. There is no such concept as a weak binding any more.
  1522. ** Removed constants: bignum-radix, scm-line-incrementors
  1523. ** define-method: New syntax mandatory.
  1524. The new method syntax is now mandatory:
  1525. (define-method (NAME ARG-SPEC ...) BODY ...)
  1526. (define-method (NAME ARG-SPEC ... . REST-ARG) BODY ...)
  1527. ARG-SPEC ::= ARG-NAME | (ARG-NAME TYPE)
  1528. REST-ARG ::= ARG-NAME
  1529. If you have old code using the old syntax, import
  1530. (oop goops old-define-method) before (oop goops) as in:
  1531. (use-modules (oop goops old-define-method) (oop goops))
  1532. ** Deprecated function: builtin-variable
  1533. Removed function: builtin-bindings
  1534. There is no longer a distinction between builtin or other variables.
  1535. Use module system operations for all variables.
  1536. ** Lazy-catch handlers are no longer allowed to return.
  1537. That is, a call to `throw', `error', etc is now guaranteed to not
  1538. return.
  1539. ** Bugfixes for (ice-9 getopt-long)
  1540. This module is now tested using test-suite/tests/getopt-long.test.
  1541. The following bugs have been fixed:
  1542. *** Parsing for options that are specified to have `optional' args now checks
  1543. if the next element is an option instead of unconditionally taking it as the
  1544. option arg.
  1545. *** An error is now thrown for `--opt=val' when the option description
  1546. does not specify `(value #t)' or `(value optional)'. This condition used to
  1547. be accepted w/o error, contrary to the documentation.
  1548. *** The error message for unrecognized options is now more informative.
  1549. It used to be "not a record", an artifact of the implementation.
  1550. *** The error message for `--opt' terminating the arg list (no value), when
  1551. `(value #t)' is specified, is now more informative. It used to be "not enough
  1552. args".
  1553. *** "Clumped" single-char args now preserve trailing string, use it as arg.
  1554. The expansion used to be like so:
  1555. ("-abc5d" "--xyz") => ("-a" "-b" "-c" "--xyz")
  1556. Note that the "5d" is dropped. Now it is like so:
  1557. ("-abc5d" "--xyz") => ("-a" "-b" "-c" "5d" "--xyz")
  1558. This enables single-char options to have adjoining arguments as long as their
  1559. constituent characters are not potential single-char options.
  1560. ** (ice-9 session) procedure `arity' now works with (ice-9 optargs) `lambda*'
  1561. The `lambda*' and derivative forms in (ice-9 optargs) now set a procedure
  1562. property `arglist', which can be retrieved by `arity'. The result is that
  1563. `arity' can give more detailed information than before:
  1564. Before:
  1565. guile> (use-modules (ice-9 optargs))
  1566. guile> (define* (foo #:optional a b c) a)
  1567. guile> (arity foo)
  1568. 0 or more arguments in `lambda*:G0'.
  1569. After:
  1570. guile> (arity foo)
  1571. 3 optional arguments: `a', `b' and `c'.
  1572. guile> (define* (bar a b #:key c d #:allow-other-keys) a)
  1573. guile> (arity bar)
  1574. 2 required arguments: `a' and `b', 2 keyword arguments: `c'
  1575. and `d', other keywords allowed.
  1576. guile> (define* (baz a b #:optional c #:rest r) a)
  1577. guile> (arity baz)
  1578. 2 required arguments: `a' and `b', 1 optional argument: `c',
  1579. the rest in `r'.
  1580. * Changes to the C interface
  1581. ** Types have been renamed from scm_*_t to scm_t_*.
  1582. This has been done for POSIX sake. It reserves identifiers ending
  1583. with "_t". What a concept.
  1584. The old names are still available with status `deprecated'.
  1585. ** scm_t_bits (former scm_bits_t) is now a unsigned type.
  1586. ** Deprecated features have been removed.
  1587. *** Macros removed
  1588. SCM_INPORTP, SCM_OUTPORTP SCM_ICHRP, SCM_ICHR, SCM_MAKICHR
  1589. SCM_SETJMPBUF SCM_NSTRINGP SCM_NRWSTRINGP SCM_NVECTORP SCM_DOUBLE_CELLP
  1590. *** C Functions removed
  1591. scm_sysmissing scm_tag scm_tc16_flo scm_tc_flo
  1592. scm_fseek - replaced by scm_seek.
  1593. gc-thunk - replaced by after-gc-hook.
  1594. gh_int2scmb - replaced by gh_bool2scm.
  1595. scm_tc_dblr - replaced by scm_tc16_real.
  1596. scm_tc_dblc - replaced by scm_tc16_complex.
  1597. scm_list_star - replaced by scm_cons_star.
  1598. ** Deprecated: scm_makfromstr
  1599. Use scm_mem2string instead.
  1600. ** Deprecated: scm_make_shared_substring
  1601. Explicit shared substrings will disappear from Guile.
  1602. Instead, "normal" strings will be implemented using sharing
  1603. internally, combined with a copy-on-write strategy.
  1604. ** Deprecated: scm_read_only_string_p
  1605. The concept of read-only strings will disappear in next release of
  1606. Guile.
  1607. ** Deprecated: scm_sloppy_memq, scm_sloppy_memv, scm_sloppy_member
  1608. Instead, use scm_c_memq or scm_memq, scm_memv, scm_member.
  1609. ** New functions: scm_call_0, scm_call_1, scm_call_2, scm_call_3
  1610. Call a procedure with the indicated number of arguments. See "Fly
  1611. Evaluation" in the manual.
  1612. ** New functions: scm_apply_0, scm_apply_1, scm_apply_2, scm_apply_3
  1613. Call a procedure with the indicated number of arguments and a list of
  1614. further arguments. See "Fly Evaluation" in the manual.
  1615. ** New functions: scm_list_1, scm_list_2, scm_list_3, scm_list_4, scm_list_5
  1616. Create a list of the given number of elements. See "List
  1617. Constructors" in the manual.
  1618. ** Renamed function: scm_listify has been replaced by scm_list_n.
  1619. ** Deprecated macros: SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4,
  1620. SCM_LIST5, SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9.
  1621. Use functions scm_list_N instead.
  1622. ** New function: scm_c_read (SCM port, void *buffer, scm_sizet size)
  1623. Used by an application to read arbitrary number of bytes from a port.
  1624. Same semantics as libc read, except that scm_c_read only returns less
  1625. than SIZE bytes if at end-of-file.
  1626. Warning: Doesn't update port line and column counts!
  1627. ** New function: scm_c_write (SCM port, const void *ptr, scm_sizet size)
  1628. Used by an application to write arbitrary number of bytes to an SCM
  1629. port. Similar semantics as libc write. However, unlike libc
  1630. write, scm_c_write writes the requested number of bytes and has no
  1631. return value.
  1632. Warning: Doesn't update port line and column counts!
  1633. ** New function: scm_init_guile ()
  1634. In contrast to scm_boot_guile, scm_init_guile will return normally
  1635. after initializing Guile. It is not available on all systems, tho.
  1636. ** New functions: scm_str2symbol, scm_mem2symbol
  1637. The function scm_str2symbol takes a const char* pointing to a zero-terminated
  1638. field of characters and creates a scheme symbol object from that C string.
  1639. The function scm_mem2symbol takes a const char* and a number of characters and
  1640. creates a symbol from the characters in that memory area.
  1641. ** New functions: scm_primitive_make_property
  1642. scm_primitive_property_ref
  1643. scm_primitive_property_set_x
  1644. scm_primitive_property_del_x
  1645. These functions implement a new way to deal with object properties.
  1646. See libguile/properties.c for their documentation.
  1647. ** New function: scm_done_free (long size)
  1648. This function is the inverse of scm_done_malloc. Use it to report the
  1649. amount of smob memory you free. The previous method, which involved
  1650. calling scm_done_malloc with negative argument, was somewhat
  1651. unintuitive (and is still available, of course).
  1652. ** New function: scm_c_memq (SCM obj, SCM list)
  1653. This function provides a fast C level alternative for scm_memq for the case
  1654. that the list parameter is known to be a proper list. The function is a
  1655. replacement for scm_sloppy_memq, but is stricter in its requirements on its
  1656. list input parameter, since for anything else but a proper list the function's
  1657. behaviour is undefined - it may even crash or loop endlessly. Further, for
  1658. the case that the object is not found in the list, scm_c_memq returns #f which
  1659. is similar to scm_memq, but different from scm_sloppy_memq's behaviour.
  1660. ** New functions: scm_remember_upto_here_1, scm_remember_upto_here_2,
  1661. scm_remember_upto_here
  1662. These functions replace the function scm_remember.
  1663. ** Deprecated function: scm_remember
  1664. Use one of the new functions scm_remember_upto_here_1,
  1665. scm_remember_upto_here_2 or scm_remember_upto_here instead.
  1666. ** New function: scm_allocate_string
  1667. This function replaces the function scm_makstr.
  1668. ** Deprecated function: scm_makstr
  1669. Use the new function scm_allocate_string instead.
  1670. ** New global variable scm_gc_running_p introduced.
  1671. Use this variable to find out if garbage collection is being executed. Up to
  1672. now applications have used scm_gc_heap_lock to test if garbage collection was
  1673. running, which also works because of the fact that up to know only the garbage
  1674. collector has set this variable. But, this is an implementation detail that
  1675. may change. Further, scm_gc_heap_lock is not set throughout gc, thus the use
  1676. of this variable is (and has been) not fully safe anyway.
  1677. ** New macros: SCM_BITVECTOR_MAX_LENGTH, SCM_UVECTOR_MAX_LENGTH
  1678. Use these instead of SCM_LENGTH_MAX.
  1679. ** New macros: SCM_CONTINUATION_LENGTH, SCM_CCLO_LENGTH, SCM_STACK_LENGTH,
  1680. SCM_STRING_LENGTH, SCM_SYMBOL_LENGTH, SCM_UVECTOR_LENGTH,
  1681. SCM_BITVECTOR_LENGTH, SCM_VECTOR_LENGTH.
  1682. Use these instead of SCM_LENGTH.
  1683. ** New macros: SCM_SET_CONTINUATION_LENGTH, SCM_SET_STRING_LENGTH,
  1684. SCM_SET_SYMBOL_LENGTH, SCM_SET_VECTOR_LENGTH, SCM_SET_UVECTOR_LENGTH,
  1685. SCM_SET_BITVECTOR_LENGTH
  1686. Use these instead of SCM_SETLENGTH
  1687. ** New macros: SCM_STRING_CHARS, SCM_SYMBOL_CHARS, SCM_CCLO_BASE,
  1688. SCM_VECTOR_BASE, SCM_UVECTOR_BASE, SCM_BITVECTOR_BASE, SCM_COMPLEX_MEM,
  1689. SCM_ARRAY_MEM
  1690. Use these instead of SCM_CHARS, SCM_UCHARS, SCM_ROCHARS, SCM_ROUCHARS or
  1691. SCM_VELTS.
  1692. ** New macros: SCM_SET_BIGNUM_BASE, SCM_SET_STRING_CHARS,
  1693. SCM_SET_SYMBOL_CHARS, SCM_SET_UVECTOR_BASE, SCM_SET_BITVECTOR_BASE,
  1694. SCM_SET_VECTOR_BASE
  1695. Use these instead of SCM_SETCHARS.
  1696. ** New macro: SCM_BITVECTOR_P
  1697. ** New macro: SCM_STRING_COERCE_0TERMINATION_X
  1698. Use instead of SCM_COERCE_SUBSTR.
  1699. ** New macros: SCM_DIR_OPEN_P, SCM_DIR_FLAG_OPEN
  1700. For directory objects, use these instead of SCM_OPDIRP and SCM_OPN.
  1701. ** Deprecated macros: SCM_OUTOFRANGE, SCM_NALLOC, SCM_HUP_SIGNAL,
  1702. SCM_INT_SIGNAL, SCM_FPE_SIGNAL, SCM_BUS_SIGNAL, SCM_SEGV_SIGNAL,
  1703. SCM_ALRM_SIGNAL, SCM_GC_SIGNAL, SCM_TICK_SIGNAL, SCM_SIG_ORD,
  1704. SCM_ORD_SIG, SCM_NUM_SIGS, SCM_SYMBOL_SLOTS, SCM_SLOTS, SCM_SLOPPY_STRINGP,
  1705. SCM_VALIDATE_STRINGORSUBSTR, SCM_FREEP, SCM_NFREEP, SCM_CHARS, SCM_UCHARS,
  1706. SCM_VALIDATE_ROSTRING, SCM_VALIDATE_ROSTRING_COPY,
  1707. SCM_VALIDATE_NULLORROSTRING_COPY, SCM_ROLENGTH, SCM_LENGTH, SCM_HUGE_LENGTH,
  1708. SCM_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET, SCM_COERCE_SUBSTR,
  1709. SCM_ROSTRINGP, SCM_RWSTRINGP, SCM_VALIDATE_RWSTRING, SCM_ROCHARS,
  1710. SCM_ROUCHARS, SCM_SETLENGTH, SCM_SETCHARS, SCM_LENGTH_MAX, SCM_GC8MARKP,
  1711. SCM_SETGC8MARK, SCM_CLRGC8MARK, SCM_GCTYP16, SCM_GCCDR, SCM_SUBR_DOC,
  1712. SCM_OPDIRP, SCM_VALIDATE_OPDIR, SCM_WTA, RETURN_SCM_WTA, SCM_CONST_LONG,
  1713. SCM_WNA, SCM_FUNC_NAME, SCM_VALIDATE_NUMBER_COPY,
  1714. SCM_VALIDATE_NUMBER_DEF_COPY, SCM_SLOPPY_CONSP, SCM_SLOPPY_NCONSP,
  1715. SCM_SETAND_CDR, SCM_SETOR_CDR, SCM_SETAND_CAR, SCM_SETOR_CAR
  1716. Use SCM_ASSERT_RANGE or SCM_VALIDATE_XXX_RANGE instead of SCM_OUTOFRANGE.
  1717. Use scm_memory_error instead of SCM_NALLOC.
  1718. Use SCM_STRINGP instead of SCM_SLOPPY_STRINGP.
  1719. Use SCM_VALIDATE_STRING instead of SCM_VALIDATE_STRINGORSUBSTR.
  1720. Use SCM_FREE_CELL_P instead of SCM_FREEP/SCM_NFREEP
  1721. Use a type specific accessor macro instead of SCM_CHARS/SCM_UCHARS.
  1722. Use a type specific accessor instead of SCM(_|_RO|_HUGE_)LENGTH.
  1723. Use SCM_VALIDATE_(SYMBOL|STRING) instead of SCM_VALIDATE_ROSTRING.
  1724. Use SCM_STRING_COERCE_0TERMINATION_X instead of SCM_COERCE_SUBSTR.
  1725. Use SCM_STRINGP or SCM_SYMBOLP instead of SCM_ROSTRINGP.
  1726. Use SCM_STRINGP instead of SCM_RWSTRINGP.
  1727. Use SCM_VALIDATE_STRING instead of SCM_VALIDATE_RWSTRING.
  1728. Use SCM_STRING_CHARS instead of SCM_ROCHARS.
  1729. Use SCM_STRING_UCHARS instead of SCM_ROUCHARS.
  1730. Use a type specific setter macro instead of SCM_SETLENGTH.
  1731. Use a type specific setter macro instead of SCM_SETCHARS.
  1732. Use a type specific length macro instead of SCM_LENGTH_MAX.
  1733. Use SCM_GCMARKP instead of SCM_GC8MARKP.
  1734. Use SCM_SETGCMARK instead of SCM_SETGC8MARK.
  1735. Use SCM_CLRGCMARK instead of SCM_CLRGC8MARK.
  1736. Use SCM_TYP16 instead of SCM_GCTYP16.
  1737. Use SCM_CDR instead of SCM_GCCDR.
  1738. Use SCM_DIR_OPEN_P instead of SCM_OPDIRP.
  1739. Use SCM_MISC_ERROR or SCM_WRONG_TYPE_ARG instead of SCM_WTA.
  1740. Use SCM_MISC_ERROR or SCM_WRONG_TYPE_ARG instead of RETURN_SCM_WTA.
  1741. Use SCM_VCELL_INIT instead of SCM_CONST_LONG.
  1742. Use SCM_WRONG_NUM_ARGS instead of SCM_WNA.
  1743. Use SCM_CONSP instead of SCM_SLOPPY_CONSP.
  1744. Use !SCM_CONSP instead of SCM_SLOPPY_NCONSP.
  1745. ** Removed function: scm_struct_init
  1746. ** Removed variable: scm_symhash_dim
  1747. ** Renamed function: scm_make_cont has been replaced by
  1748. scm_make_continuation, which has a different interface.
  1749. ** Deprecated function: scm_call_catching_errors
  1750. Use scm_catch or scm_lazy_catch from throw.[ch] instead.
  1751. ** Deprecated function: scm_strhash
  1752. Use scm_string_hash instead.
  1753. ** Deprecated function: scm_vector_set_length_x
  1754. Instead, create a fresh vector of the desired size and copy the contents.
  1755. ** scm_gensym has changed prototype
  1756. scm_gensym now only takes one argument.
  1757. ** Deprecated type tags: scm_tc7_ssymbol, scm_tc7_msymbol, scm_tcs_symbols,
  1758. scm_tc7_lvector
  1759. There is now only a single symbol type scm_tc7_symbol.
  1760. The tag scm_tc7_lvector was not used anyway.
  1761. ** Deprecated function: scm_make_smob_type_mfpe, scm_set_smob_mfpe.
  1762. Use scm_make_smob_type and scm_set_smob_XXX instead.
  1763. ** New function scm_set_smob_apply.
  1764. This can be used to set an apply function to a smob type.
  1765. ** Deprecated function: scm_strprint_obj
  1766. Use scm_object_to_string instead.
  1767. ** Deprecated function: scm_wta
  1768. Use scm_wrong_type_arg, or another appropriate error signalling function
  1769. instead.
  1770. ** Explicit support for obarrays has been deprecated.
  1771. Use `scm_str2symbol' and the generic hashtable functions instead.
  1772. ** The concept of `vcells' has been deprecated.
  1773. The data type `variable' is now used exclusively. `Vcells' have been
  1774. a low-level concept so you are likely not affected by this change.
  1775. *** Deprecated functions: scm_sym2vcell, scm_sysintern,
  1776. scm_sysintern0, scm_symbol_value0, scm_intern, scm_intern0.
  1777. Use scm_c_define or scm_c_lookup instead, as appropriate.
  1778. *** New functions: scm_c_module_lookup, scm_c_lookup,
  1779. scm_c_module_define, scm_c_define, scm_module_lookup, scm_lookup,
  1780. scm_module_define, scm_define.
  1781. These functions work with variables instead of with vcells.
  1782. ** New functions for creating and defining `subr's and `gsubr's.
  1783. The new functions more clearly distinguish between creating a subr (or
  1784. gsubr) object and adding it to the current module.
  1785. These new functions are available: scm_c_make_subr, scm_c_define_subr,
  1786. scm_c_make_subr_with_generic, scm_c_define_subr_with_generic,
  1787. scm_c_make_gsubr, scm_c_define_gsubr, scm_c_make_gsubr_with_generic,
  1788. scm_c_define_gsubr_with_generic.
  1789. ** Deprecated functions: scm_make_subr, scm_make_subr_opt,
  1790. scm_make_subr_with_generic, scm_make_gsubr,
  1791. scm_make_gsubr_with_generic.
  1792. Use the new ones from above instead.
  1793. ** C interface to the module system has changed.
  1794. While we suggest that you avoid as many explicit module system
  1795. operations from C as possible for the time being, the C interface has
  1796. been made more similar to the high-level Scheme module system.
  1797. *** New functions: scm_c_define_module, scm_c_use_module,
  1798. scm_c_export, scm_c_resolve_module.
  1799. They mostly work like their Scheme namesakes. scm_c_define_module
  1800. takes a function that is called a context where the new module is
  1801. current.
  1802. *** Deprecated functions: scm_the_root_module, scm_make_module,
  1803. scm_ensure_user_module, scm_load_scheme_module.
  1804. Use the new functions instead.
  1805. ** Renamed function: scm_internal_with_fluids becomes
  1806. scm_c_with_fluids.
  1807. scm_internal_with_fluids is available as a deprecated function.
  1808. ** New function: scm_c_with_fluid.
  1809. Just like scm_c_with_fluids, but takes one fluid and one value instead
  1810. of lists of same.
  1811. ** Deprecated typedefs: long_long, ulong_long.
  1812. They are of questionable utility and they pollute the global
  1813. namespace.
  1814. ** Deprecated typedef: scm_sizet
  1815. It is of questionable utility now that Guile requires ANSI C, and is
  1816. oddly named.
  1817. ** Deprecated typedefs: scm_port_rw_active, scm_port,
  1818. scm_ptob_descriptor, scm_debug_info, scm_debug_frame, scm_fport,
  1819. scm_option, scm_rstate, scm_rng, scm_array, scm_array_dim.
  1820. Made more compliant with the naming policy by adding a _t at the end.
  1821. ** Deprecated functions: scm_mkbig, scm_big2num, scm_adjbig,
  1822. scm_normbig, scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl
  1823. With the exception of the mysterious scm_2ulong2big, they are still
  1824. available under new names (scm_i_mkbig etc). These functions are not
  1825. intended to be used in user code. You should avoid dealing with
  1826. bignums directly, and should deal with numbers in general (which can
  1827. be bignums).
  1828. ** Change in behavior: scm_num2long, scm_num2ulong
  1829. The scm_num2[u]long functions don't any longer accept an inexact
  1830. argument. This change in behavior is motivated by concordance with
  1831. R5RS: It is more common that a primitive doesn't want to accept an
  1832. inexact for an exact.
  1833. ** New functions: scm_short2num, scm_ushort2num, scm_int2num,
  1834. scm_uint2num, scm_size2num, scm_ptrdiff2num, scm_num2short,
  1835. scm_num2ushort, scm_num2int, scm_num2uint, scm_num2ptrdiff,
  1836. scm_num2size.
  1837. These are conversion functions between the various ANSI C integral
  1838. types and Scheme numbers. NOTE: The scm_num2xxx functions don't
  1839. accept an inexact argument.
  1840. ** New functions: scm_float2num, scm_double2num,
  1841. scm_num2float, scm_num2double.
  1842. These are conversion functions between the two ANSI C float types and
  1843. Scheme numbers.
  1844. ** New number validation macros:
  1845. SCM_NUM2{SIZE,PTRDIFF,SHORT,USHORT,INT,UINT}[_DEF]
  1846. See above.
  1847. ** New functions: scm_gc_protect_object, scm_gc_unprotect_object
  1848. These are just nicer-named old scm_protect_object and
  1849. scm_unprotect_object.
  1850. ** Deprecated functions: scm_protect_object, scm_unprotect_object
  1851. ** New functions: scm_gc_[un]register_root, scm_gc_[un]register_roots
  1852. These functions can be used to register pointers to locations that
  1853. hold SCM values.
  1854. ** Deprecated function: scm_create_hook.
  1855. Its sins are: misleading name, non-modularity and lack of general
  1856. usefulness.
  1857. Changes since Guile 1.3.4:
  1858. * Changes to the distribution
  1859. ** Trees from nightly snapshots and CVS now require you to run autogen.sh.
  1860. We've changed the way we handle generated files in the Guile source
  1861. repository. As a result, the procedure for building trees obtained
  1862. from the nightly FTP snapshots or via CVS has changed:
  1863. - You must have appropriate versions of autoconf, automake, and
  1864. libtool installed on your system. See README for info on how to
  1865. obtain these programs.
  1866. - Before configuring the tree, you must first run the script
  1867. `autogen.sh' at the top of the source tree.
  1868. The Guile repository used to contain not only source files, written by
  1869. humans, but also some generated files, like configure scripts and
  1870. Makefile.in files. Even though the contents of these files could be
  1871. derived mechanically from other files present, we thought it would
  1872. make the tree easier to build if we checked them into CVS.
  1873. However, this approach means that minor differences between
  1874. developer's installed tools and habits affected the whole team.
  1875. So we have removed the generated files from the repository, and
  1876. added the autogen.sh script, which will reconstruct them
  1877. appropriately.
  1878. ** configure now has experimental options to remove support for certain
  1879. features:
  1880. --disable-arrays omit array and uniform array support
  1881. --disable-posix omit posix interfaces
  1882. --disable-networking omit networking interfaces
  1883. --disable-regex omit regular expression interfaces
  1884. These are likely to become separate modules some day.
  1885. ** New configure option --enable-debug-freelist
  1886. This enables a debugging version of SCM_NEWCELL(), and also registers
  1887. an extra primitive, the setter `gc-set-debug-check-freelist!'.
  1888. Configure with the --enable-debug-freelist option to enable
  1889. the gc-set-debug-check-freelist! primitive, and then use:
  1890. (gc-set-debug-check-freelist! #t) # turn on checking of the freelist
  1891. (gc-set-debug-check-freelist! #f) # turn off checking
  1892. Checking of the freelist forces a traversal of the freelist and
  1893. a garbage collection before each allocation of a cell. This can
  1894. slow down the interpreter dramatically, so the setter should be used to
  1895. turn on this extra processing only when necessary.
  1896. ** New configure option --enable-debug-malloc
  1897. Include code for debugging of calls to scm_must_malloc/realloc/free.
  1898. Checks that
  1899. 1. objects freed by scm_must_free has been mallocated by scm_must_malloc
  1900. 2. objects reallocated by scm_must_realloc has been allocated by
  1901. scm_must_malloc
  1902. 3. reallocated objects are reallocated with the same what string
  1903. But, most importantly, it records the number of allocated objects of
  1904. each kind. This is useful when searching for memory leaks.
  1905. A Guile compiled with this option provides the primitive
  1906. `malloc-stats' which returns an alist with pairs of kind and the
  1907. number of objects of that kind.
  1908. ** All includes are now referenced relative to the root directory
  1909. Since some users have had problems with mixups between Guile and
  1910. system headers, we have decided to always refer to Guile headers via
  1911. their parent directories. This essentially creates a "private name
  1912. space" for Guile headers. This means that the compiler only is given
  1913. -I options for the root build and root source directory.
  1914. ** Header files kw.h and genio.h have been removed.
  1915. ** The module (ice-9 getopt-gnu-style) has been removed.
  1916. ** New module (ice-9 documentation)
  1917. Implements the interface to documentation strings associated with
  1918. objects.
  1919. ** New module (ice-9 time)
  1920. Provides a macro `time', which displays execution time of a given form.
  1921. ** New module (ice-9 history)
  1922. Loading this module enables value history in the repl.
  1923. * Changes to the stand-alone interpreter
  1924. ** New command line option --debug
  1925. Start Guile with debugging evaluator and backtraces enabled.
  1926. This is useful when debugging your .guile init file or scripts.
  1927. ** New help facility
  1928. Usage: (help NAME) gives documentation about objects named NAME (a symbol)
  1929. (help REGEXP) ditto for objects with names matching REGEXP (a string)
  1930. (help 'NAME) gives documentation for NAME, even if it is not an object
  1931. (help ,EXPR) gives documentation for object returned by EXPR
  1932. (help (my module)) gives module commentary for `(my module)'
  1933. (help) gives this text
  1934. `help' searches among bindings exported from loaded modules, while
  1935. `apropos' searches among bindings visible from the "current" module.
  1936. Examples: (help help)
  1937. (help cons)
  1938. (help "output-string")
  1939. ** `help' and `apropos' now prints full module names
  1940. ** Dynamic linking now uses libltdl from the libtool package.
  1941. The old system dependent code for doing dynamic linking has been
  1942. replaced with calls to the libltdl functions which do all the hairy
  1943. details for us.
  1944. The major improvement is that you can now directly pass libtool
  1945. library names like "libfoo.la" to `dynamic-link' and `dynamic-link'
  1946. will be able to do the best shared library job you can get, via
  1947. libltdl.
  1948. The way dynamic libraries are found has changed and is not really
  1949. portable across platforms, probably. It is therefore recommended to
  1950. use absolute filenames when possible.
  1951. If you pass a filename without an extension to `dynamic-link', it will
  1952. try a few appropriate ones. Thus, the most platform ignorant way is
  1953. to specify a name like "libfoo", without any directories and
  1954. extensions.
  1955. ** Guile COOP threads are now compatible with LinuxThreads
  1956. Previously, COOP threading wasn't possible in applications linked with
  1957. Linux POSIX threads due to their use of the stack pointer to find the
  1958. thread context. This has now been fixed with a workaround which uses
  1959. the pthreads to allocate the stack.
  1960. ** New primitives: `pkgdata-dir', `site-dir', `library-dir'
  1961. ** Positions of erring expression in scripts
  1962. With version 1.3.4, the location of the erring expression in Guile
  1963. scipts is no longer automatically reported. (This should have been
  1964. documented before the 1.3.4 release.)
  1965. You can get this information by enabling recording of positions of
  1966. source expressions and running the debugging evaluator. Put this at
  1967. the top of your script (or in your "site" file):
  1968. (read-enable 'positions)
  1969. (debug-enable 'debug)
  1970. ** Backtraces in scripts
  1971. It is now possible to get backtraces in scripts.
  1972. Put
  1973. (debug-enable 'debug 'backtrace)
  1974. at the top of the script.
  1975. (The first options enables the debugging evaluator.
  1976. The second enables backtraces.)
  1977. ** Part of module system symbol lookup now implemented in C
  1978. The eval closure of most modules is now implemented in C. Since this
  1979. was one of the bottlenecks for loading speed, Guile now loads code
  1980. substantially faster than before.
  1981. ** Attempting to get the value of an unbound variable now produces
  1982. an exception with a key of 'unbound-variable instead of 'misc-error.
  1983. ** The initial default output port is now unbuffered if it's using a
  1984. tty device. Previously in this situation it was line-buffered.
  1985. ** New hook: after-gc-hook
  1986. after-gc-hook takes over the role of gc-thunk. This hook is run at
  1987. the first SCM_TICK after a GC. (Thus, the code is run at the same
  1988. point during evaluation as signal handlers.)
  1989. Note that this hook should be used only for diagnostic and debugging
  1990. purposes. It is not certain that it will continue to be well-defined
  1991. when this hook is run in the future.
  1992. C programmers: Note the new C level hooks scm_before_gc_c_hook,
  1993. scm_before_sweep_c_hook, scm_after_gc_c_hook.
  1994. ** Improvements to garbage collector
  1995. Guile 1.4 has a new policy for triggering heap allocation and
  1996. determining the sizes of heap segments. It fixes a number of problems
  1997. in the old GC.
  1998. 1. The new policy can handle two separate pools of cells
  1999. (2-word/4-word) better. (The old policy would run wild, allocating
  2000. more and more memory for certain programs.)
  2001. 2. The old code would sometimes allocate far too much heap so that the
  2002. Guile process became gigantic. The new code avoids this.
  2003. 3. The old code would sometimes allocate too little so that few cells
  2004. were freed at GC so that, in turn, too much time was spent in GC.
  2005. 4. The old code would often trigger heap allocation several times in a
  2006. row. (The new scheme predicts how large the segments needs to be
  2007. in order not to need further allocation.)
  2008. All in all, the new GC policy will make larger applications more
  2009. efficient.
  2010. The new GC scheme also is prepared for POSIX threading. Threads can
  2011. allocate private pools of cells ("clusters") with just a single
  2012. function call. Allocation of single cells from such a cluster can
  2013. then proceed without any need of inter-thread synchronization.
  2014. ** New environment variables controlling GC parameters
  2015. GUILE_MAX_SEGMENT_SIZE Maximal segment size
  2016. (default = 2097000)
  2017. Allocation of 2-word cell heaps:
  2018. GUILE_INIT_SEGMENT_SIZE_1 Size of initial heap segment in bytes
  2019. (default = 360000)
  2020. GUILE_MIN_YIELD_1 Minimum number of freed cells at each
  2021. GC in percent of total heap size
  2022. (default = 40)
  2023. Allocation of 4-word cell heaps
  2024. (used for real numbers and misc other objects):
  2025. GUILE_INIT_SEGMENT_SIZE_2, GUILE_MIN_YIELD_2
  2026. (See entry "Way for application to customize GC parameters" under
  2027. section "Changes to the scm_ interface" below.)
  2028. ** Guile now implements reals using 4-word cells
  2029. This speeds up computation with reals. (They were earlier allocated
  2030. with `malloc'.) There is still some room for optimizations, however.
  2031. ** Some further steps toward POSIX thread support have been taken
  2032. *** Guile's critical sections (SCM_DEFER/ALLOW_INTS)
  2033. don't have much effect any longer, and many of them will be removed in
  2034. next release.
  2035. *** Signals
  2036. are only handled at the top of the evaluator loop, immediately after
  2037. I/O, and in scm_equalp.
  2038. *** The GC can allocate thread private pools of pairs.
  2039. * Changes to Scheme functions and syntax
  2040. ** close-input-port and close-output-port are now R5RS
  2041. These procedures have been turned into primitives and have R5RS behaviour.
  2042. ** New procedure: simple-format PORT MESSAGE ARG1 ...
  2043. (ice-9 boot) makes `format' an alias for `simple-format' until possibly
  2044. extended by the more sophisticated version in (ice-9 format)
  2045. (simple-format port message . args)
  2046. Write MESSAGE to DESTINATION, defaulting to `current-output-port'.
  2047. MESSAGE can contain ~A (was %s) and ~S (was %S) escapes. When printed,
  2048. the escapes are replaced with corresponding members of ARGS:
  2049. ~A formats using `display' and ~S formats using `write'.
  2050. If DESTINATION is #t, then use the `current-output-port',
  2051. if DESTINATION is #f, then return a string containing the formatted text.
  2052. Does not add a trailing newline."
  2053. ** string-ref: the second argument is no longer optional.
  2054. ** string, list->string: no longer accept strings in their arguments,
  2055. only characters, for compatibility with R5RS.
  2056. ** New procedure: port-closed? PORT
  2057. Returns #t if PORT is closed or #f if it is open.
  2058. ** Deprecated: list*
  2059. The list* functionality is now provided by cons* (SRFI-1 compliant)
  2060. ** New procedure: cons* ARG1 ARG2 ... ARGn
  2061. Like `list', but the last arg provides the tail of the constructed list,
  2062. returning (cons ARG1 (cons ARG2 (cons ... ARGn))).
  2063. Requires at least one argument. If given one argument, that argument
  2064. is returned as result.
  2065. This function is called `list*' in some other Schemes and in Common LISP.
  2066. ** Removed deprecated: serial-map, serial-array-copy!, serial-array-map!
  2067. ** New procedure: object-documentation OBJECT
  2068. Returns the documentation string associated with OBJECT. The
  2069. procedure uses a caching mechanism so that subsequent lookups are
  2070. faster.
  2071. Exported by (ice-9 documentation).
  2072. ** module-name now returns full names of modules
  2073. Previously, only the last part of the name was returned (`session' for
  2074. `(ice-9 session)'). Ex: `(ice-9 session)'.
  2075. * Changes to the gh_ interface
  2076. ** Deprecated: gh_int2scmb
  2077. Use gh_bool2scm instead.
  2078. * Changes to the scm_ interface
  2079. ** Guile primitives now carry docstrings!
  2080. Thanks to Greg Badros!
  2081. ** Guile primitives are defined in a new way: SCM_DEFINE/SCM_DEFINE1/SCM_PROC
  2082. Now Guile primitives are defined using the SCM_DEFINE/SCM_DEFINE1/SCM_PROC
  2083. macros and must contain a docstring that is extracted into foo.doc using a new
  2084. guile-doc-snarf script (that uses guile-doc-snarf.awk).
  2085. However, a major overhaul of these macros is scheduled for the next release of
  2086. guile.
  2087. ** Guile primitives use a new technique for validation of arguments
  2088. SCM_VALIDATE_* macros are defined to ease the redundancy and improve
  2089. the readability of argument checking.
  2090. ** All (nearly?) K&R prototypes for functions replaced with ANSI C equivalents.
  2091. ** New macros: SCM_PACK, SCM_UNPACK
  2092. Compose/decompose an SCM value.
  2093. The SCM type is now treated as an abstract data type and may be defined as a
  2094. long, a void* or as a struct, depending on the architecture and compile time
  2095. options. This makes it easier to find several types of bugs, for example when
  2096. SCM values are treated as integers without conversion. Values of the SCM type
  2097. should be treated as "atomic" values. These macros are used when
  2098. composing/decomposing an SCM value, either because you want to access
  2099. individual bits, or because you want to treat it as an integer value.
  2100. E.g., in order to set bit 7 in an SCM value x, use the expression
  2101. SCM_PACK (SCM_UNPACK (x) | 0x80)
  2102. ** The name property of hooks is deprecated.
  2103. Thus, the use of SCM_HOOK_NAME and scm_make_hook_with_name is deprecated.
  2104. You can emulate this feature by using object properties.
  2105. ** Deprecated macros: SCM_INPORTP, SCM_OUTPORTP, SCM_CRDY, SCM_ICHRP,
  2106. SCM_ICHR, SCM_MAKICHR, SCM_SETJMPBUF, SCM_NSTRINGP, SCM_NRWSTRINGP,
  2107. SCM_NVECTORP
  2108. These macros will be removed in a future release of Guile.
  2109. ** The following types, functions and macros from numbers.h are deprecated:
  2110. scm_dblproc, SCM_UNEGFIXABLE, SCM_FLOBUFLEN, SCM_INEXP, SCM_CPLXP, SCM_REAL,
  2111. SCM_IMAG, SCM_REALPART, scm_makdbl, SCM_SINGP, SCM_NUM2DBL, SCM_NO_BIGDIG
  2112. ** Port internals: the rw_random variable in the scm_port structure
  2113. must be set to non-zero in any random access port. In recent Guile
  2114. releases it was only set for bidirectional random-access ports.
  2115. ** Port internals: the seek ptob procedure is now responsible for
  2116. resetting the buffers if required. The change was made so that in the
  2117. special case of reading the current position (i.e., seek p 0 SEEK_CUR)
  2118. the fport and strport ptobs can avoid resetting the buffers,
  2119. in particular to avoid discarding unread chars. An existing port
  2120. type can be fixed by adding something like the following to the
  2121. beginning of the ptob seek procedure:
  2122. if (pt->rw_active == SCM_PORT_READ)
  2123. scm_end_input (object);
  2124. else if (pt->rw_active == SCM_PORT_WRITE)
  2125. ptob->flush (object);
  2126. although to actually avoid resetting the buffers and discard unread
  2127. chars requires further hacking that depends on the characteristics
  2128. of the ptob.
  2129. ** Deprecated functions: scm_fseek, scm_tag
  2130. These functions are no longer used and will be removed in a future version.
  2131. ** The scm_sysmissing procedure is no longer used in libguile.
  2132. Unless it turns out to be unexpectedly useful to somebody, it will be
  2133. removed in a future version.
  2134. ** The format of error message strings has changed
  2135. The two C procedures: scm_display_error and scm_error, as well as the
  2136. primitive `scm-error', now use scm_simple_format to do their work.
  2137. This means that the message strings of all code must be updated to use
  2138. ~A where %s was used before, and ~S where %S was used before.
  2139. During the period when there still are a lot of old Guiles out there,
  2140. you might want to support both old and new versions of Guile.
  2141. There are basically two methods to achieve this. Both methods use
  2142. autoconf. Put
  2143. AC_CHECK_FUNCS(scm_simple_format)
  2144. in your configure.in.
  2145. Method 1: Use the string concatenation features of ANSI C's
  2146. preprocessor.
  2147. In C:
  2148. #ifdef HAVE_SCM_SIMPLE_FORMAT
  2149. #define FMT_S "~S"
  2150. #else
  2151. #define FMT_S "%S"
  2152. #endif
  2153. Then represent each of your error messages using a preprocessor macro:
  2154. #define E_SPIDER_ERROR "There's a spider in your " ## FMT_S ## "!!!"
  2155. In Scheme:
  2156. (define fmt-s (if (defined? 'simple-format) "~S" "%S"))
  2157. (define make-message string-append)
  2158. (define e-spider-error (make-message "There's a spider in your " fmt-s "!!!"))
  2159. Method 2: Use the oldfmt function found in doc/oldfmt.c.
  2160. In C:
  2161. scm_misc_error ("picnic", scm_c_oldfmt0 ("There's a spider in your ~S!!!"),
  2162. ...);
  2163. In Scheme:
  2164. (scm-error 'misc-error "picnic" (oldfmt "There's a spider in your ~S!!!")
  2165. ...)
  2166. ** Deprecated: coop_mutex_init, coop_condition_variable_init
  2167. Don't use the functions coop_mutex_init and
  2168. coop_condition_variable_init. They will change.
  2169. Use scm_mutex_init and scm_cond_init instead.
  2170. ** New function: int scm_cond_timedwait (scm_cond_t *COND, scm_mutex_t *MUTEX, const struct timespec *ABSTIME)
  2171. `scm_cond_timedwait' atomically unlocks MUTEX and waits on
  2172. COND, as `scm_cond_wait' does, but it also bounds the duration
  2173. of the wait. If COND has not been signaled before time ABSTIME,
  2174. the mutex MUTEX is re-acquired and `scm_cond_timedwait'
  2175. returns the error code `ETIMEDOUT'.
  2176. The ABSTIME parameter specifies an absolute time, with the same
  2177. origin as `time' and `gettimeofday': an ABSTIME of 0 corresponds
  2178. to 00:00:00 GMT, January 1, 1970.
  2179. ** New function: scm_cond_broadcast (scm_cond_t *COND)
  2180. `scm_cond_broadcast' restarts all the threads that are waiting
  2181. on the condition variable COND. Nothing happens if no threads are
  2182. waiting on COND.
  2183. ** New function: scm_key_create (scm_key_t *KEY, void (*destr_function) (void *))
  2184. `scm_key_create' allocates a new TSD key. The key is stored in
  2185. the location pointed to by KEY. There is no limit on the number
  2186. of keys allocated at a given time. The value initially associated
  2187. with the returned key is `NULL' in all currently executing threads.
  2188. The DESTR_FUNCTION argument, if not `NULL', specifies a destructor
  2189. function associated with the key. When a thread terminates,
  2190. DESTR_FUNCTION is called on the value associated with the key in
  2191. that thread. The DESTR_FUNCTION is not called if a key is deleted
  2192. with `scm_key_delete' or a value is changed with
  2193. `scm_setspecific'. The order in which destructor functions are
  2194. called at thread termination time is unspecified.
  2195. Destructors are not yet implemented.
  2196. ** New function: scm_setspecific (scm_key_t KEY, const void *POINTER)
  2197. `scm_setspecific' changes the value associated with KEY in the
  2198. calling thread, storing the given POINTER instead.
  2199. ** New function: scm_getspecific (scm_key_t KEY)
  2200. `scm_getspecific' returns the value currently associated with
  2201. KEY in the calling thread.
  2202. ** New function: scm_key_delete (scm_key_t KEY)
  2203. `scm_key_delete' deallocates a TSD key. It does not check
  2204. whether non-`NULL' values are associated with that key in the
  2205. currently executing threads, nor call the destructor function
  2206. associated with the key.
  2207. ** New function: scm_c_hook_init (scm_c_hook_t *HOOK, void *HOOK_DATA, scm_c_hook_type_t TYPE)
  2208. Initialize a C level hook HOOK with associated HOOK_DATA and type
  2209. TYPE. (See scm_c_hook_run ().)
  2210. ** New function: scm_c_hook_add (scm_c_hook_t *HOOK, scm_c_hook_function_t FUNC, void *FUNC_DATA, int APPENDP)
  2211. Add hook function FUNC with associated FUNC_DATA to HOOK. If APPENDP
  2212. is true, add it last, otherwise first. The same FUNC can be added
  2213. multiple times if FUNC_DATA differ and vice versa.
  2214. ** New function: scm_c_hook_remove (scm_c_hook_t *HOOK, scm_c_hook_function_t FUNC, void *FUNC_DATA)
  2215. Remove hook function FUNC with associated FUNC_DATA from HOOK. A
  2216. function is only removed if both FUNC and FUNC_DATA matches.
  2217. ** New function: void *scm_c_hook_run (scm_c_hook_t *HOOK, void *DATA)
  2218. Run hook HOOK passing DATA to the hook functions.
  2219. If TYPE is SCM_C_HOOK_NORMAL, all hook functions are run. The value
  2220. returned is undefined.
  2221. If TYPE is SCM_C_HOOK_OR, hook functions are run until a function
  2222. returns a non-NULL value. This value is returned as the result of
  2223. scm_c_hook_run. If all functions return NULL, NULL is returned.
  2224. If TYPE is SCM_C_HOOK_AND, hook functions are run until a function
  2225. returns a NULL value, and NULL is returned. If all functions returns
  2226. a non-NULL value, the last value is returned.
  2227. ** New C level GC hooks
  2228. Five new C level hooks has been added to the garbage collector.
  2229. scm_before_gc_c_hook
  2230. scm_after_gc_c_hook
  2231. are run before locking and after unlocking the heap. The system is
  2232. thus in a mode where evaluation can take place. (Except that
  2233. scm_before_gc_c_hook must not allocate new cells.)
  2234. scm_before_mark_c_hook
  2235. scm_before_sweep_c_hook
  2236. scm_after_sweep_c_hook
  2237. are run when the heap is locked. These are intended for extension of
  2238. the GC in a modular fashion. Examples are the weaks and guardians
  2239. modules.
  2240. ** Way for application to customize GC parameters
  2241. The application can set up other default values for the GC heap
  2242. allocation parameters
  2243. GUILE_INIT_HEAP_SIZE_1, GUILE_MIN_YIELD_1,
  2244. GUILE_INIT_HEAP_SIZE_2, GUILE_MIN_YIELD_2,
  2245. GUILE_MAX_SEGMENT_SIZE,
  2246. by setting
  2247. scm_default_init_heap_size_1, scm_default_min_yield_1,
  2248. scm_default_init_heap_size_2, scm_default_min_yield_2,
  2249. scm_default_max_segment_size
  2250. respectively before callong scm_boot_guile.
  2251. (See entry "New environment variables ..." in section
  2252. "Changes to the stand-alone interpreter" above.)
  2253. ** scm_protect_object/scm_unprotect_object now nest
  2254. This means that you can call scm_protect_object multiple times on an
  2255. object and count on the object being protected until
  2256. scm_unprotect_object has been call the same number of times.
  2257. The functions also have better time complexity.
  2258. Still, it is usually possible to structure the application in a way
  2259. that you don't need to use these functions. For example, if you use a
  2260. protected standard Guile list to keep track of live objects rather
  2261. than some custom data type, objects will die a natural death when they
  2262. are no longer needed.
  2263. ** Deprecated type tags: scm_tc16_flo, scm_tc_flo, scm_tc_dblr, scm_tc_dblc
  2264. Guile does not provide the float representation for inexact real numbers any
  2265. more. Now, only doubles are used to represent inexact real numbers. Further,
  2266. the tag names scm_tc_dblr and scm_tc_dblc have been changed to scm_tc16_real
  2267. and scm_tc16_complex, respectively.
  2268. ** Removed deprecated type scm_smobfuns
  2269. ** Removed deprecated function scm_newsmob
  2270. ** Warning: scm_make_smob_type_mfpe might become deprecated in a future release
  2271. There is an ongoing discussion among the developers whether to
  2272. deprecate `scm_make_smob_type_mfpe' or not. Please use the current
  2273. standard interface (scm_make_smob_type, scm_set_smob_XXX) in new code
  2274. until this issue has been settled.
  2275. ** Removed deprecated type tag scm_tc16_kw
  2276. ** Added type tag scm_tc16_keyword
  2277. (This was introduced already in release 1.3.4 but was not documented
  2278. until now.)
  2279. ** gdb_print now prints "*** Guile not initialized ***" until Guile initialized
  2280. * Changes to system call interfaces:
  2281. ** The "select" procedure now tests port buffers for the ability to
  2282. provide input or accept output. Previously only the underlying file
  2283. descriptors were checked.
  2284. ** New variable PIPE_BUF: the maximum number of bytes that can be
  2285. atomically written to a pipe.
  2286. ** If a facility is not available on the system when Guile is
  2287. compiled, the corresponding primitive procedure will not be defined.
  2288. Previously it would have been defined but would throw a system-error
  2289. exception if called. Exception handlers which catch this case may
  2290. need minor modification: an error will be thrown with key
  2291. 'unbound-variable instead of 'system-error. Alternatively it's
  2292. now possible to use `defined?' to check whether the facility is
  2293. available.
  2294. ** Procedures which depend on the timezone should now give the correct
  2295. result on systems which cache the TZ environment variable, even if TZ
  2296. is changed without calling tzset.
  2297. * Changes to the networking interfaces:
  2298. ** New functions: htons, ntohs, htonl, ntohl: for converting short and
  2299. long integers between network and host format. For now, it's not
  2300. particularly convenient to do this kind of thing, but consider:
  2301. (define write-network-long
  2302. (lambda (value port)
  2303. (let ((v (make-uniform-vector 1 1 0)))
  2304. (uniform-vector-set! v 0 (htonl value))
  2305. (uniform-vector-write v port))))
  2306. (define read-network-long
  2307. (lambda (port)
  2308. (let ((v (make-uniform-vector 1 1 0)))
  2309. (uniform-vector-read! v port)
  2310. (ntohl (uniform-vector-ref v 0)))))
  2311. ** If inet-aton fails, it now throws an error with key 'misc-error
  2312. instead of 'system-error, since errno is not relevant.
  2313. ** Certain gethostbyname/gethostbyaddr failures now throw errors with
  2314. specific keys instead of 'system-error. The latter is inappropriate
  2315. since errno will not have been set. The keys are:
  2316. 'host-not-found, 'try-again, 'no-recovery and 'no-data.
  2317. ** sethostent, setnetent, setprotoent, setservent: now take an
  2318. optional argument STAYOPEN, which specifies whether the database
  2319. remains open after a database entry is accessed randomly (e.g., using
  2320. gethostbyname for the hosts database.) The default is #f. Previously
  2321. #t was always used.
  2322. Changes since Guile 1.3.2:
  2323. * Changes to the stand-alone interpreter
  2324. ** Debugger
  2325. An initial version of the Guile debugger written by Chris Hanson has
  2326. been added. The debugger is still under development but is included
  2327. in the distribution anyway since it is already quite useful.
  2328. Type
  2329. (debug)
  2330. after an error to enter the debugger. Type `help' inside the debugger
  2331. for a description of available commands.
  2332. If you prefer to have stack frames numbered and printed in
  2333. anti-chronological order and prefer up in the stack to be down on the
  2334. screen as is the case in gdb, you can put
  2335. (debug-enable 'backwards)
  2336. in your .guile startup file. (However, this means that Guile can't
  2337. use indentation to indicate stack level.)
  2338. The debugger is autoloaded into Guile at the first use.
  2339. ** Further enhancements to backtraces
  2340. There is a new debug option `width' which controls the maximum width
  2341. on the screen of printed stack frames. Fancy printing parameters
  2342. ("level" and "length" as in Common LISP) are adaptively adjusted for
  2343. each stack frame to give maximum information while still fitting
  2344. within the bounds. If the stack frame can't be made to fit by
  2345. adjusting parameters, it is simply cut off at the end. This is marked
  2346. with a `$'.
  2347. ** Some modules are now only loaded when the repl is started
  2348. The modules (ice-9 debug), (ice-9 session), (ice-9 threads) and (ice-9
  2349. regex) are now loaded into (guile-user) only if the repl has been
  2350. started. The effect is that the startup time for scripts has been
  2351. reduced to 30% of what it was previously.
  2352. Correctly written scripts load the modules they require at the top of
  2353. the file and should not be affected by this change.
  2354. ** Hooks are now represented as smobs
  2355. * Changes to Scheme functions and syntax
  2356. ** Readline support has changed again.
  2357. The old (readline-activator) module is gone. Use (ice-9 readline)
  2358. instead, which now contains all readline functionality. So the code
  2359. to activate readline is now
  2360. (use-modules (ice-9 readline))
  2361. (activate-readline)
  2362. This should work at any time, including from the guile prompt.
  2363. To avoid confusion about the terms of Guile's license, please only
  2364. enable readline for your personal use; please don't make it the
  2365. default for others. Here is why we make this rather odd-sounding
  2366. request:
  2367. Guile is normally licensed under a weakened form of the GNU General
  2368. Public License, which allows you to link code with Guile without
  2369. placing that code under the GPL. This exception is important to some
  2370. people.
  2371. However, since readline is distributed under the GNU General Public
  2372. License, when you link Guile with readline, either statically or
  2373. dynamically, you effectively change Guile's license to the strict GPL.
  2374. Whenever you link any strictly GPL'd code into Guile, uses of Guile
  2375. which are normally permitted become forbidden. This is a rather
  2376. non-obvious consequence of the licensing terms.
  2377. So, to make sure things remain clear, please let people choose for
  2378. themselves whether to link GPL'd libraries like readline with Guile.
  2379. ** regexp-substitute/global has changed slightly, but incompatibly.
  2380. If you include a function in the item list, the string of the match
  2381. object it receives is the same string passed to
  2382. regexp-substitute/global, not some suffix of that string.
  2383. Correspondingly, the match's positions are relative to the entire
  2384. string, not the suffix.
  2385. If the regexp can match the empty string, the way matches are chosen
  2386. from the string has changed. regexp-substitute/global recognizes the
  2387. same set of matches that list-matches does; see below.
  2388. ** New function: list-matches REGEXP STRING [FLAGS]
  2389. Return a list of match objects, one for every non-overlapping, maximal
  2390. match of REGEXP in STRING. The matches appear in left-to-right order.
  2391. list-matches only reports matches of the empty string if there are no
  2392. other matches which begin on, end at, or include the empty match's
  2393. position.
  2394. If present, FLAGS is passed as the FLAGS argument to regexp-exec.
  2395. ** New function: fold-matches REGEXP STRING INIT PROC [FLAGS]
  2396. For each match of REGEXP in STRING, apply PROC to the match object,
  2397. and the last value PROC returned, or INIT for the first call. Return
  2398. the last value returned by PROC. We apply PROC to the matches as they
  2399. appear from left to right.
  2400. This function recognizes matches according to the same criteria as
  2401. list-matches.
  2402. Thus, you could define list-matches like this:
  2403. (define (list-matches regexp string . flags)
  2404. (reverse! (apply fold-matches regexp string '() cons flags)))
  2405. If present, FLAGS is passed as the FLAGS argument to regexp-exec.
  2406. ** Hooks
  2407. *** New function: hook? OBJ
  2408. Return #t if OBJ is a hook, otherwise #f.
  2409. *** New function: make-hook-with-name NAME [ARITY]
  2410. Return a hook with name NAME and arity ARITY. The default value for
  2411. ARITY is 0. The only effect of NAME is that it will appear when the
  2412. hook object is printed to ease debugging.
  2413. *** New function: hook-empty? HOOK
  2414. Return #t if HOOK doesn't contain any procedures, otherwise #f.
  2415. *** New function: hook->list HOOK
  2416. Return a list of the procedures that are called when run-hook is
  2417. applied to HOOK.
  2418. ** `map' signals an error if its argument lists are not all the same length.
  2419. This is the behavior required by R5RS, so this change is really a bug
  2420. fix. But it seems to affect a lot of people's code, so we're
  2421. mentioning it here anyway.
  2422. ** Print-state handling has been made more transparent
  2423. Under certain circumstances, ports are represented as a port with an
  2424. associated print state. Earlier, this pair was represented as a pair
  2425. (see "Some magic has been added to the printer" below). It is now
  2426. indistinguishable (almost; see `get-print-state') from a port on the
  2427. user level.
  2428. *** New function: port-with-print-state OUTPUT-PORT PRINT-STATE
  2429. Return a new port with the associated print state PRINT-STATE.
  2430. *** New function: get-print-state OUTPUT-PORT
  2431. Return the print state associated with this port if it exists,
  2432. otherwise return #f.
  2433. *** New function: directory-stream? OBJECT
  2434. Returns true iff OBJECT is a directory stream --- the sort of object
  2435. returned by `opendir'.
  2436. ** New function: using-readline?
  2437. Return #t if readline is in use in the current repl.
  2438. ** structs will be removed in 1.4
  2439. Structs will be replaced in Guile 1.4. We will merge GOOPS into Guile
  2440. and use GOOPS objects as the fundamental record type.
  2441. * Changes to the scm_ interface
  2442. ** structs will be removed in 1.4
  2443. The entire current struct interface (struct.c, struct.h) will be
  2444. replaced in Guile 1.4. We will merge GOOPS into libguile and use
  2445. GOOPS objects as the fundamental record type.
  2446. ** The internal representation of subr's has changed
  2447. Instead of giving a hint to the subr name, the CAR field of the subr
  2448. now contains an index to a subr entry in scm_subr_table.
  2449. *** New variable: scm_subr_table
  2450. An array of subr entries. A subr entry contains the name, properties
  2451. and documentation associated with the subr. The properties and
  2452. documentation slots are not yet used.
  2453. ** A new scheme for "forwarding" calls to a builtin to a generic function
  2454. It is now possible to extend the functionality of some Guile
  2455. primitives by letting them defer a call to a GOOPS generic function on
  2456. argument mismatch. This means that there is no loss of efficiency in
  2457. normal evaluation.
  2458. Example:
  2459. (use-modules (oop goops)) ; Must be GOOPS version 0.2.
  2460. (define-method + ((x <string>) (y <string>))
  2461. (string-append x y))
  2462. + will still be as efficient as usual in numerical calculations, but
  2463. can also be used for concatenating strings.
  2464. Who will be the first one to extend Guile's numerical tower to
  2465. rationals? :) [OK, there a few other things to fix before this can
  2466. be made in a clean way.]
  2467. *** New snarf macros for defining primitives: SCM_GPROC, SCM_GPROC1
  2468. New macro: SCM_GPROC (CNAME, SNAME, REQ, OPT, VAR, CFUNC, GENERIC)
  2469. New macro: SCM_GPROC1 (CNAME, SNAME, TYPE, CFUNC, GENERIC)
  2470. These do the same job as SCM_PROC and SCM_PROC1, but they also define
  2471. a variable GENERIC which can be used by the dispatch macros below.
  2472. [This is experimental code which may change soon.]
  2473. *** New macros for forwarding control to a generic on arg type error
  2474. New macro: SCM_WTA_DISPATCH_1 (GENERIC, ARG1, POS, SUBR)
  2475. New macro: SCM_WTA_DISPATCH_2 (GENERIC, ARG1, ARG2, POS, SUBR)
  2476. These correspond to the scm_wta function call, and have the same
  2477. behaviour until the user has called the GOOPS primitive
  2478. `enable-primitive-generic!'. After that, these macros will apply the
  2479. generic function GENERIC to the argument(s) instead of calling
  2480. scm_wta.
  2481. [This is experimental code which may change soon.]
  2482. *** New macros for argument testing with generic dispatch
  2483. New macro: SCM_GASSERT1 (COND, GENERIC, ARG1, POS, SUBR)
  2484. New macro: SCM_GASSERT2 (COND, GENERIC, ARG1, ARG2, POS, SUBR)
  2485. These correspond to the SCM_ASSERT macro, but will defer control to
  2486. GENERIC on error after `enable-primitive-generic!' has been called.
  2487. [This is experimental code which may change soon.]
  2488. ** New function: SCM scm_eval_body (SCM body, SCM env)
  2489. Evaluates the body of a special form.
  2490. ** The internal representation of struct's has changed
  2491. Previously, four slots were allocated for the procedure(s) of entities
  2492. and operators. The motivation for this representation had to do with
  2493. the structure of the evaluator, the wish to support tail-recursive
  2494. generic functions, and efficiency. Since the generic function
  2495. dispatch mechanism has changed, there is no longer a need for such an
  2496. expensive representation, and the representation has been simplified.
  2497. This should not make any difference for most users.
  2498. ** GOOPS support has been cleaned up.
  2499. Some code has been moved from eval.c to objects.c and code in both of
  2500. these compilation units has been cleaned up and better structured.
  2501. *** New functions for applying generic functions
  2502. New function: SCM scm_apply_generic (GENERIC, ARGS)
  2503. New function: SCM scm_call_generic_0 (GENERIC)
  2504. New function: SCM scm_call_generic_1 (GENERIC, ARG1)
  2505. New function: SCM scm_call_generic_2 (GENERIC, ARG1, ARG2)
  2506. New function: SCM scm_call_generic_3 (GENERIC, ARG1, ARG2, ARG3)
  2507. ** Deprecated function: scm_make_named_hook
  2508. It is now replaced by:
  2509. ** New function: SCM scm_create_hook (const char *name, int arity)
  2510. Creates a hook in the same way as make-hook above but also
  2511. binds a variable named NAME to it.
  2512. This is the typical way of creating a hook from C code.
  2513. Currently, the variable is created in the "current" module.
  2514. This might change when we get the new module system.
  2515. [The behaviour is identical to scm_make_named_hook.]
  2516. Changes since Guile 1.3:
  2517. * Changes to mailing lists
  2518. ** Some of the Guile mailing lists have moved to sourceware.cygnus.com.
  2519. See the README file to find current addresses for all the Guile
  2520. mailing lists.
  2521. * Changes to the distribution
  2522. ** Readline support is no longer included with Guile by default.
  2523. Based on the different license terms of Guile and Readline, we
  2524. concluded that Guile should not *by default* cause the linking of
  2525. Readline into an application program. Readline support is now offered
  2526. as a separate module, which is linked into an application only when
  2527. you explicitly specify it.
  2528. Although Guile is GNU software, its distribution terms add a special
  2529. exception to the usual GNU General Public License (GPL). Guile's
  2530. license includes a clause that allows you to link Guile with non-free
  2531. programs. We add this exception so as not to put Guile at a
  2532. disadvantage vis-a-vis other extensibility packages that support other
  2533. languages.
  2534. In contrast, the GNU Readline library is distributed under the GNU
  2535. General Public License pure and simple. This means that you may not
  2536. link Readline, even dynamically, into an application unless it is
  2537. distributed under a free software license that is compatible the GPL.
  2538. Because of this difference in distribution terms, an application that
  2539. can use Guile may not be able to use Readline. Now users will be
  2540. explicitly offered two independent decisions about the use of these
  2541. two packages.
  2542. You can activate the readline support by issuing
  2543. (use-modules (readline-activator))
  2544. (activate-readline)
  2545. from your ".guile" file, for example.
  2546. * Changes to the stand-alone interpreter
  2547. ** All builtins now print as primitives.
  2548. Previously builtin procedures not belonging to the fundamental subr
  2549. types printed as #<compiled closure #<primitive-procedure gsubr-apply>>.
  2550. Now, they print as #<primitive-procedure NAME>.
  2551. ** Backtraces slightly more intelligible.
  2552. gsubr-apply and macro transformer application frames no longer appear
  2553. in backtraces.
  2554. * Changes to Scheme functions and syntax
  2555. ** Guile now correctly handles internal defines by rewriting them into
  2556. their equivalent letrec. Previously, internal defines would
  2557. incrementally add to the innermost environment, without checking
  2558. whether the restrictions specified in RnRS were met. This lead to the
  2559. correct behaviour when these restriction actually were met, but didn't
  2560. catch all illegal uses. Such an illegal use could lead to crashes of
  2561. the Guile interpreter or or other unwanted results. An example of
  2562. incorrect internal defines that made Guile behave erratically:
  2563. (let ()
  2564. (define a 1)
  2565. (define (b) a)
  2566. (define c (1+ (b)))
  2567. (define d 3)
  2568. (b))
  2569. => 2
  2570. The problem with this example is that the definition of `c' uses the
  2571. value of `b' directly. This confuses the meoization machine of Guile
  2572. so that the second call of `b' (this time in a larger environment that
  2573. also contains bindings for `c' and `d') refers to the binding of `c'
  2574. instead of `a'. You could also make Guile crash with a variation on
  2575. this theme:
  2576. (define (foo flag)
  2577. (define a 1)
  2578. (define (b flag) (if flag a 1))
  2579. (define c (1+ (b flag)))
  2580. (define d 3)
  2581. (b #t))
  2582. (foo #f)
  2583. (foo #t)
  2584. From now on, Guile will issue an `Unbound variable: b' error message
  2585. for both examples.
  2586. ** Hooks
  2587. A hook contains a list of functions which should be called on
  2588. particular occasions in an existing program. Hooks are used for
  2589. customization.
  2590. A window manager might have a hook before-window-map-hook. The window
  2591. manager uses the function run-hooks to call all functions stored in
  2592. before-window-map-hook each time a window is mapped. The user can
  2593. store functions in the hook using add-hook!.
  2594. In Guile, hooks are first class objects.
  2595. *** New function: make-hook [N_ARGS]
  2596. Return a hook for hook functions which can take N_ARGS arguments.
  2597. The default value for N_ARGS is 0.
  2598. (See also scm_make_named_hook below.)
  2599. *** New function: add-hook! HOOK PROC [APPEND_P]
  2600. Put PROC at the beginning of the list of functions stored in HOOK.
  2601. If APPEND_P is supplied, and non-false, put PROC at the end instead.
  2602. PROC must be able to take the number of arguments specified when the
  2603. hook was created.
  2604. If PROC already exists in HOOK, then remove it first.
  2605. *** New function: remove-hook! HOOK PROC
  2606. Remove PROC from the list of functions in HOOK.
  2607. *** New function: reset-hook! HOOK
  2608. Clear the list of hook functions stored in HOOK.
  2609. *** New function: run-hook HOOK ARG1 ...
  2610. Run all hook functions stored in HOOK with arguments ARG1 ... .
  2611. The number of arguments supplied must correspond to the number given
  2612. when the hook was created.
  2613. ** The function `dynamic-link' now takes optional keyword arguments.
  2614. The only keyword argument that is currently defined is `:global
  2615. BOOL'. With it, you can control whether the shared library will be
  2616. linked in global mode or not. In global mode, the symbols from the
  2617. linked library can be used to resolve references from other
  2618. dynamically linked libraries. In non-global mode, the linked
  2619. library is essentially invisible and can only be accessed via
  2620. `dynamic-func', etc. The default is now to link in global mode.
  2621. Previously, the default has been non-global mode.
  2622. The `#:global' keyword is only effective on platforms that support
  2623. the dlopen family of functions.
  2624. ** New function `provided?'
  2625. - Function: provided? FEATURE
  2626. Return true iff FEATURE is supported by this installation of
  2627. Guile. FEATURE must be a symbol naming a feature; the global
  2628. variable `*features*' is a list of available features.
  2629. ** Changes to the module (ice-9 expect):
  2630. *** The expect-strings macro now matches `$' in a regular expression
  2631. only at a line-break or end-of-file by default. Previously it would
  2632. match the end of the string accumulated so far. The old behaviour
  2633. can be obtained by setting the variable `expect-strings-exec-flags'
  2634. to 0.
  2635. *** The expect-strings macro now uses a variable `expect-strings-exec-flags'
  2636. for the regexp-exec flags. If `regexp/noteol' is included, then `$'
  2637. in a regular expression will still match before a line-break or
  2638. end-of-file. The default is `regexp/noteol'.
  2639. *** The expect-strings macro now uses a variable
  2640. `expect-strings-compile-flags' for the flags to be supplied to
  2641. `make-regexp'. The default is `regexp/newline', which was previously
  2642. hard-coded.
  2643. *** The expect macro now supplies two arguments to a match procedure:
  2644. the current accumulated string and a flag to indicate whether
  2645. end-of-file has been reached. Previously only the string was supplied.
  2646. If end-of-file is reached, the match procedure will be called an
  2647. additional time with the same accumulated string as the previous call
  2648. but with the flag set.
  2649. ** New module (ice-9 format), implementing the Common Lisp `format' function.
  2650. This code, and the documentation for it that appears here, was
  2651. borrowed from SLIB, with minor adaptations for Guile.
  2652. - Function: format DESTINATION FORMAT-STRING . ARGUMENTS
  2653. An almost complete implementation of Common LISP format description
  2654. according to the CL reference book `Common LISP' from Guy L.
  2655. Steele, Digital Press. Backward compatible to most of the
  2656. available Scheme format implementations.
  2657. Returns `#t', `#f' or a string; has side effect of printing
  2658. according to FORMAT-STRING. If DESTINATION is `#t', the output is
  2659. to the current output port and `#t' is returned. If DESTINATION
  2660. is `#f', a formatted string is returned as the result of the call.
  2661. NEW: If DESTINATION is a string, DESTINATION is regarded as the
  2662. format string; FORMAT-STRING is then the first argument and the
  2663. output is returned as a string. If DESTINATION is a number, the
  2664. output is to the current error port if available by the
  2665. implementation. Otherwise DESTINATION must be an output port and
  2666. `#t' is returned.
  2667. FORMAT-STRING must be a string. In case of a formatting error
  2668. format returns `#f' and prints a message on the current output or
  2669. error port. Characters are output as if the string were output by
  2670. the `display' function with the exception of those prefixed by a
  2671. tilde (~). For a detailed description of the FORMAT-STRING syntax
  2672. please consult a Common LISP format reference manual. For a test
  2673. suite to verify this format implementation load `formatst.scm'.
  2674. Please send bug reports to `lutzeb@cs.tu-berlin.de'.
  2675. Note: `format' is not reentrant, i.e. only one `format'-call may
  2676. be executed at a time.
  2677. *** Format Specification (Format version 3.0)
  2678. Please consult a Common LISP format reference manual for a detailed
  2679. description of the format string syntax. For a demonstration of the
  2680. implemented directives see `formatst.scm'.
  2681. This implementation supports directive parameters and modifiers (`:'
  2682. and `@' characters). Multiple parameters must be separated by a comma
  2683. (`,'). Parameters can be numerical parameters (positive or negative),
  2684. character parameters (prefixed by a quote character (`''), variable
  2685. parameters (`v'), number of rest arguments parameter (`#'), empty and
  2686. default parameters. Directive characters are case independent. The
  2687. general form of a directive is:
  2688. DIRECTIVE ::= ~{DIRECTIVE-PARAMETER,}[:][@]DIRECTIVE-CHARACTER
  2689. DIRECTIVE-PARAMETER ::= [ [-|+]{0-9}+ | 'CHARACTER | v | # ]
  2690. *** Implemented CL Format Control Directives
  2691. Documentation syntax: Uppercase characters represent the
  2692. corresponding control directive characters. Lowercase characters
  2693. represent control directive parameter descriptions.
  2694. `~A'
  2695. Any (print as `display' does).
  2696. `~@A'
  2697. left pad.
  2698. `~MINCOL,COLINC,MINPAD,PADCHARA'
  2699. full padding.
  2700. `~S'
  2701. S-expression (print as `write' does).
  2702. `~@S'
  2703. left pad.
  2704. `~MINCOL,COLINC,MINPAD,PADCHARS'
  2705. full padding.
  2706. `~D'
  2707. Decimal.
  2708. `~@D'
  2709. print number sign always.
  2710. `~:D'
  2711. print comma separated.
  2712. `~MINCOL,PADCHAR,COMMACHARD'
  2713. padding.
  2714. `~X'
  2715. Hexadecimal.
  2716. `~@X'
  2717. print number sign always.
  2718. `~:X'
  2719. print comma separated.
  2720. `~MINCOL,PADCHAR,COMMACHARX'
  2721. padding.
  2722. `~O'
  2723. Octal.
  2724. `~@O'
  2725. print number sign always.
  2726. `~:O'
  2727. print comma separated.
  2728. `~MINCOL,PADCHAR,COMMACHARO'
  2729. padding.
  2730. `~B'
  2731. Binary.
  2732. `~@B'
  2733. print number sign always.
  2734. `~:B'
  2735. print comma separated.
  2736. `~MINCOL,PADCHAR,COMMACHARB'
  2737. padding.
  2738. `~NR'
  2739. Radix N.
  2740. `~N,MINCOL,PADCHAR,COMMACHARR'
  2741. padding.
  2742. `~@R'
  2743. print a number as a Roman numeral.
  2744. `~:@R'
  2745. print a number as an "old fashioned" Roman numeral.
  2746. `~:R'
  2747. print a number as an ordinal English number.
  2748. `~:@R'
  2749. print a number as a cardinal English number.
  2750. `~P'
  2751. Plural.
  2752. `~@P'
  2753. prints `y' and `ies'.
  2754. `~:P'
  2755. as `~P but jumps 1 argument backward.'
  2756. `~:@P'
  2757. as `~@P but jumps 1 argument backward.'
  2758. `~C'
  2759. Character.
  2760. `~@C'
  2761. prints a character as the reader can understand it (i.e. `#\'
  2762. prefixing).
  2763. `~:C'
  2764. prints a character as emacs does (eg. `^C' for ASCII 03).
  2765. `~F'
  2766. Fixed-format floating-point (prints a flonum like MMM.NNN).
  2767. `~WIDTH,DIGITS,SCALE,OVERFLOWCHAR,PADCHARF'
  2768. `~@F'
  2769. If the number is positive a plus sign is printed.
  2770. `~E'
  2771. Exponential floating-point (prints a flonum like MMM.NNN`E'EE).
  2772. `~WIDTH,DIGITS,EXPONENTDIGITS,SCALE,OVERFLOWCHAR,PADCHAR,EXPONENTCHARE'
  2773. `~@E'
  2774. If the number is positive a plus sign is printed.
  2775. `~G'
  2776. General floating-point (prints a flonum either fixed or
  2777. exponential).
  2778. `~WIDTH,DIGITS,EXPONENTDIGITS,SCALE,OVERFLOWCHAR,PADCHAR,EXPONENTCHARG'
  2779. `~@G'
  2780. If the number is positive a plus sign is printed.
  2781. `~$'
  2782. Dollars floating-point (prints a flonum in fixed with signs
  2783. separated).
  2784. `~DIGITS,SCALE,WIDTH,PADCHAR$'
  2785. `~@$'
  2786. If the number is positive a plus sign is printed.
  2787. `~:@$'
  2788. A sign is always printed and appears before the padding.
  2789. `~:$'
  2790. The sign appears before the padding.
  2791. `~%'
  2792. Newline.
  2793. `~N%'
  2794. print N newlines.
  2795. `~&'
  2796. print newline if not at the beginning of the output line.
  2797. `~N&'
  2798. prints `~&' and then N-1 newlines.
  2799. `~|'
  2800. Page Separator.
  2801. `~N|'
  2802. print N page separators.
  2803. `~~'
  2804. Tilde.
  2805. `~N~'
  2806. print N tildes.
  2807. `~'<newline>
  2808. Continuation Line.
  2809. `~:'<newline>
  2810. newline is ignored, white space left.
  2811. `~@'<newline>
  2812. newline is left, white space ignored.
  2813. `~T'
  2814. Tabulation.
  2815. `~@T'
  2816. relative tabulation.
  2817. `~COLNUM,COLINCT'
  2818. full tabulation.
  2819. `~?'
  2820. Indirection (expects indirect arguments as a list).
  2821. `~@?'
  2822. extracts indirect arguments from format arguments.
  2823. `~(STR~)'
  2824. Case conversion (converts by `string-downcase').
  2825. `~:(STR~)'
  2826. converts by `string-capitalize'.
  2827. `~@(STR~)'
  2828. converts by `string-capitalize-first'.
  2829. `~:@(STR~)'
  2830. converts by `string-upcase'.
  2831. `~*'
  2832. Argument Jumping (jumps 1 argument forward).
  2833. `~N*'
  2834. jumps N arguments forward.
  2835. `~:*'
  2836. jumps 1 argument backward.
  2837. `~N:*'
  2838. jumps N arguments backward.
  2839. `~@*'
  2840. jumps to the 0th argument.
  2841. `~N@*'
  2842. jumps to the Nth argument (beginning from 0)
  2843. `~[STR0~;STR1~;...~;STRN~]'
  2844. Conditional Expression (numerical clause conditional).
  2845. `~N['
  2846. take argument from N.
  2847. `~@['
  2848. true test conditional.
  2849. `~:['
  2850. if-else-then conditional.
  2851. `~;'
  2852. clause separator.
  2853. `~:;'
  2854. default clause follows.
  2855. `~{STR~}'
  2856. Iteration (args come from the next argument (a list)).
  2857. `~N{'
  2858. at most N iterations.
  2859. `~:{'
  2860. args from next arg (a list of lists).
  2861. `~@{'
  2862. args from the rest of arguments.
  2863. `~:@{'
  2864. args from the rest args (lists).
  2865. `~^'
  2866. Up and out.
  2867. `~N^'
  2868. aborts if N = 0
  2869. `~N,M^'
  2870. aborts if N = M
  2871. `~N,M,K^'
  2872. aborts if N <= M <= K
  2873. *** Not Implemented CL Format Control Directives
  2874. `~:A'
  2875. print `#f' as an empty list (see below).
  2876. `~:S'
  2877. print `#f' as an empty list (see below).
  2878. `~<~>'
  2879. Justification.
  2880. `~:^'
  2881. (sorry I don't understand its semantics completely)
  2882. *** Extended, Replaced and Additional Control Directives
  2883. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHD'
  2884. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHX'
  2885. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHO'
  2886. `~MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHB'
  2887. `~N,MINCOL,PADCHAR,COMMACHAR,COMMAWIDTHR'
  2888. COMMAWIDTH is the number of characters between two comma
  2889. characters.
  2890. `~I'
  2891. print a R4RS complex number as `~F~@Fi' with passed parameters for
  2892. `~F'.
  2893. `~Y'
  2894. Pretty print formatting of an argument for scheme code lists.
  2895. `~K'
  2896. Same as `~?.'
  2897. `~!'
  2898. Flushes the output if format DESTINATION is a port.
  2899. `~_'
  2900. Print a `#\space' character
  2901. `~N_'
  2902. print N `#\space' characters.
  2903. `~/'
  2904. Print a `#\tab' character
  2905. `~N/'
  2906. print N `#\tab' characters.
  2907. `~NC'
  2908. Takes N as an integer representation for a character. No arguments
  2909. are consumed. N is converted to a character by `integer->char'. N
  2910. must be a positive decimal number.
  2911. `~:S'
  2912. Print out readproof. Prints out internal objects represented as
  2913. `#<...>' as strings `"#<...>"' so that the format output can always
  2914. be processed by `read'.
  2915. `~:A'
  2916. Print out readproof. Prints out internal objects represented as
  2917. `#<...>' as strings `"#<...>"' so that the format output can always
  2918. be processed by `read'.
  2919. `~Q'
  2920. Prints information and a copyright notice on the format
  2921. implementation.
  2922. `~:Q'
  2923. prints format version.
  2924. `~F, ~E, ~G, ~$'
  2925. may also print number strings, i.e. passing a number as a string
  2926. and format it accordingly.
  2927. *** Configuration Variables
  2928. The format module exports some configuration variables to suit the
  2929. systems and users needs. There should be no modification necessary for
  2930. the configuration that comes with Guile. Format detects automatically
  2931. if the running scheme system implements floating point numbers and
  2932. complex numbers.
  2933. format:symbol-case-conv
  2934. Symbols are converted by `symbol->string' so the case type of the
  2935. printed symbols is implementation dependent.
  2936. `format:symbol-case-conv' is a one arg closure which is either
  2937. `#f' (no conversion), `string-upcase', `string-downcase' or
  2938. `string-capitalize'. (default `#f')
  2939. format:iobj-case-conv
  2940. As FORMAT:SYMBOL-CASE-CONV but applies for the representation of
  2941. implementation internal objects. (default `#f')
  2942. format:expch
  2943. The character prefixing the exponent value in `~E' printing.
  2944. (default `#\E')
  2945. *** Compatibility With Other Format Implementations
  2946. SLIB format 2.x:
  2947. See `format.doc'.
  2948. SLIB format 1.4:
  2949. Downward compatible except for padding support and `~A', `~S',
  2950. `~P', `~X' uppercase printing. SLIB format 1.4 uses C-style
  2951. `printf' padding support which is completely replaced by the CL
  2952. `format' padding style.
  2953. MIT C-Scheme 7.1:
  2954. Downward compatible except for `~', which is not documented
  2955. (ignores all characters inside the format string up to a newline
  2956. character). (7.1 implements `~a', `~s', ~NEWLINE, `~~', `~%',
  2957. numerical and variable parameters and `:/@' modifiers in the CL
  2958. sense).
  2959. Elk 1.5/2.0:
  2960. Downward compatible except for `~A' and `~S' which print in
  2961. uppercase. (Elk implements `~a', `~s', `~~', and `~%' (no
  2962. directive parameters or modifiers)).
  2963. Scheme->C 01nov91:
  2964. Downward compatible except for an optional destination parameter:
  2965. S2C accepts a format call without a destination which returns a
  2966. formatted string. This is equivalent to a #f destination in S2C.
  2967. (S2C implements `~a', `~s', `~c', `~%', and `~~' (no directive
  2968. parameters or modifiers)).
  2969. ** Changes to string-handling functions.
  2970. These functions were added to support the (ice-9 format) module, above.
  2971. *** New function: string-upcase STRING
  2972. *** New function: string-downcase STRING
  2973. These are non-destructive versions of the existing string-upcase! and
  2974. string-downcase! functions.
  2975. *** New function: string-capitalize! STRING
  2976. *** New function: string-capitalize STRING
  2977. These functions convert the first letter of each word in the string to
  2978. upper case. Thus:
  2979. (string-capitalize "howdy there")
  2980. => "Howdy There"
  2981. As with the other functions, string-capitalize! modifies the string in
  2982. place, while string-capitalize returns a modified copy of its argument.
  2983. *** New function: string-ci->symbol STRING
  2984. Return a symbol whose name is STRING, but having the same case as if
  2985. the symbol had be read by `read'.
  2986. Guile can be configured to be sensitive or insensitive to case
  2987. differences in Scheme identifiers. If Guile is case-insensitive, all
  2988. symbols are converted to lower case on input. The `string-ci->symbol'
  2989. function returns a symbol whose name in STRING, transformed as Guile
  2990. would if STRING were input.
  2991. *** New function: substring-move! STRING1 START END STRING2 START
  2992. Copy the substring of STRING1 from START (inclusive) to END
  2993. (exclusive) to STRING2 at START. STRING1 and STRING2 may be the same
  2994. string, and the source and destination areas may overlap; in all
  2995. cases, the function behaves as if all the characters were copied
  2996. simultanously.
  2997. *** Extended functions: substring-move-left! substring-move-right!
  2998. These functions now correctly copy arbitrarily overlapping substrings;
  2999. they are both synonyms for substring-move!.
  3000. ** New module (ice-9 getopt-long), with the function `getopt-long'.
  3001. getopt-long is a function for parsing command-line arguments in a
  3002. manner consistent with other GNU programs.
  3003. (getopt-long ARGS GRAMMAR)
  3004. Parse the arguments ARGS according to the argument list grammar GRAMMAR.
  3005. ARGS should be a list of strings. Its first element should be the
  3006. name of the program; subsequent elements should be the arguments
  3007. that were passed to the program on the command line. The
  3008. `program-arguments' procedure returns a list of this form.
  3009. GRAMMAR is a list of the form:
  3010. ((OPTION (PROPERTY VALUE) ...) ...)
  3011. Each OPTION should be a symbol. `getopt-long' will accept a
  3012. command-line option named `--OPTION'.
  3013. Each option can have the following (PROPERTY VALUE) pairs:
  3014. (single-char CHAR) --- Accept `-CHAR' as a single-character
  3015. equivalent to `--OPTION'. This is how to specify traditional
  3016. Unix-style flags.
  3017. (required? BOOL) --- If BOOL is true, the option is required.
  3018. getopt-long will raise an error if it is not found in ARGS.
  3019. (value BOOL) --- If BOOL is #t, the option accepts a value; if
  3020. it is #f, it does not; and if it is the symbol
  3021. `optional', the option may appear in ARGS with or
  3022. without a value.
  3023. (predicate FUNC) --- If the option accepts a value (i.e. you
  3024. specified `(value #t)' for this option), then getopt
  3025. will apply FUNC to the value, and throw an exception
  3026. if it returns #f. FUNC should be a procedure which
  3027. accepts a string and returns a boolean value; you may
  3028. need to use quasiquotes to get it into GRAMMAR.
  3029. The (PROPERTY VALUE) pairs may occur in any order, but each
  3030. property may occur only once. By default, options do not have
  3031. single-character equivalents, are not required, and do not take
  3032. values.
  3033. In ARGS, single-character options may be combined, in the usual
  3034. Unix fashion: ("-x" "-y") is equivalent to ("-xy"). If an option
  3035. accepts values, then it must be the last option in the
  3036. combination; the value is the next argument. So, for example, using
  3037. the following grammar:
  3038. ((apples (single-char #\a))
  3039. (blimps (single-char #\b) (value #t))
  3040. (catalexis (single-char #\c) (value #t)))
  3041. the following argument lists would be acceptable:
  3042. ("-a" "-b" "bang" "-c" "couth") ("bang" and "couth" are the values
  3043. for "blimps" and "catalexis")
  3044. ("-ab" "bang" "-c" "couth") (same)
  3045. ("-ac" "couth" "-b" "bang") (same)
  3046. ("-abc" "couth" "bang") (an error, since `-b' is not the
  3047. last option in its combination)
  3048. If an option's value is optional, then `getopt-long' decides
  3049. whether it has a value by looking at what follows it in ARGS. If
  3050. the next element is a string, and it does not appear to be an
  3051. option itself, then that string is the option's value.
  3052. The value of a long option can appear as the next element in ARGS,
  3053. or it can follow the option name, separated by an `=' character.
  3054. Thus, using the same grammar as above, the following argument lists
  3055. are equivalent:
  3056. ("--apples" "Braeburn" "--blimps" "Goodyear")
  3057. ("--apples=Braeburn" "--blimps" "Goodyear")
  3058. ("--blimps" "Goodyear" "--apples=Braeburn")
  3059. If the option "--" appears in ARGS, argument parsing stops there;
  3060. subsequent arguments are returned as ordinary arguments, even if
  3061. they resemble options. So, in the argument list:
  3062. ("--apples" "Granny Smith" "--" "--blimp" "Goodyear")
  3063. `getopt-long' will recognize the `apples' option as having the
  3064. value "Granny Smith", but it will not recognize the `blimp'
  3065. option; it will return the strings "--blimp" and "Goodyear" as
  3066. ordinary argument strings.
  3067. The `getopt-long' function returns the parsed argument list as an
  3068. assocation list, mapping option names --- the symbols from GRAMMAR
  3069. --- onto their values, or #t if the option does not accept a value.
  3070. Unused options do not appear in the alist.
  3071. All arguments that are not the value of any option are returned
  3072. as a list, associated with the empty list.
  3073. `getopt-long' throws an exception if:
  3074. - it finds an unrecognized option in ARGS
  3075. - a required option is omitted
  3076. - an option that requires an argument doesn't get one
  3077. - an option that doesn't accept an argument does get one (this can
  3078. only happen using the long option `--opt=value' syntax)
  3079. - an option predicate fails
  3080. So, for example:
  3081. (define grammar
  3082. `((lockfile-dir (required? #t)
  3083. (value #t)
  3084. (single-char #\k)
  3085. (predicate ,file-is-directory?))
  3086. (verbose (required? #f)
  3087. (single-char #\v)
  3088. (value #f))
  3089. (x-includes (single-char #\x))
  3090. (rnet-server (single-char #\y)
  3091. (predicate ,string?))))
  3092. (getopt-long '("my-prog" "-vk" "/tmp" "foo1" "--x-includes=/usr/include"
  3093. "--rnet-server=lamprod" "--" "-fred" "foo2" "foo3")
  3094. grammar)
  3095. => ((() "foo1" "-fred" "foo2" "foo3")
  3096. (rnet-server . "lamprod")
  3097. (x-includes . "/usr/include")
  3098. (lockfile-dir . "/tmp")
  3099. (verbose . #t))
  3100. ** The (ice-9 getopt-gnu-style) module is obsolete; use (ice-9 getopt-long).
  3101. It will be removed in a few releases.
  3102. ** New syntax: lambda*
  3103. ** New syntax: define*
  3104. ** New syntax: define*-public
  3105. ** New syntax: defmacro*
  3106. ** New syntax: defmacro*-public
  3107. Guile now supports optional arguments.
  3108. `lambda*', `define*', `define*-public', `defmacro*' and
  3109. `defmacro*-public' are identical to the non-* versions except that
  3110. they use an extended type of parameter list that has the following BNF
  3111. syntax (parentheses are literal, square brackets indicate grouping,
  3112. and `*', `+' and `?' have the usual meaning):
  3113. ext-param-list ::= ( [identifier]* [#&optional [ext-var-decl]+]?
  3114. [#&key [ext-var-decl]+ [#&allow-other-keys]?]?
  3115. [[#&rest identifier]|[. identifier]]? ) | [identifier]
  3116. ext-var-decl ::= identifier | ( identifier expression )
  3117. The semantics are best illustrated with the following documentation
  3118. and examples for `lambda*':
  3119. lambda* args . body
  3120. lambda extended for optional and keyword arguments
  3121. lambda* creates a procedure that takes optional arguments. These
  3122. are specified by putting them inside brackets at the end of the
  3123. paramater list, but before any dotted rest argument. For example,
  3124. (lambda* (a b #&optional c d . e) '())
  3125. creates a procedure with fixed arguments a and b, optional arguments c
  3126. and d, and rest argument e. If the optional arguments are omitted
  3127. in a call, the variables for them are unbound in the procedure. This
  3128. can be checked with the bound? macro.
  3129. lambda* can also take keyword arguments. For example, a procedure
  3130. defined like this:
  3131. (lambda* (#&key xyzzy larch) '())
  3132. can be called with any of the argument lists (#:xyzzy 11)
  3133. (#:larch 13) (#:larch 42 #:xyzzy 19) (). Whichever arguments
  3134. are given as keywords are bound to values.
  3135. Optional and keyword arguments can also be given default values
  3136. which they take on when they are not present in a call, by giving a
  3137. two-item list in place of an optional argument, for example in:
  3138. (lambda* (foo #&optional (bar 42) #&key (baz 73)) (list foo bar baz))
  3139. foo is a fixed argument, bar is an optional argument with default
  3140. value 42, and baz is a keyword argument with default value 73.
  3141. Default value expressions are not evaluated unless they are needed
  3142. and until the procedure is called.
  3143. lambda* now supports two more special parameter list keywords.
  3144. lambda*-defined procedures now throw an error by default if a
  3145. keyword other than one of those specified is found in the actual
  3146. passed arguments. However, specifying #&allow-other-keys
  3147. immediately after the kyword argument declarations restores the
  3148. previous behavior of ignoring unknown keywords. lambda* also now
  3149. guarantees that if the same keyword is passed more than once, the
  3150. last one passed is the one that takes effect. For example,
  3151. ((lambda* (#&key (heads 0) (tails 0)) (display (list heads tails)))
  3152. #:heads 37 #:tails 42 #:heads 99)
  3153. would result in (99 47) being displayed.
  3154. #&rest is also now provided as a synonym for the dotted syntax rest
  3155. argument. The argument lists (a . b) and (a #&rest b) are equivalent in
  3156. all respects to lambda*. This is provided for more similarity to DSSSL,
  3157. MIT-Scheme and Kawa among others, as well as for refugees from other
  3158. Lisp dialects.
  3159. Further documentation may be found in the optargs.scm file itself.
  3160. The optional argument module also exports the macros `let-optional',
  3161. `let-optional*', `let-keywords', `let-keywords*' and `bound?'. These
  3162. are not documented here because they may be removed in the future, but
  3163. full documentation is still available in optargs.scm.
  3164. ** New syntax: and-let*
  3165. Guile now supports the `and-let*' form, described in the draft SRFI-2.
  3166. Syntax: (land* (<clause> ...) <body> ...)
  3167. Each <clause> should have one of the following forms:
  3168. (<variable> <expression>)
  3169. (<expression>)
  3170. <bound-variable>
  3171. Each <variable> or <bound-variable> should be an identifier. Each
  3172. <expression> should be a valid expression. The <body> should be a
  3173. possibly empty sequence of expressions, like the <body> of a
  3174. lambda form.
  3175. Semantics: A LAND* expression is evaluated by evaluating the
  3176. <expression> or <bound-variable> of each of the <clause>s from
  3177. left to right. The value of the first <expression> or
  3178. <bound-variable> that evaluates to a false value is returned; the
  3179. remaining <expression>s and <bound-variable>s are not evaluated.
  3180. The <body> forms are evaluated iff all the <expression>s and
  3181. <bound-variable>s evaluate to true values.
  3182. The <expression>s and the <body> are evaluated in an environment
  3183. binding each <variable> of the preceding (<variable> <expression>)
  3184. clauses to the value of the <expression>. Later bindings
  3185. shadow earlier bindings.
  3186. Guile's and-let* macro was contributed by Michael Livshin.
  3187. ** New sorting functions
  3188. *** New function: sorted? SEQUENCE LESS?
  3189. Returns `#t' when the sequence argument is in non-decreasing order
  3190. according to LESS? (that is, there is no adjacent pair `... x y
  3191. ...' for which `(less? y x)').
  3192. Returns `#f' when the sequence contains at least one out-of-order
  3193. pair. It is an error if the sequence is neither a list nor a
  3194. vector.
  3195. *** New function: merge LIST1 LIST2 LESS?
  3196. LIST1 and LIST2 are sorted lists.
  3197. Returns the sorted list of all elements in LIST1 and LIST2.
  3198. Assume that the elements a and b1 in LIST1 and b2 in LIST2 are "equal"
  3199. in the sense that (LESS? x y) --> #f for x, y in {a, b1, b2},
  3200. and that a < b1 in LIST1. Then a < b1 < b2 in the result.
  3201. (Here "<" should read "comes before".)
  3202. *** New procedure: merge! LIST1 LIST2 LESS?
  3203. Merges two lists, re-using the pairs of LIST1 and LIST2 to build
  3204. the result. If the code is compiled, and LESS? constructs no new
  3205. pairs, no pairs at all will be allocated. The first pair of the
  3206. result will be either the first pair of LIST1 or the first pair of
  3207. LIST2.
  3208. *** New function: sort SEQUENCE LESS?
  3209. Accepts either a list or a vector, and returns a new sequence
  3210. which is sorted. The new sequence is the same type as the input.
  3211. Always `(sorted? (sort sequence less?) less?)'. The original
  3212. sequence is not altered in any way. The new sequence shares its
  3213. elements with the old one; no elements are copied.
  3214. *** New procedure: sort! SEQUENCE LESS
  3215. Returns its sorted result in the original boxes. No new storage is
  3216. allocated at all. Proper usage: (set! slist (sort! slist <))
  3217. *** New function: stable-sort SEQUENCE LESS?
  3218. Similar to `sort' but stable. That is, if "equal" elements are
  3219. ordered a < b in the original sequence, they will have the same order
  3220. in the result.
  3221. *** New function: stable-sort! SEQUENCE LESS?
  3222. Similar to `sort!' but stable.
  3223. Uses temporary storage when sorting vectors.
  3224. *** New functions: sort-list, sort-list!
  3225. Added for compatibility with scsh.
  3226. ** New built-in random number support
  3227. *** New function: random N [STATE]
  3228. Accepts a positive integer or real N and returns a number of the
  3229. same type between zero (inclusive) and N (exclusive). The values
  3230. returned have a uniform distribution.
  3231. The optional argument STATE must be of the type produced by
  3232. `copy-random-state' or `seed->random-state'. It defaults to the value
  3233. of the variable `*random-state*'. This object is used to maintain the
  3234. state of the pseudo-random-number generator and is altered as a side
  3235. effect of the `random' operation.
  3236. *** New variable: *random-state*
  3237. Holds a data structure that encodes the internal state of the
  3238. random-number generator that `random' uses by default. The nature
  3239. of this data structure is implementation-dependent. It may be
  3240. printed out and successfully read back in, but may or may not
  3241. function correctly as a random-number state object in another
  3242. implementation.
  3243. *** New function: copy-random-state [STATE]
  3244. Returns a new object of type suitable for use as the value of the
  3245. variable `*random-state*' and as a second argument to `random'.
  3246. If argument STATE is given, a copy of it is returned. Otherwise a
  3247. copy of `*random-state*' is returned.
  3248. *** New function: seed->random-state SEED
  3249. Returns a new object of type suitable for use as the value of the
  3250. variable `*random-state*' and as a second argument to `random'.
  3251. SEED is a string or a number. A new state is generated and
  3252. initialized using SEED.
  3253. *** New function: random:uniform [STATE]
  3254. Returns an uniformly distributed inexact real random number in the
  3255. range between 0 and 1.
  3256. *** New procedure: random:solid-sphere! VECT [STATE]
  3257. Fills VECT with inexact real random numbers the sum of whose
  3258. squares is less than 1.0. Thinking of VECT as coordinates in
  3259. space of dimension N = `(vector-length VECT)', the coordinates are
  3260. uniformly distributed within the unit N-shere. The sum of the
  3261. squares of the numbers is returned. VECT can be either a vector
  3262. or a uniform vector of doubles.
  3263. *** New procedure: random:hollow-sphere! VECT [STATE]
  3264. Fills VECT with inexact real random numbers the sum of whose squares
  3265. is equal to 1.0. Thinking of VECT as coordinates in space of
  3266. dimension n = `(vector-length VECT)', the coordinates are uniformly
  3267. distributed over the surface of the unit n-shere. VECT can be either
  3268. a vector or a uniform vector of doubles.
  3269. *** New function: random:normal [STATE]
  3270. Returns an inexact real in a normal distribution with mean 0 and
  3271. standard deviation 1. For a normal distribution with mean M and
  3272. standard deviation D use `(+ M (* D (random:normal)))'.
  3273. *** New procedure: random:normal-vector! VECT [STATE]
  3274. Fills VECT with inexact real random numbers which are independent and
  3275. standard normally distributed (i.e., with mean 0 and variance 1).
  3276. VECT can be either a vector or a uniform vector of doubles.
  3277. *** New function: random:exp STATE
  3278. Returns an inexact real in an exponential distribution with mean 1.
  3279. For an exponential distribution with mean U use (* U (random:exp)).
  3280. ** The range of logand, logior, logxor, logtest, and logbit? have changed.
  3281. These functions now operate on numbers in the range of a C unsigned
  3282. long.
  3283. These functions used to operate on numbers in the range of a C signed
  3284. long; however, this seems inappropriate, because Guile integers don't
  3285. overflow.
  3286. ** New function: make-guardian
  3287. This is an implementation of guardians as described in
  3288. R. Kent Dybvig, Carl Bruggeman, and David Eby (1993) "Guardians in a
  3289. Generation-Based Garbage Collector" ACM SIGPLAN Conference on
  3290. Programming Language Design and Implementation, June 1993
  3291. ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc/pubs/guardians.ps.gz
  3292. ** New functions: delq1!, delv1!, delete1!
  3293. These procedures behave similar to delq! and friends but delete only
  3294. one object if at all.
  3295. ** New function: unread-string STRING PORT
  3296. Unread STRING to PORT, that is, push it back onto the port so that
  3297. next read operation will work on the pushed back characters.
  3298. ** unread-char can now be called multiple times
  3299. If unread-char is called multiple times, the unread characters will be
  3300. read again in last-in first-out order.
  3301. ** the procedures uniform-array-read! and uniform-array-write! now
  3302. work on any kind of port, not just ports which are open on a file.
  3303. ** Now 'l' in a port mode requests line buffering.
  3304. ** The procedure truncate-file now works on string ports as well
  3305. as file ports. If the size argument is omitted, the current
  3306. file position is used.
  3307. ** new procedure: seek PORT/FDES OFFSET WHENCE
  3308. The arguments are the same as for the old fseek procedure, but it
  3309. works on string ports as well as random-access file ports.
  3310. ** the fseek procedure now works on string ports, since it has been
  3311. redefined using seek.
  3312. ** the setvbuf procedure now uses a default size if mode is _IOFBF and
  3313. size is not supplied.
  3314. ** the newline procedure no longer flushes the port if it's not
  3315. line-buffered: previously it did if it was the current output port.
  3316. ** open-pipe and close-pipe are no longer primitive procedures, but
  3317. an emulation can be obtained using `(use-modules (ice-9 popen))'.
  3318. ** the freopen procedure has been removed.
  3319. ** new procedure: drain-input PORT
  3320. Drains PORT's read buffers (including any pushed-back characters)
  3321. and returns the contents as a single string.
  3322. ** New function: map-in-order PROC LIST1 LIST2 ...
  3323. Version of `map' which guarantees that the procedure is applied to the
  3324. lists in serial order.
  3325. ** Renamed `serial-array-copy!' and `serial-array-map!' to
  3326. `array-copy-in-order!' and `array-map-in-order!'. The old names are
  3327. now obsolete and will go away in release 1.5.
  3328. ** New syntax: collect BODY1 ...
  3329. Version of `begin' which returns a list of the results of the body
  3330. forms instead of the result of the last body form. In contrast to
  3331. `begin', `collect' allows an empty body.
  3332. ** New functions: read-history FILENAME, write-history FILENAME
  3333. Read/write command line history from/to file. Returns #t on success
  3334. and #f if an error occured.
  3335. ** `ls' and `lls' in module (ice-9 ls) now handle no arguments.
  3336. These procedures return a list of definitions available in the specified
  3337. argument, a relative module reference. In the case of no argument,
  3338. `(current-module)' is now consulted for definitions to return, instead
  3339. of simply returning #f, the former behavior.
  3340. ** The #/ syntax for lists is no longer supported.
  3341. Earlier versions of Scheme accepted this syntax, but printed a
  3342. warning.
  3343. ** Guile no longer consults the SCHEME_LOAD_PATH environment variable.
  3344. Instead, you should set GUILE_LOAD_PATH to tell Guile where to find
  3345. modules.
  3346. * Changes to the gh_ interface
  3347. ** gh_scm2doubles
  3348. Now takes a second argument which is the result array. If this
  3349. pointer is NULL, a new array is malloced (the old behaviour).
  3350. ** gh_chars2byvect, gh_shorts2svect, gh_floats2fvect, gh_scm2chars,
  3351. gh_scm2shorts, gh_scm2longs, gh_scm2floats
  3352. New functions.
  3353. * Changes to the scm_ interface
  3354. ** Function: scm_make_named_hook (char* name, int n_args)
  3355. Creates a hook in the same way as make-hook above but also
  3356. binds a variable named NAME to it.
  3357. This is the typical way of creating a hook from C code.
  3358. Currently, the variable is created in the "current" module. This
  3359. might change when we get the new module system.
  3360. ** The smob interface
  3361. The interface for creating smobs has changed. For documentation, see
  3362. data-rep.info (made from guile-core/doc/data-rep.texi).
  3363. *** Deprecated function: SCM scm_newsmob (scm_smobfuns *)
  3364. >>> This function will be removed in 1.3.4. <<<
  3365. It is replaced by:
  3366. *** Function: SCM scm_make_smob_type (const char *name, scm_sizet size)
  3367. This function adds a new smob type, named NAME, with instance size
  3368. SIZE to the system. The return value is a tag that is used in
  3369. creating instances of the type. If SIZE is 0, then no memory will
  3370. be allocated when instances of the smob are created, and nothing
  3371. will be freed by the default free function.
  3372. *** Function: void scm_set_smob_mark (long tc, SCM (*mark) (SCM))
  3373. This function sets the smob marking procedure for the smob type
  3374. specified by the tag TC. TC is the tag returned by
  3375. `scm_make_smob_type'.
  3376. *** Function: void scm_set_smob_free (long tc, SCM (*mark) (SCM))
  3377. This function sets the smob freeing procedure for the smob type
  3378. specified by the tag TC. TC is the tag returned by
  3379. `scm_make_smob_type'.
  3380. *** Function: void scm_set_smob_print (tc, print)
  3381. - Function: void scm_set_smob_print (long tc,
  3382. scm_sizet (*print) (SCM,
  3383. SCM,
  3384. scm_print_state *))
  3385. This function sets the smob printing procedure for the smob type
  3386. specified by the tag TC. TC is the tag returned by
  3387. `scm_make_smob_type'.
  3388. *** Function: void scm_set_smob_equalp (long tc, SCM (*equalp) (SCM, SCM))
  3389. This function sets the smob equality-testing predicate for the
  3390. smob type specified by the tag TC. TC is the tag returned by
  3391. `scm_make_smob_type'.
  3392. *** Macro: void SCM_NEWSMOB (SCM var, long tc, void *data)
  3393. Make VALUE contain a smob instance of the type with type code TC and
  3394. smob data DATA. VALUE must be previously declared as C type `SCM'.
  3395. *** Macro: fn_returns SCM_RETURN_NEWSMOB (long tc, void *data)
  3396. This macro expands to a block of code that creates a smob instance
  3397. of the type with type code TC and smob data DATA, and returns that
  3398. `SCM' value. It should be the last piece of code in a block.
  3399. ** The interfaces for using I/O ports and implementing port types
  3400. (ptobs) have changed significantly. The new interface is based on
  3401. shared access to buffers and a new set of ptob procedures.
  3402. *** scm_newptob has been removed
  3403. It is replaced by:
  3404. *** Function: SCM scm_make_port_type (type_name, fill_buffer, write_flush)
  3405. - Function: SCM scm_make_port_type (char *type_name,
  3406. int (*fill_buffer) (SCM port),
  3407. void (*write_flush) (SCM port));
  3408. Similarly to the new smob interface, there is a set of function
  3409. setters by which the user can customize the behaviour of his port
  3410. type. See ports.h (scm_set_port_XXX).
  3411. ** scm_strport_to_string: New function: creates a new string from
  3412. a string port's buffer.
  3413. ** Plug in interface for random number generators
  3414. The variable `scm_the_rng' in random.c contains a value and three
  3415. function pointers which together define the current random number
  3416. generator being used by the Scheme level interface and the random
  3417. number library functions.
  3418. The user is free to replace the default generator with the generator
  3419. of his own choice.
  3420. *** Variable: size_t scm_the_rng.rstate_size
  3421. The size of the random state type used by the current RNG
  3422. measured in chars.
  3423. *** Function: unsigned long scm_the_rng.random_bits (scm_rstate *STATE)
  3424. Given the random STATE, return 32 random bits.
  3425. *** Function: void scm_the_rng.init_rstate (scm_rstate *STATE, chars *S, int N)
  3426. Seed random state STATE using string S of length N.
  3427. *** Function: scm_rstate *scm_the_rng.copy_rstate (scm_rstate *STATE)
  3428. Given random state STATE, return a malloced copy.
  3429. ** Default RNG
  3430. The default RNG is the MWC (Multiply With Carry) random number
  3431. generator described by George Marsaglia at the Department of
  3432. Statistics and Supercomputer Computations Research Institute, The
  3433. Florida State University (http://stat.fsu.edu/~geo).
  3434. It uses 64 bits, has a period of 4578426017172946943 (4.6e18), and
  3435. passes all tests in the DIEHARD test suite
  3436. (http://stat.fsu.edu/~geo/diehard.html). The generation of 32 bits
  3437. costs one multiply and one add on platforms which either supports long
  3438. longs (gcc does this on most systems) or have 64 bit longs. The cost
  3439. is four multiply on other systems but this can be optimized by writing
  3440. scm_i_uniform32 in assembler.
  3441. These functions are provided through the scm_the_rng interface for use
  3442. by libguile and the application.
  3443. *** Function: unsigned long scm_i_uniform32 (scm_i_rstate *STATE)
  3444. Given the random STATE, return 32 random bits.
  3445. Don't use this function directly. Instead go through the plugin
  3446. interface (see "Plug in interface" above).
  3447. *** Function: void scm_i_init_rstate (scm_i_rstate *STATE, char *SEED, int N)
  3448. Initialize STATE using SEED of length N.
  3449. *** Function: scm_i_rstate *scm_i_copy_rstate (scm_i_rstate *STATE)
  3450. Return a malloc:ed copy of STATE. This function can easily be re-used
  3451. in the interfaces to other RNGs.
  3452. ** Random number library functions
  3453. These functions use the current RNG through the scm_the_rng interface.
  3454. It might be a good idea to use these functions from your C code so
  3455. that only one random generator is used by all code in your program.
  3456. The default random state is stored in:
  3457. *** Variable: SCM scm_var_random_state
  3458. Contains the vcell of the Scheme variable "*random-state*" which is
  3459. used as default state by all random number functions in the Scheme
  3460. level interface.
  3461. Example:
  3462. double x = scm_c_uniform01 (SCM_RSTATE (SCM_CDR (scm_var_random_state)));
  3463. *** Function: scm_rstate *scm_c_default_rstate (void)
  3464. This is a convenience function which returns the value of
  3465. scm_var_random_state. An error message is generated if this value
  3466. isn't a random state.
  3467. *** Function: scm_rstate *scm_c_make_rstate (char *SEED, int LENGTH)
  3468. Make a new random state from the string SEED of length LENGTH.
  3469. It is generally not a good idea to use multiple random states in a
  3470. program. While subsequent random numbers generated from one random
  3471. state are guaranteed to be reasonably independent, there is no such
  3472. guarantee for numbers generated from different random states.
  3473. *** Macro: unsigned long scm_c_uniform32 (scm_rstate *STATE)
  3474. Return 32 random bits.
  3475. *** Function: double scm_c_uniform01 (scm_rstate *STATE)
  3476. Return a sample from the uniform(0,1) distribution.
  3477. *** Function: double scm_c_normal01 (scm_rstate *STATE)
  3478. Return a sample from the normal(0,1) distribution.
  3479. *** Function: double scm_c_exp1 (scm_rstate *STATE)
  3480. Return a sample from the exp(1) distribution.
  3481. *** Function: unsigned long scm_c_random (scm_rstate *STATE, unsigned long M)
  3482. Return a sample from the discrete uniform(0,M) distribution.
  3483. *** Function: SCM scm_c_random_bignum (scm_rstate *STATE, SCM M)
  3484. Return a sample from the discrete uniform(0,M) distribution.
  3485. M must be a bignum object. The returned value may be an INUM.
  3486. Changes in Guile 1.3 (released Monday, October 19, 1998):
  3487. * Changes to the distribution
  3488. ** We renamed the SCHEME_LOAD_PATH environment variable to GUILE_LOAD_PATH.
  3489. To avoid conflicts, programs should name environment variables after
  3490. themselves, except when there's a common practice establishing some
  3491. other convention.
  3492. For now, Guile supports both GUILE_LOAD_PATH and SCHEME_LOAD_PATH,
  3493. giving the former precedence, and printing a warning message if the
  3494. latter is set. Guile 1.4 will not recognize SCHEME_LOAD_PATH at all.
  3495. ** The header files related to multi-byte characters have been removed.
  3496. They were: libguile/extchrs.h and libguile/mbstrings.h. Any C code
  3497. which referred to these explicitly will probably need to be rewritten,
  3498. since the support for the variant string types has been removed; see
  3499. below.
  3500. ** The header files append.h and sequences.h have been removed. These
  3501. files implemented non-R4RS operations which would encourage
  3502. non-portable programming style and less easy-to-read code.
  3503. * Changes to the stand-alone interpreter
  3504. ** New procedures have been added to implement a "batch mode":
  3505. *** Function: batch-mode?
  3506. Returns a boolean indicating whether the interpreter is in batch
  3507. mode.
  3508. *** Function: set-batch-mode?! ARG
  3509. If ARG is true, switches the interpreter to batch mode. The `#f'
  3510. case has not been implemented.
  3511. ** Guile now provides full command-line editing, when run interactively.
  3512. To use this feature, you must have the readline library installed.
  3513. The Guile build process will notice it, and automatically include
  3514. support for it.
  3515. The readline library is available via anonymous FTP from any GNU
  3516. mirror site; the canonical location is "ftp://prep.ai.mit.edu/pub/gnu".
  3517. ** the-last-stack is now a fluid.
  3518. * Changes to the procedure for linking libguile with your programs
  3519. ** You can now use the `guile-config' utility to build programs that use Guile.
  3520. Guile now includes a command-line utility called `guile-config', which
  3521. can provide information about how to compile and link programs that
  3522. use Guile.
  3523. *** `guile-config compile' prints any C compiler flags needed to use Guile.
  3524. You should include this command's output on the command line you use
  3525. to compile C or C++ code that #includes the Guile header files. It's
  3526. usually just a `-I' flag to help the compiler find the Guile headers.
  3527. *** `guile-config link' prints any linker flags necessary to link with Guile.
  3528. This command writes to its standard output a list of flags which you
  3529. must pass to the linker to link your code against the Guile library.
  3530. The flags include '-lguile' itself, any other libraries the Guile
  3531. library depends upon, and any `-L' flags needed to help the linker
  3532. find those libraries.
  3533. For example, here is a Makefile rule that builds a program named 'foo'
  3534. from the object files ${FOO_OBJECTS}, and links them against Guile:
  3535. foo: ${FOO_OBJECTS}
  3536. ${CC} ${CFLAGS} ${FOO_OBJECTS} `guile-config link` -o foo
  3537. Previous Guile releases recommended that you use autoconf to detect
  3538. which of a predefined set of libraries were present on your system.
  3539. It is more robust to use `guile-config', since it records exactly which
  3540. libraries the installed Guile library requires.
  3541. This was originally called `build-guile', but was renamed to
  3542. `guile-config' before Guile 1.3 was released, to be consistent with
  3543. the analogous script for the GTK+ GUI toolkit, which is called
  3544. `gtk-config'.
  3545. ** Use the GUILE_FLAGS macro in your configure.in file to find Guile.
  3546. If you are using the GNU autoconf package to configure your program,
  3547. you can use the GUILE_FLAGS autoconf macro to call `guile-config'
  3548. (described above) and gather the necessary values for use in your
  3549. Makefiles.
  3550. The GUILE_FLAGS macro expands to configure script code which runs the
  3551. `guile-config' script, to find out where Guile's header files and
  3552. libraries are installed. It sets two variables, marked for
  3553. substitution, as by AC_SUBST.
  3554. GUILE_CFLAGS --- flags to pass to a C or C++ compiler to build
  3555. code that uses Guile header files. This is almost always just a
  3556. -I flag.
  3557. GUILE_LDFLAGS --- flags to pass to the linker to link a
  3558. program against Guile. This includes `-lguile' for the Guile
  3559. library itself, any libraries that Guile itself requires (like
  3560. -lqthreads), and so on. It may also include a -L flag to tell the
  3561. compiler where to find the libraries.
  3562. GUILE_FLAGS is defined in the file guile.m4, in the top-level
  3563. directory of the Guile distribution. You can copy it into your
  3564. package's aclocal.m4 file, and then use it in your configure.in file.
  3565. If you are using the `aclocal' program, distributed with GNU automake,
  3566. to maintain your aclocal.m4 file, the Guile installation process
  3567. installs guile.m4 where aclocal will find it. All you need to do is
  3568. use GUILE_FLAGS in your configure.in file, and then run `aclocal';
  3569. this will copy the definition of GUILE_FLAGS into your aclocal.m4
  3570. file.
  3571. * Changes to Scheme functions and syntax
  3572. ** Multi-byte strings have been removed, as have multi-byte and wide
  3573. ports. We felt that these were the wrong approach to
  3574. internationalization support.
  3575. ** New function: readline [PROMPT]
  3576. Read a line from the terminal, and allow the user to edit it,
  3577. prompting with PROMPT. READLINE provides a large set of Emacs-like
  3578. editing commands, lets the user recall previously typed lines, and
  3579. works on almost every kind of terminal, including dumb terminals.
  3580. READLINE assumes that the cursor is at the beginning of the line when
  3581. it is invoked. Thus, you can't print a prompt yourself, and then call
  3582. READLINE; you need to package up your prompt as a string, pass it to
  3583. the function, and let READLINE print the prompt itself. This is
  3584. because READLINE needs to know the prompt's screen width.
  3585. For Guile to provide this function, you must have the readline
  3586. library, version 2.1 or later, installed on your system. Readline is
  3587. available via anonymous FTP from prep.ai.mit.edu in pub/gnu, or from
  3588. any GNU mirror site.
  3589. See also ADD-HISTORY function.
  3590. ** New function: add-history STRING
  3591. Add STRING as the most recent line in the history used by the READLINE
  3592. command. READLINE does not add lines to the history itself; you must
  3593. call ADD-HISTORY to make previous input available to the user.
  3594. ** The behavior of the read-line function has changed.
  3595. This function now uses standard C library functions to read the line,
  3596. for speed. This means that it doesn not respect the value of
  3597. scm-line-incrementors; it assumes that lines are delimited with
  3598. #\newline.
  3599. (Note that this is read-line, the function that reads a line of text
  3600. from a port, not readline, the function that reads a line from a
  3601. terminal, providing full editing capabilities.)
  3602. ** New module (ice-9 getopt-gnu-style): Parse command-line arguments.
  3603. This module provides some simple argument parsing. It exports one
  3604. function:
  3605. Function: getopt-gnu-style ARG-LS
  3606. Parse a list of program arguments into an alist of option
  3607. descriptions.
  3608. Each item in the list of program arguments is examined to see if
  3609. it meets the syntax of a GNU long-named option. An argument like
  3610. `--MUMBLE' produces an element of the form (MUMBLE . #t) in the
  3611. returned alist, where MUMBLE is a keyword object with the same
  3612. name as the argument. An argument like `--MUMBLE=FROB' produces
  3613. an element of the form (MUMBLE . FROB), where FROB is a string.
  3614. As a special case, the returned alist also contains a pair whose
  3615. car is the symbol `rest'. The cdr of this pair is a list
  3616. containing all the items in the argument list that are not options
  3617. of the form mentioned above.
  3618. The argument `--' is treated specially: all items in the argument
  3619. list appearing after such an argument are not examined, and are
  3620. returned in the special `rest' list.
  3621. This function does not parse normal single-character switches.
  3622. You will need to parse them out of the `rest' list yourself.
  3623. ** The read syntax for byte vectors and short vectors has changed.
  3624. Instead of #bytes(...), write #y(...).
  3625. Instead of #short(...), write #h(...).
  3626. This may seem nutty, but, like the other uniform vectors, byte vectors
  3627. and short vectors want to have the same print and read syntax (and,
  3628. more basic, want to have read syntax!). Changing the read syntax to
  3629. use multiple characters after the hash sign breaks with the
  3630. conventions used in R5RS and the conventions used for the other
  3631. uniform vectors. It also introduces complexity in the current reader,
  3632. both on the C and Scheme levels. (The Right solution is probably to
  3633. change the syntax and prototypes for uniform vectors entirely.)
  3634. ** The new module (ice-9 session) provides useful interactive functions.
  3635. *** New procedure: (apropos REGEXP OPTION ...)
  3636. Display a list of top-level variables whose names match REGEXP, and
  3637. the modules they are imported from. Each OPTION should be one of the
  3638. following symbols:
  3639. value --- Show the value of each matching variable.
  3640. shadow --- Show bindings shadowed by subsequently imported modules.
  3641. full --- Same as both `shadow' and `value'.
  3642. For example:
  3643. guile> (apropos "trace" 'full)
  3644. debug: trace #<procedure trace args>
  3645. debug: untrace #<procedure untrace args>
  3646. the-scm-module: display-backtrace #<compiled-closure #<primitive-procedure gsubr-apply>>
  3647. the-scm-module: before-backtrace-hook ()
  3648. the-scm-module: backtrace #<primitive-procedure backtrace>
  3649. the-scm-module: after-backtrace-hook ()
  3650. the-scm-module: has-shown-backtrace-hint? #f
  3651. guile>
  3652. ** There are new functions and syntax for working with macros.
  3653. Guile implements macros as a special object type. Any variable whose
  3654. top-level binding is a macro object acts as a macro. The macro object
  3655. specifies how the expression should be transformed before evaluation.
  3656. *** Macro objects now print in a reasonable way, resembling procedures.
  3657. *** New function: (macro? OBJ)
  3658. True iff OBJ is a macro object.
  3659. *** New function: (primitive-macro? OBJ)
  3660. Like (macro? OBJ), but true only if OBJ is one of the Guile primitive
  3661. macro transformers, implemented in eval.c rather than Scheme code.
  3662. Why do we have this function?
  3663. - For symmetry with procedure? and primitive-procedure?,
  3664. - to allow custom print procedures to tell whether a macro is
  3665. primitive, and display it differently, and
  3666. - to allow compilers and user-written evaluators to distinguish
  3667. builtin special forms from user-defined ones, which could be
  3668. compiled.
  3669. *** New function: (macro-type OBJ)
  3670. Return a value indicating what kind of macro OBJ is. Possible return
  3671. values are:
  3672. The symbol `syntax' --- a macro created by procedure->syntax.
  3673. The symbol `macro' --- a macro created by procedure->macro.
  3674. The symbol `macro!' --- a macro created by procedure->memoizing-macro.
  3675. The boolean #f --- if OBJ is not a macro object.
  3676. *** New function: (macro-name MACRO)
  3677. Return the name of the macro object MACRO's procedure, as returned by
  3678. procedure-name.
  3679. *** New function: (macro-transformer MACRO)
  3680. Return the transformer procedure for MACRO.
  3681. *** New syntax: (use-syntax MODULE ... TRANSFORMER)
  3682. Specify a new macro expander to use in the current module. Each
  3683. MODULE is a module name, with the same meaning as in the `use-modules'
  3684. form; each named module's exported bindings are added to the current
  3685. top-level environment. TRANSFORMER is an expression evaluated in the
  3686. resulting environment which must yield a procedure to use as the
  3687. module's eval transformer: every expression evaluated in this module
  3688. is passed to this function, and the result passed to the Guile
  3689. interpreter.
  3690. *** macro-eval! is removed. Use local-eval instead.
  3691. ** Some magic has been added to the printer to better handle user
  3692. written printing routines (like record printers, closure printers).
  3693. The problem is that these user written routines must have access to
  3694. the current `print-state' to be able to handle fancy things like
  3695. detection of circular references. These print-states have to be
  3696. passed to the builtin printing routines (display, write, etc) to
  3697. properly continue the print chain.
  3698. We didn't want to change all existing print code so that it
  3699. explicitly passes thru a print state in addition to a port. Instead,
  3700. we extented the possible values that the builtin printing routines
  3701. accept as a `port'. In addition to a normal port, they now also take
  3702. a pair of a normal port and a print-state. Printing will go to the
  3703. port and the print-state will be used to control the detection of
  3704. circular references, etc. If the builtin function does not care for a
  3705. print-state, it is simply ignored.
  3706. User written callbacks are now called with such a pair as their
  3707. `port', but because every function now accepts this pair as a PORT
  3708. argument, you don't have to worry about that. In fact, it is probably
  3709. safest to not check for these pairs.
  3710. However, it is sometimes necessary to continue a print chain on a
  3711. different port, for example to get a intermediate string
  3712. representation of the printed value, mangle that string somehow, and
  3713. then to finally print the mangled string. Use the new function
  3714. inherit-print-state OLD-PORT NEW-PORT
  3715. for this. It constructs a new `port' that prints to NEW-PORT but
  3716. inherits the print-state of OLD-PORT.
  3717. ** struct-vtable-offset renamed to vtable-offset-user
  3718. ** New constants: vtable-index-layout, vtable-index-vtable, vtable-index-printer
  3719. ** There is now a third optional argument to make-vtable-vtable
  3720. (and fourth to make-struct) when constructing new types (vtables).
  3721. This argument initializes field vtable-index-printer of the vtable.
  3722. ** The detection of circular references has been extended to structs.
  3723. That is, a structure that -- in the process of being printed -- prints
  3724. itself does not lead to infinite recursion.
  3725. ** There is now some basic support for fluids. Please read
  3726. "libguile/fluid.h" to find out more. It is accessible from Scheme with
  3727. the following functions and macros:
  3728. Function: make-fluid
  3729. Create a new fluid object. Fluids are not special variables or
  3730. some other extension to the semantics of Scheme, but rather
  3731. ordinary Scheme objects. You can store them into variables (that
  3732. are still lexically scoped, of course) or into any other place you
  3733. like. Every fluid has a initial value of `#f'.
  3734. Function: fluid? OBJ
  3735. Test whether OBJ is a fluid.
  3736. Function: fluid-ref FLUID
  3737. Function: fluid-set! FLUID VAL
  3738. Access/modify the fluid FLUID. Modifications are only visible
  3739. within the current dynamic root (that includes threads).
  3740. Function: with-fluids* FLUIDS VALUES THUNK
  3741. FLUIDS is a list of fluids and VALUES a corresponding list of
  3742. values for these fluids. Before THUNK gets called the values are
  3743. installed in the fluids and the old values of the fluids are
  3744. saved in the VALUES list. When the flow of control leaves THUNK
  3745. or reenters it, the values get swapped again. You might think of
  3746. this as a `safe-fluid-excursion'. Note that the VALUES list is
  3747. modified by `with-fluids*'.
  3748. Macro: with-fluids ((FLUID VALUE) ...) FORM ...
  3749. The same as `with-fluids*' but with a different syntax. It looks
  3750. just like `let', but both FLUID and VALUE are evaluated. Remember,
  3751. fluids are not special variables but ordinary objects. FLUID
  3752. should evaluate to a fluid.
  3753. ** Changes to system call interfaces:
  3754. *** close-port, close-input-port and close-output-port now return a
  3755. boolean instead of an `unspecified' object. #t means that the port
  3756. was successfully closed, while #f means it was already closed. It is
  3757. also now possible for these procedures to raise an exception if an
  3758. error occurs (some errors from write can be delayed until close.)
  3759. *** the first argument to chmod, fcntl, ftell and fseek can now be a
  3760. file descriptor.
  3761. *** the third argument to fcntl is now optional.
  3762. *** the first argument to chown can now be a file descriptor or a port.
  3763. *** the argument to stat can now be a port.
  3764. *** The following new procedures have been added (most use scsh
  3765. interfaces):
  3766. *** procedure: close PORT/FD
  3767. Similar to close-port (*note close-port: Closing Ports.), but also
  3768. works on file descriptors. A side effect of closing a file
  3769. descriptor is that any ports using that file descriptor are moved
  3770. to a different file descriptor and have their revealed counts set
  3771. to zero.
  3772. *** procedure: port->fdes PORT
  3773. Returns the integer file descriptor underlying PORT. As a side
  3774. effect the revealed count of PORT is incremented.
  3775. *** procedure: fdes->ports FDES
  3776. Returns a list of existing ports which have FDES as an underlying
  3777. file descriptor, without changing their revealed counts.
  3778. *** procedure: fdes->inport FDES
  3779. Returns an existing input port which has FDES as its underlying
  3780. file descriptor, if one exists, and increments its revealed count.
  3781. Otherwise, returns a new input port with a revealed count of 1.
  3782. *** procedure: fdes->outport FDES
  3783. Returns an existing output port which has FDES as its underlying
  3784. file descriptor, if one exists, and increments its revealed count.
  3785. Otherwise, returns a new output port with a revealed count of 1.
  3786. The next group of procedures perform a `dup2' system call, if NEWFD
  3787. (an integer) is supplied, otherwise a `dup'. The file descriptor to be
  3788. duplicated can be supplied as an integer or contained in a port. The
  3789. type of value returned varies depending on which procedure is used.
  3790. All procedures also have the side effect when performing `dup2' that
  3791. any ports using NEWFD are moved to a different file descriptor and have
  3792. their revealed counts set to zero.
  3793. *** procedure: dup->fdes PORT/FD [NEWFD]
  3794. Returns an integer file descriptor.
  3795. *** procedure: dup->inport PORT/FD [NEWFD]
  3796. Returns a new input port using the new file descriptor.
  3797. *** procedure: dup->outport PORT/FD [NEWFD]
  3798. Returns a new output port using the new file descriptor.
  3799. *** procedure: dup PORT/FD [NEWFD]
  3800. Returns a new port if PORT/FD is a port, with the same mode as the
  3801. supplied port, otherwise returns an integer file descriptor.
  3802. *** procedure: dup->port PORT/FD MODE [NEWFD]
  3803. Returns a new port using the new file descriptor. MODE supplies a
  3804. mode string for the port (*note open-file: File Ports.).
  3805. *** procedure: setenv NAME VALUE
  3806. Modifies the environment of the current process, which is also the
  3807. default environment inherited by child processes.
  3808. If VALUE is `#f', then NAME is removed from the environment.
  3809. Otherwise, the string NAME=VALUE is added to the environment,
  3810. replacing any existing string with name matching NAME.
  3811. The return value is unspecified.
  3812. *** procedure: truncate-file OBJ SIZE
  3813. Truncates the file referred to by OBJ to at most SIZE bytes. OBJ
  3814. can be a string containing a file name or an integer file
  3815. descriptor or port open for output on the file. The underlying
  3816. system calls are `truncate' and `ftruncate'.
  3817. The return value is unspecified.
  3818. *** procedure: setvbuf PORT MODE [SIZE]
  3819. Set the buffering mode for PORT. MODE can be:
  3820. `_IONBF'
  3821. non-buffered
  3822. `_IOLBF'
  3823. line buffered
  3824. `_IOFBF'
  3825. block buffered, using a newly allocated buffer of SIZE bytes.
  3826. However if SIZE is zero or unspecified, the port will be made
  3827. non-buffered.
  3828. This procedure should not be used after I/O has been performed with
  3829. the port.
  3830. Ports are usually block buffered by default, with a default buffer
  3831. size. Procedures e.g., *Note open-file: File Ports, which accept a
  3832. mode string allow `0' to be added to request an unbuffered port.
  3833. *** procedure: fsync PORT/FD
  3834. Copies any unwritten data for the specified output file descriptor
  3835. to disk. If PORT/FD is a port, its buffer is flushed before the
  3836. underlying file descriptor is fsync'd. The return value is
  3837. unspecified.
  3838. *** procedure: open-fdes PATH FLAGS [MODES]
  3839. Similar to `open' but returns a file descriptor instead of a port.
  3840. *** procedure: execle PATH ENV [ARG] ...
  3841. Similar to `execl', but the environment of the new process is
  3842. specified by ENV, which must be a list of strings as returned by
  3843. the `environ' procedure.
  3844. This procedure is currently implemented using the `execve' system
  3845. call, but we call it `execle' because of its Scheme calling
  3846. interface.
  3847. *** procedure: strerror ERRNO
  3848. Returns the Unix error message corresponding to ERRNO, an integer.
  3849. *** procedure: primitive-exit [STATUS]
  3850. Terminate the current process without unwinding the Scheme stack.
  3851. This is would typically be useful after a fork. The exit status
  3852. is STATUS if supplied, otherwise zero.
  3853. *** procedure: times
  3854. Returns an object with information about real and processor time.
  3855. The following procedures accept such an object as an argument and
  3856. return a selected component:
  3857. `tms:clock'
  3858. The current real time, expressed as time units relative to an
  3859. arbitrary base.
  3860. `tms:utime'
  3861. The CPU time units used by the calling process.
  3862. `tms:stime'
  3863. The CPU time units used by the system on behalf of the
  3864. calling process.
  3865. `tms:cutime'
  3866. The CPU time units used by terminated child processes of the
  3867. calling process, whose status has been collected (e.g., using
  3868. `waitpid').
  3869. `tms:cstime'
  3870. Similarly, the CPU times units used by the system on behalf of
  3871. terminated child processes.
  3872. ** Removed: list-length
  3873. ** Removed: list-append, list-append!
  3874. ** Removed: list-reverse, list-reverse!
  3875. ** array-map renamed to array-map!
  3876. ** serial-array-map renamed to serial-array-map!
  3877. ** catch doesn't take #f as first argument any longer
  3878. Previously, it was possible to pass #f instead of a key to `catch'.
  3879. That would cause `catch' to pass a jump buffer object to the procedure
  3880. passed as second argument. The procedure could then use this jump
  3881. buffer objekt as an argument to throw.
  3882. This mechanism has been removed since its utility doesn't motivate the
  3883. extra complexity it introduces.
  3884. ** The `#/' notation for lists now provokes a warning message from Guile.
  3885. This syntax will be removed from Guile in the near future.
  3886. To disable the warning message, set the GUILE_HUSH environment
  3887. variable to any non-empty value.
  3888. ** The newline character now prints as `#\newline', following the
  3889. normal Scheme notation, not `#\nl'.
  3890. * Changes to the gh_ interface
  3891. ** The gh_enter function now takes care of loading the Guile startup files.
  3892. gh_enter works by calling scm_boot_guile; see the remarks below.
  3893. ** Function: void gh_write (SCM x)
  3894. Write the printed representation of the scheme object x to the current
  3895. output port. Corresponds to the scheme level `write'.
  3896. ** gh_list_length renamed to gh_length.
  3897. ** vector handling routines
  3898. Several major changes. In particular, gh_vector() now resembles
  3899. (vector ...) (with a caveat -- see manual), and gh_make_vector() now
  3900. exists and behaves like (make-vector ...). gh_vset() and gh_vref()
  3901. have been renamed gh_vector_set_x() and gh_vector_ref(). Some missing
  3902. vector-related gh_ functions have been implemented.
  3903. ** pair and list routines
  3904. Implemented several of the R4RS pair and list functions that were
  3905. missing.
  3906. ** gh_scm2doubles, gh_doubles2scm, gh_doubles2dvect
  3907. New function. Converts double arrays back and forth between Scheme
  3908. and C.
  3909. * Changes to the scm_ interface
  3910. ** The function scm_boot_guile now takes care of loading the startup files.
  3911. Guile's primary initialization function, scm_boot_guile, now takes
  3912. care of loading `boot-9.scm', in the `ice-9' module, to initialize
  3913. Guile, define the module system, and put together some standard
  3914. bindings. It also loads `init.scm', which is intended to hold
  3915. site-specific initialization code.
  3916. Since Guile cannot operate properly until boot-9.scm is loaded, there
  3917. is no reason to separate loading boot-9.scm from Guile's other
  3918. initialization processes.
  3919. This job used to be done by scm_compile_shell_switches, which didn't
  3920. make much sense; in particular, it meant that people using Guile for
  3921. non-shell-like applications had to jump through hoops to get Guile
  3922. initialized properly.
  3923. ** The function scm_compile_shell_switches no longer loads the startup files.
  3924. Now, Guile always loads the startup files, whenever it is initialized;
  3925. see the notes above for scm_boot_guile and scm_load_startup_files.
  3926. ** Function: scm_load_startup_files
  3927. This new function takes care of loading Guile's initialization file
  3928. (`boot-9.scm'), and the site initialization file, `init.scm'. Since
  3929. this is always called by the Guile initialization process, it's
  3930. probably not too useful to call this yourself, but it's there anyway.
  3931. ** The semantics of smob marking have changed slightly.
  3932. The smob marking function (the `mark' member of the scm_smobfuns
  3933. structure) is no longer responsible for setting the mark bit on the
  3934. smob. The generic smob handling code in the garbage collector will
  3935. set this bit. The mark function need only ensure that any other
  3936. objects the smob refers to get marked.
  3937. Note that this change means that the smob's GC8MARK bit is typically
  3938. already set upon entry to the mark function. Thus, marking functions
  3939. which look like this:
  3940. {
  3941. if (SCM_GC8MARKP (ptr))
  3942. return SCM_BOOL_F;
  3943. SCM_SETGC8MARK (ptr);
  3944. ... mark objects to which the smob refers ...
  3945. }
  3946. are now incorrect, since they will return early, and fail to mark any
  3947. other objects the smob refers to. Some code in the Guile library used
  3948. to work this way.
  3949. ** The semantics of the I/O port functions in scm_ptobfuns have changed.
  3950. If you have implemented your own I/O port type, by writing the
  3951. functions required by the scm_ptobfuns and then calling scm_newptob,
  3952. you will need to change your functions slightly.
  3953. The functions in a scm_ptobfuns structure now expect the port itself
  3954. as their argument; they used to expect the `stream' member of the
  3955. port's scm_port_table structure. This allows functions in an
  3956. scm_ptobfuns structure to easily access the port's cell (and any flags
  3957. it its CAR), and the port's scm_port_table structure.
  3958. Guile now passes the I/O port itself as the `port' argument in the
  3959. following scm_ptobfuns functions:
  3960. int (*free) (SCM port);
  3961. int (*fputc) (int, SCM port);
  3962. int (*fputs) (char *, SCM port);
  3963. scm_sizet (*fwrite) SCM_P ((char *ptr,
  3964. scm_sizet size,
  3965. scm_sizet nitems,
  3966. SCM port));
  3967. int (*fflush) (SCM port);
  3968. int (*fgetc) (SCM port);
  3969. int (*fclose) (SCM port);
  3970. The interfaces to the `mark', `print', `equalp', and `fgets' methods
  3971. are unchanged.
  3972. If you have existing code which defines its own port types, it is easy
  3973. to convert your code to the new interface; simply apply SCM_STREAM to
  3974. the port argument to yield the value you code used to expect.
  3975. Note that since both the port and the stream have the same type in the
  3976. C code --- they are both SCM values --- the C compiler will not remind
  3977. you if you forget to update your scm_ptobfuns functions.
  3978. ** Function: int scm_internal_select (int fds,
  3979. SELECT_TYPE *rfds,
  3980. SELECT_TYPE *wfds,
  3981. SELECT_TYPE *efds,
  3982. struct timeval *timeout);
  3983. This is a replacement for the `select' function provided by the OS.
  3984. It enables I/O blocking and sleeping to happen for one cooperative
  3985. thread without blocking other threads. It also avoids busy-loops in
  3986. these situations. It is intended that all I/O blocking and sleeping
  3987. will finally go through this function. Currently, this function is
  3988. only available on systems providing `gettimeofday' and `select'.
  3989. ** Function: SCM scm_internal_stack_catch (SCM tag,
  3990. scm_catch_body_t body,
  3991. void *body_data,
  3992. scm_catch_handler_t handler,
  3993. void *handler_data)
  3994. A new sibling to the other two C level `catch' functions
  3995. scm_internal_catch and scm_internal_lazy_catch. Use it if you want
  3996. the stack to be saved automatically into the variable `the-last-stack'
  3997. (scm_the_last_stack_var) on error. This is necessary if you want to
  3998. use advanced error reporting, such as calling scm_display_error and
  3999. scm_display_backtrace. (They both take a stack object as argument.)
  4000. ** Function: SCM scm_spawn_thread (scm_catch_body_t body,
  4001. void *body_data,
  4002. scm_catch_handler_t handler,
  4003. void *handler_data)
  4004. Spawns a new thread. It does a job similar to
  4005. scm_call_with_new_thread but takes arguments more suitable when
  4006. spawning threads from application C code.
  4007. ** The hook scm_error_callback has been removed. It was originally
  4008. intended as a way for the user to install his own error handler. But
  4009. that method works badly since it intervenes between throw and catch,
  4010. thereby changing the semantics of expressions like (catch #t ...).
  4011. The correct way to do it is to use one of the C level catch functions
  4012. in throw.c: scm_internal_catch/lazy_catch/stack_catch.
  4013. ** Removed functions:
  4014. scm_obj_length, scm_list_length, scm_list_append, scm_list_append_x,
  4015. scm_list_reverse, scm_list_reverse_x
  4016. ** New macros: SCM_LISTn where n is one of the integers 0-9.
  4017. These can be used for pretty list creation from C. The idea is taken
  4018. from Erick Gallesio's STk.
  4019. ** scm_array_map renamed to scm_array_map_x
  4020. ** mbstrings are now removed
  4021. This means that the type codes scm_tc7_mb_string and
  4022. scm_tc7_mb_substring has been removed.
  4023. ** scm_gen_putc, scm_gen_puts, scm_gen_write, and scm_gen_getc have changed.
  4024. Since we no longer support multi-byte strings, these I/O functions
  4025. have been simplified, and renamed. Here are their old names, and
  4026. their new names and arguments:
  4027. scm_gen_putc -> void scm_putc (int c, SCM port);
  4028. scm_gen_puts -> void scm_puts (char *s, SCM port);
  4029. scm_gen_write -> void scm_lfwrite (char *ptr, scm_sizet size, SCM port);
  4030. scm_gen_getc -> void scm_getc (SCM port);
  4031. ** The macros SCM_TYP7D and SCM_TYP7SD has been removed.
  4032. ** The macro SCM_TYP7S has taken the role of the old SCM_TYP7D
  4033. SCM_TYP7S now masks away the bit which distinguishes substrings from
  4034. strings.
  4035. ** scm_catch_body_t: Backward incompatible change!
  4036. Body functions to scm_internal_catch and friends do not any longer
  4037. take a second argument. This is because it is no longer possible to
  4038. pass a #f arg to catch.
  4039. ** Calls to scm_protect_object and scm_unprotect now nest properly.
  4040. The function scm_protect_object protects its argument from being freed
  4041. by the garbage collector. scm_unprotect_object removes that
  4042. protection.
  4043. These functions now nest properly. That is, for every object O, there
  4044. is a counter which scm_protect_object(O) increments and
  4045. scm_unprotect_object(O) decrements, if the counter is greater than
  4046. zero. Every object's counter is zero when it is first created. If an
  4047. object's counter is greater than zero, the garbage collector will not
  4048. reclaim its storage.
  4049. This allows you to use scm_protect_object in your code without
  4050. worrying that some other function you call will call
  4051. scm_unprotect_object, and allow it to be freed. Assuming that the
  4052. functions you call are well-behaved, and unprotect only those objects
  4053. they protect, you can follow the same rule and have confidence that
  4054. objects will be freed only at appropriate times.
  4055. Changes in Guile 1.2 (released Tuesday, June 24 1997):
  4056. * Changes to the distribution
  4057. ** Nightly snapshots are now available from ftp.red-bean.com.
  4058. The old server, ftp.cyclic.com, has been relinquished to its rightful
  4059. owner.
  4060. Nightly snapshots of the Guile development sources are now available via
  4061. anonymous FTP from ftp.red-bean.com, as /pub/guile/guile-snap.tar.gz.
  4062. Via the web, that's: ftp://ftp.red-bean.com/pub/guile/guile-snap.tar.gz
  4063. For getit, that's: ftp.red-bean.com:/pub/guile/guile-snap.tar.gz
  4064. ** To run Guile without installing it, the procedure has changed a bit.
  4065. If you used a separate build directory to compile Guile, you'll need
  4066. to include the build directory in SCHEME_LOAD_PATH, as well as the
  4067. source directory. See the `INSTALL' file for examples.
  4068. * Changes to the procedure for linking libguile with your programs
  4069. ** The standard Guile load path for Scheme code now includes
  4070. $(datadir)/guile (usually /usr/local/share/guile). This means that
  4071. you can install your own Scheme files there, and Guile will find them.
  4072. (Previous versions of Guile only checked a directory whose name
  4073. contained the Guile version number, so you had to re-install or move
  4074. your Scheme sources each time you installed a fresh version of Guile.)
  4075. The load path also includes $(datadir)/guile/site; we recommend
  4076. putting individual Scheme files there. If you want to install a
  4077. package with multiple source files, create a directory for them under
  4078. $(datadir)/guile.
  4079. ** Guile 1.2 will now use the Rx regular expression library, if it is
  4080. installed on your system. When you are linking libguile into your own
  4081. programs, this means you will have to link against -lguile, -lqt (if
  4082. you configured Guile with thread support), and -lrx.
  4083. If you are using autoconf to generate configuration scripts for your
  4084. application, the following lines should suffice to add the appropriate
  4085. libraries to your link command:
  4086. ### Find Rx, quickthreads and libguile.
  4087. AC_CHECK_LIB(rx, main)
  4088. AC_CHECK_LIB(qt, main)
  4089. AC_CHECK_LIB(guile, scm_shell)
  4090. The Guile 1.2 distribution does not contain sources for the Rx
  4091. library, as Guile 1.0 did. If you want to use Rx, you'll need to
  4092. retrieve it from a GNU FTP site and install it separately.
  4093. * Changes to Scheme functions and syntax
  4094. ** The dynamic linking features of Guile are now enabled by default.
  4095. You can disable them by giving the `--disable-dynamic-linking' option
  4096. to configure.
  4097. (dynamic-link FILENAME)
  4098. Find the object file denoted by FILENAME (a string) and link it
  4099. into the running Guile application. When everything works out,
  4100. return a Scheme object suitable for representing the linked object
  4101. file. Otherwise an error is thrown. How object files are
  4102. searched is system dependent.
  4103. (dynamic-object? VAL)
  4104. Determine whether VAL represents a dynamically linked object file.
  4105. (dynamic-unlink DYNOBJ)
  4106. Unlink the indicated object file from the application. DYNOBJ
  4107. should be one of the values returned by `dynamic-link'.
  4108. (dynamic-func FUNCTION DYNOBJ)
  4109. Search the C function indicated by FUNCTION (a string or symbol)
  4110. in DYNOBJ and return some Scheme object that can later be used
  4111. with `dynamic-call' to actually call this function. Right now,
  4112. these Scheme objects are formed by casting the address of the
  4113. function to `long' and converting this number to its Scheme
  4114. representation.
  4115. (dynamic-call FUNCTION DYNOBJ)
  4116. Call the C function indicated by FUNCTION and DYNOBJ. The
  4117. function is passed no arguments and its return value is ignored.
  4118. When FUNCTION is something returned by `dynamic-func', call that
  4119. function and ignore DYNOBJ. When FUNCTION is a string (or symbol,
  4120. etc.), look it up in DYNOBJ; this is equivalent to
  4121. (dynamic-call (dynamic-func FUNCTION DYNOBJ) #f)
  4122. Interrupts are deferred while the C function is executing (with
  4123. SCM_DEFER_INTS/SCM_ALLOW_INTS).
  4124. (dynamic-args-call FUNCTION DYNOBJ ARGS)
  4125. Call the C function indicated by FUNCTION and DYNOBJ, but pass it
  4126. some arguments and return its return value. The C function is
  4127. expected to take two arguments and return an `int', just like
  4128. `main':
  4129. int c_func (int argc, char **argv);
  4130. ARGS must be a list of strings and is converted into an array of
  4131. `char *'. The array is passed in ARGV and its size in ARGC. The
  4132. return value is converted to a Scheme number and returned from the
  4133. call to `dynamic-args-call'.
  4134. When dynamic linking is disabled or not supported on your system,
  4135. the above functions throw errors, but they are still available.
  4136. Here is a small example that works on GNU/Linux:
  4137. (define libc-obj (dynamic-link "libc.so"))
  4138. (dynamic-args-call 'rand libc-obj '())
  4139. See the file `libguile/DYNAMIC-LINKING' for additional comments.
  4140. ** The #/ syntax for module names is depreciated, and will be removed
  4141. in a future version of Guile. Instead of
  4142. #/foo/bar/baz
  4143. instead write
  4144. (foo bar baz)
  4145. The latter syntax is more consistent with existing Lisp practice.
  4146. ** Guile now does fancier printing of structures. Structures are the
  4147. underlying implementation for records, which in turn are used to
  4148. implement modules, so all of these object now print differently and in
  4149. a more informative way.
  4150. The Scheme printer will examine the builtin variable *struct-printer*
  4151. whenever it needs to print a structure object. When this variable is
  4152. not `#f' it is deemed to be a procedure and will be applied to the
  4153. structure object and the output port. When *struct-printer* is `#f'
  4154. or the procedure return `#f' the structure object will be printed in
  4155. the boring #<struct 80458270> form.
  4156. This hook is used by some routines in ice-9/boot-9.scm to implement
  4157. type specific printing routines. Please read the comments there about
  4158. "printing structs".
  4159. One of the more specific uses of structs are records. The printing
  4160. procedure that could be passed to MAKE-RECORD-TYPE is now actually
  4161. called. It should behave like a *struct-printer* procedure (described
  4162. above).
  4163. ** Guile now supports a new R4RS-compliant syntax for keywords. A
  4164. token of the form #:NAME, where NAME has the same syntax as a Scheme
  4165. symbol, is the external representation of the keyword named NAME.
  4166. Keyword objects print using this syntax as well, so values containing
  4167. keyword objects can be read back into Guile. When used in an
  4168. expression, keywords are self-quoting objects.
  4169. Guile suports this read syntax, and uses this print syntax, regardless
  4170. of the current setting of the `keyword' read option. The `keyword'
  4171. read option only controls whether Guile recognizes the `:NAME' syntax,
  4172. which is incompatible with R4RS. (R4RS says such token represent
  4173. symbols.)
  4174. ** Guile has regular expression support again. Guile 1.0 included
  4175. functions for matching regular expressions, based on the Rx library.
  4176. In Guile 1.1, the Guile/Rx interface was removed to simplify the
  4177. distribution, and thus Guile had no regular expression support. Guile
  4178. 1.2 again supports the most commonly used functions, and supports all
  4179. of SCSH's regular expression functions.
  4180. If your system does not include a POSIX regular expression library,
  4181. and you have not linked Guile with a third-party regexp library such as
  4182. Rx, these functions will not be available. You can tell whether your
  4183. Guile installation includes regular expression support by checking
  4184. whether the `*features*' list includes the `regex' symbol.
  4185. *** regexp functions
  4186. By default, Guile supports POSIX extended regular expressions. That
  4187. means that the characters `(', `)', `+' and `?' are special, and must
  4188. be escaped if you wish to match the literal characters.
  4189. This regular expression interface was modeled after that implemented
  4190. by SCSH, the Scheme Shell. It is intended to be upwardly compatible
  4191. with SCSH regular expressions.
  4192. **** Function: string-match PATTERN STR [START]
  4193. Compile the string PATTERN into a regular expression and compare
  4194. it with STR. The optional numeric argument START specifies the
  4195. position of STR at which to begin matching.
  4196. `string-match' returns a "match structure" which describes what,
  4197. if anything, was matched by the regular expression. *Note Match
  4198. Structures::. If STR does not match PATTERN at all,
  4199. `string-match' returns `#f'.
  4200. Each time `string-match' is called, it must compile its PATTERN
  4201. argument into a regular expression structure. This operation is
  4202. expensive, which makes `string-match' inefficient if the same regular
  4203. expression is used several times (for example, in a loop). For better
  4204. performance, you can compile a regular expression in advance and then
  4205. match strings against the compiled regexp.
  4206. **** Function: make-regexp STR [FLAGS]
  4207. Compile the regular expression described by STR, and return the
  4208. compiled regexp structure. If STR does not describe a legal
  4209. regular expression, `make-regexp' throws a
  4210. `regular-expression-syntax' error.
  4211. FLAGS may be the bitwise-or of one or more of the following:
  4212. **** Constant: regexp/extended
  4213. Use POSIX Extended Regular Expression syntax when interpreting
  4214. STR. If not set, POSIX Basic Regular Expression syntax is used.
  4215. If the FLAGS argument is omitted, we assume regexp/extended.
  4216. **** Constant: regexp/icase
  4217. Do not differentiate case. Subsequent searches using the
  4218. returned regular expression will be case insensitive.
  4219. **** Constant: regexp/newline
  4220. Match-any-character operators don't match a newline.
  4221. A non-matching list ([^...]) not containing a newline matches a
  4222. newline.
  4223. Match-beginning-of-line operator (^) matches the empty string
  4224. immediately after a newline, regardless of whether the FLAGS
  4225. passed to regexp-exec contain regexp/notbol.
  4226. Match-end-of-line operator ($) matches the empty string
  4227. immediately before a newline, regardless of whether the FLAGS
  4228. passed to regexp-exec contain regexp/noteol.
  4229. **** Function: regexp-exec REGEXP STR [START [FLAGS]]
  4230. Match the compiled regular expression REGEXP against `str'. If
  4231. the optional integer START argument is provided, begin matching
  4232. from that position in the string. Return a match structure
  4233. describing the results of the match, or `#f' if no match could be
  4234. found.
  4235. FLAGS may be the bitwise-or of one or more of the following:
  4236. **** Constant: regexp/notbol
  4237. The match-beginning-of-line operator always fails to match (but
  4238. see the compilation flag regexp/newline above) This flag may be
  4239. used when different portions of a string are passed to
  4240. regexp-exec and the beginning of the string should not be
  4241. interpreted as the beginning of the line.
  4242. **** Constant: regexp/noteol
  4243. The match-end-of-line operator always fails to match (but see the
  4244. compilation flag regexp/newline above)
  4245. **** Function: regexp? OBJ
  4246. Return `#t' if OBJ is a compiled regular expression, or `#f'
  4247. otherwise.
  4248. Regular expressions are commonly used to find patterns in one string
  4249. and replace them with the contents of another string.
  4250. **** Function: regexp-substitute PORT MATCH [ITEM...]
  4251. Write to the output port PORT selected contents of the match
  4252. structure MATCH. Each ITEM specifies what should be written, and
  4253. may be one of the following arguments:
  4254. * A string. String arguments are written out verbatim.
  4255. * An integer. The submatch with that number is written.
  4256. * The symbol `pre'. The portion of the matched string preceding
  4257. the regexp match is written.
  4258. * The symbol `post'. The portion of the matched string
  4259. following the regexp match is written.
  4260. PORT may be `#f', in which case nothing is written; instead,
  4261. `regexp-substitute' constructs a string from the specified ITEMs
  4262. and returns that.
  4263. **** Function: regexp-substitute/global PORT REGEXP TARGET [ITEM...]
  4264. Similar to `regexp-substitute', but can be used to perform global
  4265. substitutions on STR. Instead of taking a match structure as an
  4266. argument, `regexp-substitute/global' takes two string arguments: a
  4267. REGEXP string describing a regular expression, and a TARGET string
  4268. which should be matched against this regular expression.
  4269. Each ITEM behaves as in REGEXP-SUBSTITUTE, with the following
  4270. exceptions:
  4271. * A function may be supplied. When this function is called, it
  4272. will be passed one argument: a match structure for a given
  4273. regular expression match. It should return a string to be
  4274. written out to PORT.
  4275. * The `post' symbol causes `regexp-substitute/global' to recurse
  4276. on the unmatched portion of STR. This *must* be supplied in
  4277. order to perform global search-and-replace on STR; if it is
  4278. not present among the ITEMs, then `regexp-substitute/global'
  4279. will return after processing a single match.
  4280. *** Match Structures
  4281. A "match structure" is the object returned by `string-match' and
  4282. `regexp-exec'. It describes which portion of a string, if any, matched
  4283. the given regular expression. Match structures include: a reference to
  4284. the string that was checked for matches; the starting and ending
  4285. positions of the regexp match; and, if the regexp included any
  4286. parenthesized subexpressions, the starting and ending positions of each
  4287. submatch.
  4288. In each of the regexp match functions described below, the `match'
  4289. argument must be a match structure returned by a previous call to
  4290. `string-match' or `regexp-exec'. Most of these functions return some
  4291. information about the original target string that was matched against a
  4292. regular expression; we will call that string TARGET for easy reference.
  4293. **** Function: regexp-match? OBJ
  4294. Return `#t' if OBJ is a match structure returned by a previous
  4295. call to `regexp-exec', or `#f' otherwise.
  4296. **** Function: match:substring MATCH [N]
  4297. Return the portion of TARGET matched by subexpression number N.
  4298. Submatch 0 (the default) represents the entire regexp match. If
  4299. the regular expression as a whole matched, but the subexpression
  4300. number N did not match, return `#f'.
  4301. **** Function: match:start MATCH [N]
  4302. Return the starting position of submatch number N.
  4303. **** Function: match:end MATCH [N]
  4304. Return the ending position of submatch number N.
  4305. **** Function: match:prefix MATCH
  4306. Return the unmatched portion of TARGET preceding the regexp match.
  4307. **** Function: match:suffix MATCH
  4308. Return the unmatched portion of TARGET following the regexp match.
  4309. **** Function: match:count MATCH
  4310. Return the number of parenthesized subexpressions from MATCH.
  4311. Note that the entire regular expression match itself counts as a
  4312. subexpression, and failed submatches are included in the count.
  4313. **** Function: match:string MATCH
  4314. Return the original TARGET string.
  4315. *** Backslash Escapes
  4316. Sometimes you will want a regexp to match characters like `*' or `$'
  4317. exactly. For example, to check whether a particular string represents
  4318. a menu entry from an Info node, it would be useful to match it against
  4319. a regexp like `^* [^:]*::'. However, this won't work; because the
  4320. asterisk is a metacharacter, it won't match the `*' at the beginning of
  4321. the string. In this case, we want to make the first asterisk un-magic.
  4322. You can do this by preceding the metacharacter with a backslash
  4323. character `\'. (This is also called "quoting" the metacharacter, and
  4324. is known as a "backslash escape".) When Guile sees a backslash in a
  4325. regular expression, it considers the following glyph to be an ordinary
  4326. character, no matter what special meaning it would ordinarily have.
  4327. Therefore, we can make the above example work by changing the regexp to
  4328. `^\* [^:]*::'. The `\*' sequence tells the regular expression engine
  4329. to match only a single asterisk in the target string.
  4330. Since the backslash is itself a metacharacter, you may force a
  4331. regexp to match a backslash in the target string by preceding the
  4332. backslash with itself. For example, to find variable references in a
  4333. TeX program, you might want to find occurrences of the string `\let\'
  4334. followed by any number of alphabetic characters. The regular expression
  4335. `\\let\\[A-Za-z]*' would do this: the double backslashes in the regexp
  4336. each match a single backslash in the target string.
  4337. **** Function: regexp-quote STR
  4338. Quote each special character found in STR with a backslash, and
  4339. return the resulting string.
  4340. *Very important:* Using backslash escapes in Guile source code (as
  4341. in Emacs Lisp or C) can be tricky, because the backslash character has
  4342. special meaning for the Guile reader. For example, if Guile encounters
  4343. the character sequence `\n' in the middle of a string while processing
  4344. Scheme code, it replaces those characters with a newline character.
  4345. Similarly, the character sequence `\t' is replaced by a horizontal tab.
  4346. Several of these "escape sequences" are processed by the Guile reader
  4347. before your code is executed. Unrecognized escape sequences are
  4348. ignored: if the characters `\*' appear in a string, they will be
  4349. translated to the single character `*'.
  4350. This translation is obviously undesirable for regular expressions,
  4351. since we want to be able to include backslashes in a string in order to
  4352. escape regexp metacharacters. Therefore, to make sure that a backslash
  4353. is preserved in a string in your Guile program, you must use *two*
  4354. consecutive backslashes:
  4355. (define Info-menu-entry-pattern (make-regexp "^\\* [^:]*"))
  4356. The string in this example is preprocessed by the Guile reader before
  4357. any code is executed. The resulting argument to `make-regexp' is the
  4358. string `^\* [^:]*', which is what we really want.
  4359. This also means that in order to write a regular expression that
  4360. matches a single backslash character, the regular expression string in
  4361. the source code must include *four* backslashes. Each consecutive pair
  4362. of backslashes gets translated by the Guile reader to a single
  4363. backslash, and the resulting double-backslash is interpreted by the
  4364. regexp engine as matching a single backslash character. Hence:
  4365. (define tex-variable-pattern (make-regexp "\\\\let\\\\=[A-Za-z]*"))
  4366. The reason for the unwieldiness of this syntax is historical. Both
  4367. regular expression pattern matchers and Unix string processing systems
  4368. have traditionally used backslashes with the special meanings described
  4369. above. The POSIX regular expression specification and ANSI C standard
  4370. both require these semantics. Attempting to abandon either convention
  4371. would cause other kinds of compatibility problems, possibly more severe
  4372. ones. Therefore, without extending the Scheme reader to support
  4373. strings with different quoting conventions (an ungainly and confusing
  4374. extension when implemented in other languages), we must adhere to this
  4375. cumbersome escape syntax.
  4376. * Changes to the gh_ interface
  4377. * Changes to the scm_ interface
  4378. * Changes to system call interfaces:
  4379. ** The value returned by `raise' is now unspecified. It throws an exception
  4380. if an error occurs.
  4381. *** A new procedure `sigaction' can be used to install signal handlers
  4382. (sigaction signum [action] [flags])
  4383. signum is the signal number, which can be specified using the value
  4384. of SIGINT etc.
  4385. If action is omitted, sigaction returns a pair: the CAR is the current
  4386. signal hander, which will be either an integer with the value SIG_DFL
  4387. (default action) or SIG_IGN (ignore), or the Scheme procedure which
  4388. handles the signal, or #f if a non-Scheme procedure handles the
  4389. signal. The CDR contains the current sigaction flags for the handler.
  4390. If action is provided, it is installed as the new handler for signum.
  4391. action can be a Scheme procedure taking one argument, or the value of
  4392. SIG_DFL (default action) or SIG_IGN (ignore), or #f to restore
  4393. whatever signal handler was installed before sigaction was first used.
  4394. Flags can optionally be specified for the new handler (SA_RESTART is
  4395. always used if the system provides it, so need not be specified.) The
  4396. return value is a pair with information about the old handler as
  4397. described above.
  4398. This interface does not provide access to the "signal blocking"
  4399. facility. Maybe this is not needed, since the thread support may
  4400. provide solutions to the problem of consistent access to data
  4401. structures.
  4402. *** A new procedure `flush-all-ports' is equivalent to running
  4403. `force-output' on every port open for output.
  4404. ** Guile now provides information on how it was built, via the new
  4405. global variable, %guile-build-info. This variable records the values
  4406. of the standard GNU makefile directory variables as an assocation
  4407. list, mapping variable names (symbols) onto directory paths (strings).
  4408. For example, to find out where the Guile link libraries were
  4409. installed, you can say:
  4410. guile -c "(display (assq-ref %guile-build-info 'libdir)) (newline)"
  4411. * Changes to the scm_ interface
  4412. ** The new function scm_handle_by_message_noexit is just like the
  4413. existing scm_handle_by_message function, except that it doesn't call
  4414. exit to terminate the process. Instead, it prints a message and just
  4415. returns #f. This might be a more appropriate catch-all handler for
  4416. new dynamic roots and threads.
  4417. Changes in Guile 1.1 (released Friday, May 16 1997):
  4418. * Changes to the distribution.
  4419. The Guile 1.0 distribution has been split up into several smaller
  4420. pieces:
  4421. guile-core --- the Guile interpreter itself.
  4422. guile-tcltk --- the interface between the Guile interpreter and
  4423. Tcl/Tk; Tcl is an interpreter for a stringy language, and Tk
  4424. is a toolkit for building graphical user interfaces.
  4425. guile-rgx-ctax --- the interface between Guile and the Rx regular
  4426. expression matcher, and the translator for the Ctax
  4427. programming language. These are packaged together because the
  4428. Ctax translator uses Rx to parse Ctax source code.
  4429. This NEWS file describes the changes made to guile-core since the 1.0
  4430. release.
  4431. We no longer distribute the documentation, since it was either out of
  4432. date, or incomplete. As soon as we have current documentation, we
  4433. will distribute it.
  4434. * Changes to the stand-alone interpreter
  4435. ** guile now accepts command-line arguments compatible with SCSH, Olin
  4436. Shivers' Scheme Shell.
  4437. In general, arguments are evaluated from left to right, but there are
  4438. exceptions. The following switches stop argument processing, and
  4439. stash all remaining command-line arguments as the value returned by
  4440. the (command-line) function.
  4441. -s SCRIPT load Scheme source code from FILE, and exit
  4442. -c EXPR evalute Scheme expression EXPR, and exit
  4443. -- stop scanning arguments; run interactively
  4444. The switches below are processed as they are encountered.
  4445. -l FILE load Scheme source code from FILE
  4446. -e FUNCTION after reading script, apply FUNCTION to
  4447. command line arguments
  4448. -ds do -s script at this point
  4449. --emacs enable Emacs protocol (experimental)
  4450. -h, --help display this help and exit
  4451. -v, --version display version information and exit
  4452. \ read arguments from following script lines
  4453. So, for example, here is a Guile script named `ekko' (thanks, Olin)
  4454. which re-implements the traditional "echo" command:
  4455. #!/usr/local/bin/guile -s
  4456. !#
  4457. (define (main args)
  4458. (map (lambda (arg) (display arg) (display " "))
  4459. (cdr args))
  4460. (newline))
  4461. (main (command-line))
  4462. Suppose we invoke this script as follows:
  4463. ekko a speckled gecko
  4464. Through the magic of Unix script processing (triggered by the `#!'
  4465. token at the top of the file), /usr/local/bin/guile receives the
  4466. following list of command-line arguments:
  4467. ("-s" "./ekko" "a" "speckled" "gecko")
  4468. Unix inserts the name of the script after the argument specified on
  4469. the first line of the file (in this case, "-s"), and then follows that
  4470. with the arguments given to the script. Guile loads the script, which
  4471. defines the `main' function, and then applies it to the list of
  4472. remaining command-line arguments, ("a" "speckled" "gecko").
  4473. In Unix, the first line of a script file must take the following form:
  4474. #!INTERPRETER ARGUMENT
  4475. where INTERPRETER is the absolute filename of the interpreter
  4476. executable, and ARGUMENT is a single command-line argument to pass to
  4477. the interpreter.
  4478. You may only pass one argument to the interpreter, and its length is
  4479. limited. These restrictions can be annoying to work around, so Guile
  4480. provides a general mechanism (borrowed from, and compatible with,
  4481. SCSH) for circumventing them.
  4482. If the ARGUMENT in a Guile script is a single backslash character,
  4483. `\', Guile will open the script file, parse arguments from its second
  4484. and subsequent lines, and replace the `\' with them. So, for example,
  4485. here is another implementation of the `ekko' script:
  4486. #!/usr/local/bin/guile \
  4487. -e main -s
  4488. !#
  4489. (define (main args)
  4490. (for-each (lambda (arg) (display arg) (display " "))
  4491. (cdr args))
  4492. (newline))
  4493. If the user invokes this script as follows:
  4494. ekko a speckled gecko
  4495. Unix expands this into
  4496. /usr/local/bin/guile \ ekko a speckled gecko
  4497. When Guile sees the `\' argument, it replaces it with the arguments
  4498. read from the second line of the script, producing:
  4499. /usr/local/bin/guile -e main -s ekko a speckled gecko
  4500. This tells Guile to load the `ekko' script, and apply the function
  4501. `main' to the argument list ("a" "speckled" "gecko").
  4502. Here is how Guile parses the command-line arguments:
  4503. - Each space character terminates an argument. This means that two
  4504. spaces in a row introduce an empty-string argument.
  4505. - The tab character is not permitted (unless you quote it with the
  4506. backslash character, as described below), to avoid confusion.
  4507. - The newline character terminates the sequence of arguments, and will
  4508. also terminate a final non-empty argument. (However, a newline
  4509. following a space will not introduce a final empty-string argument;
  4510. it only terminates the argument list.)
  4511. - The backslash character is the escape character. It escapes
  4512. backslash, space, tab, and newline. The ANSI C escape sequences
  4513. like \n and \t are also supported. These produce argument
  4514. constituents; the two-character combination \n doesn't act like a
  4515. terminating newline. The escape sequence \NNN for exactly three
  4516. octal digits reads as the character whose ASCII code is NNN. As
  4517. above, characters produced this way are argument constituents.
  4518. Backslash followed by other characters is not allowed.
  4519. * Changes to the procedure for linking libguile with your programs
  4520. ** Guile now builds and installs a shared guile library, if your
  4521. system support shared libraries. (It still builds a static library on
  4522. all systems.) Guile automatically detects whether your system
  4523. supports shared libraries. To prevent Guile from buildisg shared
  4524. libraries, pass the `--disable-shared' flag to the configure script.
  4525. Guile takes longer to compile when it builds shared libraries, because
  4526. it must compile every file twice --- once to produce position-
  4527. independent object code, and once to produce normal object code.
  4528. ** The libthreads library has been merged into libguile.
  4529. To link a program against Guile, you now need only link against
  4530. -lguile and -lqt; -lthreads is no longer needed. If you are using
  4531. autoconf to generate configuration scripts for your application, the
  4532. following lines should suffice to add the appropriate libraries to
  4533. your link command:
  4534. ### Find quickthreads and libguile.
  4535. AC_CHECK_LIB(qt, main)
  4536. AC_CHECK_LIB(guile, scm_shell)
  4537. * Changes to Scheme functions
  4538. ** Guile Scheme's special syntax for keyword objects is now optional,
  4539. and disabled by default.
  4540. The syntax variation from R4RS made it difficult to port some
  4541. interesting packages to Guile. The routines which accepted keyword
  4542. arguments (mostly in the module system) have been modified to also
  4543. accept symbols whose names begin with `:'.
  4544. To change the keyword syntax, you must first import the (ice-9 debug)
  4545. module:
  4546. (use-modules (ice-9 debug))
  4547. Then you can enable the keyword syntax as follows:
  4548. (read-set! keywords 'prefix)
  4549. To disable keyword syntax, do this:
  4550. (read-set! keywords #f)
  4551. ** Many more primitive functions accept shared substrings as
  4552. arguments. In the past, these functions required normal, mutable
  4553. strings as arguments, although they never made use of this
  4554. restriction.
  4555. ** The uniform array functions now operate on byte vectors. These
  4556. functions are `array-fill!', `serial-array-copy!', `array-copy!',
  4557. `serial-array-map', `array-map', `array-for-each', and
  4558. `array-index-map!'.
  4559. ** The new functions `trace' and `untrace' implement simple debugging
  4560. support for Scheme functions.
  4561. The `trace' function accepts any number of procedures as arguments,
  4562. and tells the Guile interpreter to display each procedure's name and
  4563. arguments each time the procedure is invoked. When invoked with no
  4564. arguments, `trace' returns the list of procedures currently being
  4565. traced.
  4566. The `untrace' function accepts any number of procedures as arguments,
  4567. and tells the Guile interpreter not to trace them any more. When
  4568. invoked with no arguments, `untrace' untraces all curretly traced
  4569. procedures.
  4570. The tracing in Guile has an advantage over most other systems: we
  4571. don't create new procedure objects, but mark the procedure objects
  4572. themselves. This means that anonymous and internal procedures can be
  4573. traced.
  4574. ** The function `assert-repl-prompt' has been renamed to
  4575. `set-repl-prompt!'. It takes one argument, PROMPT.
  4576. - If PROMPT is #f, the Guile read-eval-print loop will not prompt.
  4577. - If PROMPT is a string, we use it as a prompt.
  4578. - If PROMPT is a procedure accepting no arguments, we call it, and
  4579. display the result as a prompt.
  4580. - Otherwise, we display "> ".
  4581. ** The new function `eval-string' reads Scheme expressions from a
  4582. string and evaluates them, returning the value of the last expression
  4583. in the string. If the string contains no expressions, it returns an
  4584. unspecified value.
  4585. ** The new function `thunk?' returns true iff its argument is a
  4586. procedure of zero arguments.
  4587. ** `defined?' is now a builtin function, instead of syntax. This
  4588. means that its argument should be quoted. It returns #t iff its
  4589. argument is bound in the current module.
  4590. ** The new syntax `use-modules' allows you to add new modules to your
  4591. environment without re-typing a complete `define-module' form. It
  4592. accepts any number of module names as arguments, and imports their
  4593. public bindings into the current module.
  4594. ** The new function (module-defined? NAME MODULE) returns true iff
  4595. NAME, a symbol, is defined in MODULE, a module object.
  4596. ** The new function `builtin-bindings' creates and returns a hash
  4597. table containing copies of all the root module's bindings.
  4598. ** The new function `builtin-weak-bindings' does the same as
  4599. `builtin-bindings', but creates a doubly-weak hash table.
  4600. ** The `equal?' function now considers variable objects to be
  4601. equivalent if they have the same name and the same value.
  4602. ** The new function `command-line' returns the command-line arguments
  4603. given to Guile, as a list of strings.
  4604. When using guile as a script interpreter, `command-line' returns the
  4605. script's arguments; those processed by the interpreter (like `-s' or
  4606. `-c') are omitted. (In other words, you get the normal, expected
  4607. behavior.) Any application that uses scm_shell to process its
  4608. command-line arguments gets this behavior as well.
  4609. ** The new function `load-user-init' looks for a file called `.guile'
  4610. in the user's home directory, and loads it if it exists. This is
  4611. mostly for use by the code generated by scm_compile_shell_switches,
  4612. but we thought it might also be useful in other circumstances.
  4613. ** The new function `log10' returns the base-10 logarithm of its
  4614. argument.
  4615. ** Changes to I/O functions
  4616. *** The functions `read', `primitive-load', `read-and-eval!', and
  4617. `primitive-load-path' no longer take optional arguments controlling
  4618. case insensitivity and a `#' parser.
  4619. Case sensitivity is now controlled by a read option called
  4620. `case-insensitive'. The user can add new `#' syntaxes with the
  4621. `read-hash-extend' function (see below).
  4622. *** The new function `read-hash-extend' allows the user to change the
  4623. syntax of Guile Scheme in a somewhat controlled way.
  4624. (read-hash-extend CHAR PROC)
  4625. When parsing S-expressions, if we read a `#' character followed by
  4626. the character CHAR, use PROC to parse an object from the stream.
  4627. If PROC is #f, remove any parsing procedure registered for CHAR.
  4628. The reader applies PROC to two arguments: CHAR and an input port.
  4629. *** The new functions read-delimited and read-delimited! provide a
  4630. general mechanism for doing delimited input on streams.
  4631. (read-delimited DELIMS [PORT HANDLE-DELIM])
  4632. Read until we encounter one of the characters in DELIMS (a string),
  4633. or end-of-file. PORT is the input port to read from; it defaults to
  4634. the current input port. The HANDLE-DELIM parameter determines how
  4635. the terminating character is handled; it should be one of the
  4636. following symbols:
  4637. 'trim omit delimiter from result
  4638. 'peek leave delimiter character in input stream
  4639. 'concat append delimiter character to returned value
  4640. 'split return a pair: (RESULT . TERMINATOR)
  4641. HANDLE-DELIM defaults to 'peek.
  4642. (read-delimited! DELIMS BUF [PORT HANDLE-DELIM START END])
  4643. A side-effecting variant of `read-delimited'.
  4644. The data is written into the string BUF at the indices in the
  4645. half-open interval [START, END); the default interval is the whole
  4646. string: START = 0 and END = (string-length BUF). The values of
  4647. START and END must specify a well-defined interval in BUF, i.e.
  4648. 0 <= START <= END <= (string-length BUF).
  4649. It returns NBYTES, the number of bytes read. If the buffer filled
  4650. up without a delimiter character being found, it returns #f. If the
  4651. port is at EOF when the read starts, it returns the EOF object.
  4652. If an integer is returned (i.e., the read is successfully terminated
  4653. by reading a delimiter character), then the HANDLE-DELIM parameter
  4654. determines how to handle the terminating character. It is described
  4655. above, and defaults to 'peek.
  4656. (The descriptions of these functions were borrowed from the SCSH
  4657. manual, by Olin Shivers and Brian Carlstrom.)
  4658. *** The `%read-delimited!' function is the primitive used to implement
  4659. `read-delimited' and `read-delimited!'.
  4660. (%read-delimited! DELIMS BUF GOBBLE? [PORT START END])
  4661. This returns a pair of values: (TERMINATOR . NUM-READ).
  4662. - TERMINATOR describes why the read was terminated. If it is a
  4663. character or the eof object, then that is the value that terminated
  4664. the read. If it is #f, the function filled the buffer without finding
  4665. a delimiting character.
  4666. - NUM-READ is the number of characters read into BUF.
  4667. If the read is successfully terminated by reading a delimiter
  4668. character, then the gobble? parameter determines what to do with the
  4669. terminating character. If true, the character is removed from the
  4670. input stream; if false, the character is left in the input stream
  4671. where a subsequent read operation will retrieve it. In either case,
  4672. the character is also the first value returned by the procedure call.
  4673. (The descriptions of this function was borrowed from the SCSH manual,
  4674. by Olin Shivers and Brian Carlstrom.)
  4675. *** The `read-line' and `read-line!' functions have changed; they now
  4676. trim the terminator by default; previously they appended it to the
  4677. returned string. For the old behavior, use (read-line PORT 'concat).
  4678. *** The functions `uniform-array-read!' and `uniform-array-write!' now
  4679. take new optional START and END arguments, specifying the region of
  4680. the array to read and write.
  4681. *** The `ungetc-char-ready?' function has been removed. We feel it's
  4682. inappropriate for an interface to expose implementation details this
  4683. way.
  4684. ** Changes to the Unix library and system call interface
  4685. *** The new fcntl function provides access to the Unix `fcntl' system
  4686. call.
  4687. (fcntl PORT COMMAND VALUE)
  4688. Apply COMMAND to PORT's file descriptor, with VALUE as an argument.
  4689. Values for COMMAND are:
  4690. F_DUPFD duplicate a file descriptor
  4691. F_GETFD read the descriptor's close-on-exec flag
  4692. F_SETFD set the descriptor's close-on-exec flag to VALUE
  4693. F_GETFL read the descriptor's flags, as set on open
  4694. F_SETFL set the descriptor's flags, as set on open to VALUE
  4695. F_GETOWN return the process ID of a socket's owner, for SIGIO
  4696. F_SETOWN set the process that owns a socket to VALUE, for SIGIO
  4697. FD_CLOEXEC not sure what this is
  4698. For details, see the documentation for the fcntl system call.
  4699. *** The arguments to `select' have changed, for compatibility with
  4700. SCSH. The TIMEOUT parameter may now be non-integral, yielding the
  4701. expected behavior. The MILLISECONDS parameter has been changed to
  4702. MICROSECONDS, to more closely resemble the underlying system call.
  4703. The RVEC, WVEC, and EVEC arguments can now be vectors; the type of the
  4704. corresponding return set will be the same.
  4705. *** The arguments to the `mknod' system call have changed. They are
  4706. now:
  4707. (mknod PATH TYPE PERMS DEV)
  4708. Create a new file (`node') in the file system. PATH is the name of
  4709. the file to create. TYPE is the kind of file to create; it should
  4710. be 'fifo, 'block-special, or 'char-special. PERMS specifies the
  4711. permission bits to give the newly created file. If TYPE is
  4712. 'block-special or 'char-special, DEV specifies which device the
  4713. special file refers to; its interpretation depends on the kind of
  4714. special file being created.
  4715. *** The `fork' function has been renamed to `primitive-fork', to avoid
  4716. clashing with various SCSH forks.
  4717. *** The `recv' and `recvfrom' functions have been renamed to `recv!'
  4718. and `recvfrom!'. They no longer accept a size for a second argument;
  4719. you must pass a string to hold the received value. They no longer
  4720. return the buffer. Instead, `recv' returns the length of the message
  4721. received, and `recvfrom' returns a pair containing the packet's length
  4722. and originating address.
  4723. *** The file descriptor datatype has been removed, as have the
  4724. `read-fd', `write-fd', `close', `lseek', and `dup' functions.
  4725. We plan to replace these functions with a SCSH-compatible interface.
  4726. *** The `create' function has been removed; it's just a special case
  4727. of `open'.
  4728. *** There are new functions to break down process termination status
  4729. values. In the descriptions below, STATUS is a value returned by
  4730. `waitpid'.
  4731. (status:exit-val STATUS)
  4732. If the child process exited normally, this function returns the exit
  4733. code for the child process (i.e., the value passed to exit, or
  4734. returned from main). If the child process did not exit normally,
  4735. this function returns #f.
  4736. (status:stop-sig STATUS)
  4737. If the child process was suspended by a signal, this function
  4738. returns the signal that suspended the child. Otherwise, it returns
  4739. #f.
  4740. (status:term-sig STATUS)
  4741. If the child process terminated abnormally, this function returns
  4742. the signal that terminated the child. Otherwise, this function
  4743. returns false.
  4744. POSIX promises that exactly one of these functions will return true on
  4745. a valid STATUS value.
  4746. These functions are compatible with SCSH.
  4747. *** There are new accessors and setters for the broken-out time vectors
  4748. returned by `localtime', `gmtime', and that ilk. They are:
  4749. Component Accessor Setter
  4750. ========================= ============ ============
  4751. seconds tm:sec set-tm:sec
  4752. minutes tm:min set-tm:min
  4753. hours tm:hour set-tm:hour
  4754. day of the month tm:mday set-tm:mday
  4755. month tm:mon set-tm:mon
  4756. year tm:year set-tm:year
  4757. day of the week tm:wday set-tm:wday
  4758. day in the year tm:yday set-tm:yday
  4759. daylight saving time tm:isdst set-tm:isdst
  4760. GMT offset, seconds tm:gmtoff set-tm:gmtoff
  4761. name of time zone tm:zone set-tm:zone
  4762. *** There are new accessors for the vectors returned by `uname',
  4763. describing the host system:
  4764. Component Accessor
  4765. ============================================== ================
  4766. name of the operating system implementation utsname:sysname
  4767. network name of this machine utsname:nodename
  4768. release level of the operating system utsname:release
  4769. version level of the operating system utsname:version
  4770. machine hardware platform utsname:machine
  4771. *** There are new accessors for the vectors returned by `getpw',
  4772. `getpwnam', `getpwuid', and `getpwent', describing entries from the
  4773. system's user database:
  4774. Component Accessor
  4775. ====================== =================
  4776. user name passwd:name
  4777. user password passwd:passwd
  4778. user id passwd:uid
  4779. group id passwd:gid
  4780. real name passwd:gecos
  4781. home directory passwd:dir
  4782. shell program passwd:shell
  4783. *** There are new accessors for the vectors returned by `getgr',
  4784. `getgrnam', `getgrgid', and `getgrent', describing entries from the
  4785. system's group database:
  4786. Component Accessor
  4787. ======================= ============
  4788. group name group:name
  4789. group password group:passwd
  4790. group id group:gid
  4791. group members group:mem
  4792. *** There are new accessors for the vectors returned by `gethost',
  4793. `gethostbyaddr', `gethostbyname', and `gethostent', describing
  4794. internet hosts:
  4795. Component Accessor
  4796. ========================= ===============
  4797. official name of host hostent:name
  4798. alias list hostent:aliases
  4799. host address type hostent:addrtype
  4800. length of address hostent:length
  4801. list of addresses hostent:addr-list
  4802. *** There are new accessors for the vectors returned by `getnet',
  4803. `getnetbyaddr', `getnetbyname', and `getnetent', describing internet
  4804. networks:
  4805. Component Accessor
  4806. ========================= ===============
  4807. official name of net netent:name
  4808. alias list netent:aliases
  4809. net number type netent:addrtype
  4810. net number netent:net
  4811. *** There are new accessors for the vectors returned by `getproto',
  4812. `getprotobyname', `getprotobynumber', and `getprotoent', describing
  4813. internet protocols:
  4814. Component Accessor
  4815. ========================= ===============
  4816. official protocol name protoent:name
  4817. alias list protoent:aliases
  4818. protocol number protoent:proto
  4819. *** There are new accessors for the vectors returned by `getserv',
  4820. `getservbyname', `getservbyport', and `getservent', describing
  4821. internet protocols:
  4822. Component Accessor
  4823. ========================= ===============
  4824. official service name servent:name
  4825. alias list servent:aliases
  4826. port number servent:port
  4827. protocol to use servent:proto
  4828. *** There are new accessors for the sockaddr structures returned by
  4829. `accept', `getsockname', `getpeername', `recvfrom!':
  4830. Component Accessor
  4831. ======================================== ===============
  4832. address format (`family') sockaddr:fam
  4833. path, for file domain addresses sockaddr:path
  4834. address, for internet domain addresses sockaddr:addr
  4835. TCP or UDP port, for internet sockaddr:port
  4836. *** The `getpwent', `getgrent', `gethostent', `getnetent',
  4837. `getprotoent', and `getservent' functions now return #f at the end of
  4838. the user database. (They used to throw an exception.)
  4839. Note that calling MUMBLEent function is equivalent to calling the
  4840. corresponding MUMBLE function with no arguments.
  4841. *** The `setpwent', `setgrent', `sethostent', `setnetent',
  4842. `setprotoent', and `setservent' routines now take no arguments.
  4843. *** The `gethost', `getproto', `getnet', and `getserv' functions now
  4844. provide more useful information when they throw an exception.
  4845. *** The `lnaof' function has been renamed to `inet-lnaof'.
  4846. *** Guile now claims to have the `current-time' feature.
  4847. *** The `mktime' function now takes an optional second argument ZONE,
  4848. giving the time zone to use for the conversion. ZONE should be a
  4849. string, in the same format as expected for the "TZ" environment variable.
  4850. *** The `strptime' function now returns a pair (TIME . COUNT), where
  4851. TIME is the parsed time as a vector, and COUNT is the number of
  4852. characters from the string left unparsed. This function used to
  4853. return the remaining characters as a string.
  4854. *** The `gettimeofday' function has replaced the old `time+ticks' function.
  4855. The return value is now (SECONDS . MICROSECONDS); the fractional
  4856. component is no longer expressed in "ticks".
  4857. *** The `ticks/sec' constant has been removed, in light of the above change.
  4858. * Changes to the gh_ interface
  4859. ** gh_eval_str() now returns an SCM object which is the result of the
  4860. evaluation
  4861. ** gh_scm2str() now copies the Scheme data to a caller-provided C
  4862. array
  4863. ** gh_scm2newstr() now makes a C array, copies the Scheme data to it,
  4864. and returns the array
  4865. ** gh_scm2str0() is gone: there is no need to distinguish
  4866. null-terminated from non-null-terminated, since gh_scm2newstr() allows
  4867. the user to interpret the data both ways.
  4868. * Changes to the scm_ interface
  4869. ** The new function scm_symbol_value0 provides an easy way to get a
  4870. symbol's value from C code:
  4871. SCM scm_symbol_value0 (char *NAME)
  4872. Return the value of the symbol named by the null-terminated string
  4873. NAME in the current module. If the symbol named NAME is unbound in
  4874. the current module, return SCM_UNDEFINED.
  4875. ** The new function scm_sysintern0 creates new top-level variables,
  4876. without assigning them a value.
  4877. SCM scm_sysintern0 (char *NAME)
  4878. Create a new Scheme top-level variable named NAME. NAME is a
  4879. null-terminated string. Return the variable's value cell.
  4880. ** The function scm_internal_catch is the guts of catch. It handles
  4881. all the mechanics of setting up a catch target, invoking the catch
  4882. body, and perhaps invoking the handler if the body does a throw.
  4883. The function is designed to be usable from C code, but is general
  4884. enough to implement all the semantics Guile Scheme expects from throw.
  4885. TAG is the catch tag. Typically, this is a symbol, but this function
  4886. doesn't actually care about that.
  4887. BODY is a pointer to a C function which runs the body of the catch;
  4888. this is the code you can throw from. We call it like this:
  4889. BODY (BODY_DATA, JMPBUF)
  4890. where:
  4891. BODY_DATA is just the BODY_DATA argument we received; we pass it
  4892. through to BODY as its first argument. The caller can make
  4893. BODY_DATA point to anything useful that BODY might need.
  4894. JMPBUF is the Scheme jmpbuf object corresponding to this catch,
  4895. which we have just created and initialized.
  4896. HANDLER is a pointer to a C function to deal with a throw to TAG,
  4897. should one occur. We call it like this:
  4898. HANDLER (HANDLER_DATA, THROWN_TAG, THROW_ARGS)
  4899. where
  4900. HANDLER_DATA is the HANDLER_DATA argument we recevied; it's the
  4901. same idea as BODY_DATA above.
  4902. THROWN_TAG is the tag that the user threw to; usually this is
  4903. TAG, but it could be something else if TAG was #t (i.e., a
  4904. catch-all), or the user threw to a jmpbuf.
  4905. THROW_ARGS is the list of arguments the user passed to the THROW
  4906. function.
  4907. BODY_DATA is just a pointer we pass through to BODY. HANDLER_DATA
  4908. is just a pointer we pass through to HANDLER. We don't actually
  4909. use either of those pointers otherwise ourselves. The idea is
  4910. that, if our caller wants to communicate something to BODY or
  4911. HANDLER, it can pass a pointer to it as MUMBLE_DATA, which BODY and
  4912. HANDLER can then use. Think of it as a way to make BODY and
  4913. HANDLER closures, not just functions; MUMBLE_DATA points to the
  4914. enclosed variables.
  4915. Of course, it's up to the caller to make sure that any data a
  4916. MUMBLE_DATA needs is protected from GC. A common way to do this is
  4917. to make MUMBLE_DATA a pointer to data stored in an automatic
  4918. structure variable; since the collector must scan the stack for
  4919. references anyway, this assures that any references in MUMBLE_DATA
  4920. will be found.
  4921. ** The new function scm_internal_lazy_catch is exactly like
  4922. scm_internal_catch, except:
  4923. - It does not unwind the stack (this is the major difference).
  4924. - If handler returns, its value is returned from the throw.
  4925. - BODY always receives #f as its JMPBUF argument (since there's no
  4926. jmpbuf associated with a lazy catch, because we don't unwind the
  4927. stack.)
  4928. ** scm_body_thunk is a new body function you can pass to
  4929. scm_internal_catch if you want the body to be like Scheme's `catch'
  4930. --- a thunk, or a function of one argument if the tag is #f.
  4931. BODY_DATA is a pointer to a scm_body_thunk_data structure, which
  4932. contains the Scheme procedure to invoke as the body, and the tag
  4933. we're catching. If the tag is #f, then we pass JMPBUF (created by
  4934. scm_internal_catch) to the body procedure; otherwise, the body gets
  4935. no arguments.
  4936. ** scm_handle_by_proc is a new handler function you can pass to
  4937. scm_internal_catch if you want the handler to act like Scheme's catch
  4938. --- call a procedure with the tag and the throw arguments.
  4939. If the user does a throw to this catch, this function runs a handler
  4940. procedure written in Scheme. HANDLER_DATA is a pointer to an SCM
  4941. variable holding the Scheme procedure object to invoke. It ought to
  4942. be a pointer to an automatic variable (i.e., one living on the stack),
  4943. or the procedure object should be otherwise protected from GC.
  4944. ** scm_handle_by_message is a new handler function to use with
  4945. `scm_internal_catch' if you want Guile to print a message and die.
  4946. It's useful for dealing with throws to uncaught keys at the top level.
  4947. HANDLER_DATA, if non-zero, is assumed to be a char * pointing to a
  4948. message header to print; if zero, we use "guile" instead. That
  4949. text is followed by a colon, then the message described by ARGS.
  4950. ** The return type of scm_boot_guile is now void; the function does
  4951. not return a value, and indeed, never returns at all.
  4952. ** The new function scm_shell makes it easy for user applications to
  4953. process command-line arguments in a way that is compatible with the
  4954. stand-alone guile interpreter (which is in turn compatible with SCSH,
  4955. the Scheme shell).
  4956. To use the scm_shell function, first initialize any guile modules
  4957. linked into your application, and then call scm_shell with the values
  4958. of ARGC and ARGV your `main' function received. scm_shell will add
  4959. any SCSH-style meta-arguments from the top of the script file to the
  4960. argument vector, and then process the command-line arguments. This
  4961. generally means loading a script file or starting up an interactive
  4962. command interpreter. For details, see "Changes to the stand-alone
  4963. interpreter" above.
  4964. ** The new functions scm_get_meta_args and scm_count_argv help you
  4965. implement the SCSH-style meta-argument, `\'.
  4966. char **scm_get_meta_args (int ARGC, char **ARGV)
  4967. If the second element of ARGV is a string consisting of a single
  4968. backslash character (i.e. "\\" in Scheme notation), open the file
  4969. named by the following argument, parse arguments from it, and return
  4970. the spliced command line. The returned array is terminated by a
  4971. null pointer.
  4972. For details of argument parsing, see above, under "guile now accepts
  4973. command-line arguments compatible with SCSH..."
  4974. int scm_count_argv (char **ARGV)
  4975. Count the arguments in ARGV, assuming it is terminated by a null
  4976. pointer.
  4977. For an example of how these functions might be used, see the source
  4978. code for the function scm_shell in libguile/script.c.
  4979. You will usually want to use scm_shell instead of calling this
  4980. function yourself.
  4981. ** The new function scm_compile_shell_switches turns an array of
  4982. command-line arguments into Scheme code to carry out the actions they
  4983. describe. Given ARGC and ARGV, it returns a Scheme expression to
  4984. evaluate, and calls scm_set_program_arguments to make any remaining
  4985. command-line arguments available to the Scheme code. For example,
  4986. given the following arguments:
  4987. -e main -s ekko a speckled gecko
  4988. scm_set_program_arguments will return the following expression:
  4989. (begin (load "ekko") (main (command-line)) (quit))
  4990. You will usually want to use scm_shell instead of calling this
  4991. function yourself.
  4992. ** The function scm_shell_usage prints a usage message appropriate for
  4993. an interpreter that uses scm_compile_shell_switches to handle its
  4994. command-line arguments.
  4995. void scm_shell_usage (int FATAL, char *MESSAGE)
  4996. Print a usage message to the standard error output. If MESSAGE is
  4997. non-zero, write it before the usage message, followed by a newline.
  4998. If FATAL is non-zero, exit the process, using FATAL as the
  4999. termination status. (If you want to be compatible with Guile,
  5000. always use 1 as the exit status when terminating due to command-line
  5001. usage problems.)
  5002. You will usually want to use scm_shell instead of calling this
  5003. function yourself.
  5004. ** scm_eval_0str now returns SCM_UNSPECIFIED if the string contains no
  5005. expressions. It used to return SCM_EOL. Earth-shattering.
  5006. ** The macros for declaring scheme objects in C code have been
  5007. rearranged slightly. They are now:
  5008. SCM_SYMBOL (C_NAME, SCHEME_NAME)
  5009. Declare a static SCM variable named C_NAME, and initialize it to
  5010. point to the Scheme symbol whose name is SCHEME_NAME. C_NAME should
  5011. be a C identifier, and SCHEME_NAME should be a C string.
  5012. SCM_GLOBAL_SYMBOL (C_NAME, SCHEME_NAME)
  5013. Just like SCM_SYMBOL, but make C_NAME globally visible.
  5014. SCM_VCELL (C_NAME, SCHEME_NAME)
  5015. Create a global variable at the Scheme level named SCHEME_NAME.
  5016. Declare a static SCM variable named C_NAME, and initialize it to
  5017. point to the Scheme variable's value cell.
  5018. SCM_GLOBAL_VCELL (C_NAME, SCHEME_NAME)
  5019. Just like SCM_VCELL, but make C_NAME globally visible.
  5020. The `guile-snarf' script writes initialization code for these macros
  5021. to its standard output, given C source code as input.
  5022. The SCM_GLOBAL macro is gone.
  5023. ** The scm_read_line and scm_read_line_x functions have been replaced
  5024. by Scheme code based on the %read-delimited! procedure (known to C
  5025. code as scm_read_delimited_x). See its description above for more
  5026. information.
  5027. ** The function scm_sys_open has been renamed to scm_open. It now
  5028. returns a port instead of an FD object.
  5029. * The dynamic linking support has changed. For more information, see
  5030. libguile/DYNAMIC-LINKING.
  5031. Guile 1.0b3
  5032. User-visible changes from Thursday, September 5, 1996 until Guile 1.0
  5033. (Sun 5 Jan 1997):
  5034. * Changes to the 'guile' program:
  5035. ** Guile now loads some new files when it starts up. Guile first
  5036. searches the load path for init.scm, and loads it if found. Then, if
  5037. Guile is not being used to execute a script, and the user's home
  5038. directory contains a file named `.guile', Guile loads that.
  5039. ** You can now use Guile as a shell script interpreter.
  5040. To paraphrase the SCSH manual:
  5041. When Unix tries to execute an executable file whose first two
  5042. characters are the `#!', it treats the file not as machine code to
  5043. be directly executed by the native processor, but as source code
  5044. to be executed by some interpreter. The interpreter to use is
  5045. specified immediately after the #! sequence on the first line of
  5046. the source file. The kernel reads in the name of the interpreter,
  5047. and executes that instead. It passes the interpreter the source
  5048. filename as its first argument, with the original arguments
  5049. following. Consult the Unix man page for the `exec' system call
  5050. for more information.
  5051. Now you can use Guile as an interpreter, using a mechanism which is a
  5052. compatible subset of that provided by SCSH.
  5053. Guile now recognizes a '-s' command line switch, whose argument is the
  5054. name of a file of Scheme code to load. It also treats the two
  5055. characters `#!' as the start of a comment, terminated by `!#'. Thus,
  5056. to make a file of Scheme code directly executable by Unix, insert the
  5057. following two lines at the top of the file:
  5058. #!/usr/local/bin/guile -s
  5059. !#
  5060. Guile treats the argument of the `-s' command-line switch as the name
  5061. of a file of Scheme code to load, and treats the sequence `#!' as the
  5062. start of a block comment, terminated by `!#'.
  5063. For example, here's a version of 'echo' written in Scheme:
  5064. #!/usr/local/bin/guile -s
  5065. !#
  5066. (let loop ((args (cdr (program-arguments))))
  5067. (if (pair? args)
  5068. (begin
  5069. (display (car args))
  5070. (if (pair? (cdr args))
  5071. (display " "))
  5072. (loop (cdr args)))))
  5073. (newline)
  5074. Why does `#!' start a block comment terminated by `!#', instead of the
  5075. end of the line? That is the notation SCSH uses, and although we
  5076. don't yet support the other SCSH features that motivate that choice,
  5077. we would like to be backward-compatible with any existing Guile
  5078. scripts once we do. Furthermore, if the path to Guile on your system
  5079. is too long for your kernel, you can start the script with this
  5080. horrible hack:
  5081. #!/bin/sh
  5082. exec /really/long/path/to/guile -s "$0" ${1+"$@"}
  5083. !#
  5084. Note that some very old Unix systems don't support the `#!' syntax.
  5085. ** You can now run Guile without installing it.
  5086. Previous versions of the interactive Guile interpreter (`guile')
  5087. couldn't start up unless Guile's Scheme library had been installed;
  5088. they used the value of the environment variable `SCHEME_LOAD_PATH'
  5089. later on in the startup process, but not to find the startup code
  5090. itself. Now Guile uses `SCHEME_LOAD_PATH' in all searches for Scheme
  5091. code.
  5092. To run Guile without installing it, build it in the normal way, and
  5093. then set the environment variable `SCHEME_LOAD_PATH' to a
  5094. colon-separated list of directories, including the top-level directory
  5095. of the Guile sources. For example, if you unpacked Guile so that the
  5096. full filename of this NEWS file is /home/jimb/guile-1.0b3/NEWS, then
  5097. you might say
  5098. export SCHEME_LOAD_PATH=/home/jimb/my-scheme:/home/jimb/guile-1.0b3
  5099. ** Guile's read-eval-print loop no longer prints #<unspecified>
  5100. results. If the user wants to see this, she can evaluate the
  5101. expression (assert-repl-print-unspecified #t), perhaps in her startup
  5102. file.
  5103. ** Guile no longer shows backtraces by default when an error occurs;
  5104. however, it does display a message saying how to get one, and how to
  5105. request that they be displayed by default. After an error, evaluate
  5106. (backtrace)
  5107. to see a backtrace, and
  5108. (debug-enable 'backtrace)
  5109. to see them by default.
  5110. * Changes to Guile Scheme:
  5111. ** Guile now distinguishes between #f and the empty list.
  5112. This is for compatibility with the IEEE standard, the (possibly)
  5113. upcoming Revised^5 Report on Scheme, and many extant Scheme
  5114. implementations.
  5115. Guile used to have #f and '() denote the same object, to make Scheme's
  5116. type system more compatible with Emacs Lisp's. However, the change
  5117. caused too much trouble for Scheme programmers, and we found another
  5118. way to reconcile Emacs Lisp with Scheme that didn't require this.
  5119. ** Guile's delq, delv, delete functions, and their destructive
  5120. counterparts, delq!, delv!, and delete!, now remove all matching
  5121. elements from the list, not just the first. This matches the behavior
  5122. of the corresponding Emacs Lisp functions, and (I believe) the Maclisp
  5123. functions which inspired them.
  5124. I recognize that this change may break code in subtle ways, but it
  5125. seems best to make the change before the FSF's first Guile release,
  5126. rather than after.
  5127. ** The compiled-library-path function has been deleted from libguile.
  5128. ** The facilities for loading Scheme source files have changed.
  5129. *** The variable %load-path now tells Guile which directories to search
  5130. for Scheme code. Its value is a list of strings, each of which names
  5131. a directory.
  5132. *** The variable %load-extensions now tells Guile which extensions to
  5133. try appending to a filename when searching the load path. Its value
  5134. is a list of strings. Its default value is ("" ".scm").
  5135. *** (%search-load-path FILENAME) searches the directories listed in the
  5136. value of the %load-path variable for a Scheme file named FILENAME,
  5137. with all the extensions listed in %load-extensions. If it finds a
  5138. match, then it returns its full filename. If FILENAME is absolute, it
  5139. returns it unchanged. Otherwise, it returns #f.
  5140. %search-load-path will not return matches that refer to directories.
  5141. *** (primitive-load FILENAME :optional CASE-INSENSITIVE-P SHARP)
  5142. uses %seach-load-path to find a file named FILENAME, and loads it if
  5143. it finds it. If it can't read FILENAME for any reason, it throws an
  5144. error.
  5145. The arguments CASE-INSENSITIVE-P and SHARP are interpreted as by the
  5146. `read' function.
  5147. *** load uses the same searching semantics as primitive-load.
  5148. *** The functions %try-load, try-load-with-path, %load, load-with-path,
  5149. basic-try-load-with-path, basic-load-with-path, try-load-module-with-
  5150. path, and load-module-with-path have been deleted. The functions
  5151. above should serve their purposes.
  5152. *** If the value of the variable %load-hook is a procedure,
  5153. `primitive-load' applies its value to the name of the file being
  5154. loaded (without the load path directory name prepended). If its value
  5155. is #f, it is ignored. Otherwise, an error occurs.
  5156. This is mostly useful for printing load notification messages.
  5157. ** The function `eval!' is no longer accessible from the scheme level.
  5158. We can't allow operations which introduce glocs into the scheme level,
  5159. because Guile's type system can't handle these as data. Use `eval' or
  5160. `read-and-eval!' (see below) as replacement.
  5161. ** The new function read-and-eval! reads an expression from PORT,
  5162. evaluates it, and returns the result. This is more efficient than
  5163. simply calling `read' and `eval', since it is not necessary to make a
  5164. copy of the expression for the evaluator to munge.
  5165. Its optional arguments CASE_INSENSITIVE_P and SHARP are interpreted as
  5166. for the `read' function.
  5167. ** The function `int?' has been removed; its definition was identical
  5168. to that of `integer?'.
  5169. ** The functions `<?', `<?', `<=?', `=?', `>?', and `>=?'. Code should
  5170. use the R4RS names for these functions.
  5171. ** The function object-properties no longer returns the hash handle;
  5172. it simply returns the object's property list.
  5173. ** Many functions have been changed to throw errors, instead of
  5174. returning #f on failure. The point of providing exception handling in
  5175. the language is to simplify the logic of user code, but this is less
  5176. useful if Guile's primitives don't throw exceptions.
  5177. ** The function `fileno' has been renamed from `%fileno'.
  5178. ** The function primitive-mode->fdes returns #t or #f now, not 1 or 0.
  5179. * Changes to Guile's C interface:
  5180. ** The library's initialization procedure has been simplified.
  5181. scm_boot_guile now has the prototype:
  5182. void scm_boot_guile (int ARGC,
  5183. char **ARGV,
  5184. void (*main_func) (),
  5185. void *closure);
  5186. scm_boot_guile calls MAIN_FUNC, passing it CLOSURE, ARGC, and ARGV.
  5187. MAIN_FUNC should do all the work of the program (initializing other
  5188. packages, reading user input, etc.) before returning. When MAIN_FUNC
  5189. returns, call exit (0); this function never returns. If you want some
  5190. other exit value, MAIN_FUNC may call exit itself.
  5191. scm_boot_guile arranges for program-arguments to return the strings
  5192. given by ARGC and ARGV. If MAIN_FUNC modifies ARGC/ARGV, should call
  5193. scm_set_program_arguments with the final list, so Scheme code will
  5194. know which arguments have been processed.
  5195. scm_boot_guile establishes a catch-all catch handler which prints an
  5196. error message and exits the process. This means that Guile exits in a
  5197. coherent way when system errors occur and the user isn't prepared to
  5198. handle it. If the user doesn't like this behavior, they can establish
  5199. their own universal catcher in MAIN_FUNC to shadow this one.
  5200. Why must the caller do all the real work from MAIN_FUNC? The garbage
  5201. collector assumes that all local variables of type SCM will be above
  5202. scm_boot_guile's stack frame on the stack. If you try to manipulate
  5203. SCM values after this function returns, it's the luck of the draw
  5204. whether the GC will be able to find the objects you allocate. So,
  5205. scm_boot_guile function exits, rather than returning, to discourage
  5206. people from making that mistake.
  5207. The IN, OUT, and ERR arguments were removed; there are other
  5208. convenient ways to override these when desired.
  5209. The RESULT argument was deleted; this function should never return.
  5210. The BOOT_CMD argument was deleted; the MAIN_FUNC argument is more
  5211. general.
  5212. ** Guile's header files should no longer conflict with your system's
  5213. header files.
  5214. In order to compile code which #included <libguile.h>, previous
  5215. versions of Guile required you to add a directory containing all the
  5216. Guile header files to your #include path. This was a problem, since
  5217. Guile's header files have names which conflict with many systems'
  5218. header files.
  5219. Now only <libguile.h> need appear in your #include path; you must
  5220. refer to all Guile's other header files as <libguile/mumble.h>.
  5221. Guile's installation procedure puts libguile.h in $(includedir), and
  5222. the rest in $(includedir)/libguile.
  5223. ** Two new C functions, scm_protect_object and scm_unprotect_object,
  5224. have been added to the Guile library.
  5225. scm_protect_object (OBJ) protects OBJ from the garbage collector.
  5226. OBJ will not be freed, even if all other references are dropped,
  5227. until someone does scm_unprotect_object (OBJ). Both functions
  5228. return OBJ.
  5229. Note that calls to scm_protect_object do not nest. You can call
  5230. scm_protect_object any number of times on a given object, and the
  5231. next call to scm_unprotect_object will unprotect it completely.
  5232. Basically, scm_protect_object and scm_unprotect_object just
  5233. maintain a list of references to things. Since the GC knows about
  5234. this list, all objects it mentions stay alive. scm_protect_object
  5235. adds its argument to the list; scm_unprotect_object remove its
  5236. argument from the list.
  5237. ** scm_eval_0str now returns the value of the last expression
  5238. evaluated.
  5239. ** The new function scm_read_0str reads an s-expression from a
  5240. null-terminated string, and returns it.
  5241. ** The new function `scm_stdio_to_port' converts a STDIO file pointer
  5242. to a Scheme port object.
  5243. ** The new function `scm_set_program_arguments' allows C code to set
  5244. the value returned by the Scheme `program-arguments' function.
  5245. Older changes:
  5246. * Guile no longer includes sophisticated Tcl/Tk support.
  5247. The old Tcl/Tk support was unsatisfying to us, because it required the
  5248. user to link against the Tcl library, as well as Tk and Guile. The
  5249. interface was also un-lispy, in that it preserved Tcl/Tk's practice of
  5250. referring to widgets by names, rather than exporting widgets to Scheme
  5251. code as a special datatype.
  5252. In the Usenix Tk Developer's Workshop held in July 1996, the Tcl/Tk
  5253. maintainers described some very interesting changes in progress to the
  5254. Tcl/Tk internals, which would facilitate clean interfaces between lone
  5255. Tk and other interpreters --- even for garbage-collected languages
  5256. like Scheme. They expected the new Tk to be publicly available in the
  5257. fall of 1996.
  5258. Since it seems that Guile might soon have a new, cleaner interface to
  5259. lone Tk, and that the old Guile/Tk glue code would probably need to be
  5260. completely rewritten, we (Jim Blandy and Richard Stallman) have
  5261. decided not to support the old code. We'll spend the time instead on
  5262. a good interface to the newer Tk, as soon as it is available.
  5263. Until then, gtcltk-lib provides trivial, low-maintenance functionality.
  5264. Copyright information:
  5265. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2006 Free Software Foundation, Inc.
  5266. Permission is granted to anyone to make or distribute verbatim copies
  5267. of this document as received, in any medium, provided that the
  5268. copyright notice and this permission notice are preserved,
  5269. thus giving the recipient permission to redistribute in turn.
  5270. Permission is granted to distribute modified versions
  5271. of this document, or of portions of it,
  5272. under the above conditions, provided also that they
  5273. carry prominent notices stating who last changed them.
  5274. Local variables:
  5275. mode: outline
  5276. paragraph-separate: "[ ]*$"
  5277. end: