NEWS 334 KB

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