NEWS 292 KB

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