guile.scm 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376
  1. ;;; Copyright (C) 2024 Igalia, S.L.
  2. ;;; Copyright (C) 2024 David Thompson <dave@spritely.institute>
  3. ;;;
  4. ;;; Licensed under the Apache License, Version 2.0 (the "License");
  5. ;;; you may not use this file except in compliance with the License.
  6. ;;; You may obtain a copy of the License at
  7. ;;;
  8. ;;; http://www.apache.org/licenses/LICENSE-2.0
  9. ;;;
  10. ;;; Unless required by applicable law or agreed to in writing, software
  11. ;;; distributed under the License is distributed on an "AS IS" BASIS,
  12. ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. ;;; See the License for the specific language governing permissions and
  14. ;;; limitations under the License.
  15. ;;; Commentary:
  16. ;;;
  17. ;;; Shim to implement Guile API on top of Hoot.
  18. ;;;
  19. ;;; Code:
  20. ;; bindings not supported:
  21. #;
  22. (define *unimplemented-bindings
  23. '($sc-dispatch
  24. %auto-compilation-options
  25. %char-set-dump
  26. %compile-fallback-path
  27. %cond-expand-features
  28. %cond-expand-table
  29. %default-port-conversion-strategy
  30. %default-port-encoding
  31. %expanded-vtables
  32. %file-port-name-canonicalization
  33. %fresh-auto-compile
  34. %get-pre-modules-obarray
  35. %get-stack-size
  36. %global-site-dir
  37. %guile-build-info
  38. %host-type
  39. %init-rdelim-builtins
  40. %init-rw-builtins
  41. %library-dir
  42. %load-announce
  43. %load-compiled-extensions
  44. %load-compiled-path
  45. %load-extensions
  46. %load-hook
  47. %load-path
  48. %load-should-auto-compile
  49. %load-verbosely
  50. %package-data-dir
  51. %port-property
  52. %print-module
  53. %read-hash-procedures
  54. %resolve-variable
  55. %search-load-path
  56. %set-port-property!
  57. %site-ccache-dir
  58. %site-dir
  59. %stacks
  60. %start-stack
  61. %string-dump
  62. %symbol-dump
  63. %warn-auto-compilation-enabled
  64. &exception-with-kind-and-args
  65. &programming-error
  66. &quit-exception
  67. *features*
  68. *null-device*
  69. *random-state*
  70. *repl-stack*
  71. ->char-set
  72. <applicable-struct-vtable>
  73. <applicable-struct-with-setter-vtable>
  74. <parameter>
  75. <standard-vtable>
  76. @
  77. @@
  78. AF_INET
  79. AF_INET6
  80. AF_UNIX
  81. AF_UNSPEC
  82. AI_ADDRCONFIG
  83. AI_ALL
  84. AI_CANONNAME
  85. AI_NUMERICHOST
  86. AI_NUMERICSERV
  87. AI_PASSIVE
  88. AI_V4MAPPED
  89. AT_EACCESS
  90. AT_EMPTY_PATH
  91. AT_NO_AUTOMOUNT
  92. AT_REMOVEDIR
  93. AT_SYMLINK_FOLLOW
  94. AT_SYMLINK_NOFOLLOW
  95. E2BIG
  96. EACCES
  97. EADDRINUSE
  98. EADDRNOTAVAIL
  99. EADV
  100. EAFNOSUPPORT
  101. EAGAIN
  102. EAI_ADDRFAMILY
  103. EAI_AGAIN
  104. EAI_ALLDONE
  105. EAI_BADFLAGS
  106. EAI_CANCELED
  107. EAI_FAIL
  108. EAI_FAMILY
  109. EAI_IDN_ENCODE
  110. EAI_INPROGRESS
  111. EAI_INTR
  112. EAI_MEMORY
  113. EAI_NODATA
  114. EAI_NONAME
  115. EAI_NOTCANCELED
  116. EAI_OVERFLOW
  117. EAI_SERVICE
  118. EAI_SOCKTYPE
  119. EAI_SYSTEM
  120. EALREADY
  121. EBADE
  122. EBADF
  123. EBADFD
  124. EBADMSG
  125. EBADR
  126. EBADRQC
  127. EBADSLT
  128. EBFONT
  129. EBUSY
  130. ECANCELED
  131. ECHILD
  132. ECHRNG
  133. ECOMM
  134. ECONNABORTED
  135. ECONNREFUSED
  136. ECONNRESET
  137. EDEADLK
  138. EDEADLOCK
  139. EDESTADDRREQ
  140. EDOM
  141. EDOTDOT
  142. EDQUOT
  143. EEXIST
  144. EFAULT
  145. EFBIG
  146. EHOSTDOWN
  147. EHOSTUNREACH
  148. EHWPOISON
  149. EIDRM
  150. EILSEQ
  151. EINPROGRESS
  152. EINTR
  153. EINVAL
  154. EIO
  155. EISCONN
  156. EISDIR
  157. EISNAM
  158. EKEYEXPIRED
  159. EKEYREJECTED
  160. EKEYREVOKED
  161. EL2HLT
  162. EL2NSYNC
  163. EL3HLT
  164. EL3RST
  165. ELIBACC
  166. ELIBBAD
  167. ELIBEXEC
  168. ELIBMAX
  169. ELIBSCN
  170. ELNRNG
  171. ELOOP
  172. EMEDIUMTYPE
  173. EMFILE
  174. EMLINK
  175. EMSGSIZE
  176. EMULTIHOP
  177. ENAMETOOLONG
  178. ENAVAIL
  179. ENETDOWN
  180. ENETRESET
  181. ENETUNREACH
  182. ENFILE
  183. ENOANO
  184. ENOBUFS
  185. ENOCSI
  186. ENODATA
  187. ENODEV
  188. ENOENT
  189. ENOEXEC
  190. ENOKEY
  191. ENOLCK
  192. ENOLINK
  193. ENOMEDIUM
  194. ENOMEM
  195. ENOMSG
  196. ENONET
  197. ENOPKG
  198. ENOPROTOOPT
  199. ENOSPC
  200. ENOSR
  201. ENOSTR
  202. ENOSYS
  203. ENOTBLK
  204. ENOTCONN
  205. ENOTDIR
  206. ENOTEMPTY
  207. ENOTNAM
  208. ENOTRECOVERABLE
  209. ENOTSOCK
  210. ENOTSUP
  211. ENOTTY
  212. ENOTUNIQ
  213. ENXIO
  214. EOPNOTSUPP
  215. EOVERFLOW
  216. EOWNERDEAD
  217. EPERM
  218. EPFNOSUPPORT
  219. EPIPE
  220. EPROTO
  221. EPROTONOSUPPORT
  222. EPROTOTYPE
  223. ERANGE
  224. EREMCHG
  225. EREMOTE
  226. EREMOTEIO
  227. ERESTART
  228. ERFKILL
  229. EROFS
  230. ESHUTDOWN
  231. ESOCKTNOSUPPORT
  232. ESPIPE
  233. ESRCH
  234. ESRMNT
  235. ESTALE
  236. ESTRPIPE
  237. ETIME
  238. ETIMEDOUT
  239. ETOOMANYREFS
  240. ETXTBSY
  241. EUCLEAN
  242. EUNATCH
  243. EUSERS
  244. EWOULDBLOCK
  245. EXDEV
  246. EXFULL
  247. EXIT_FAILURE
  248. EXIT_SUCCESS
  249. FD_CLOEXEC
  250. F_DUPFD
  251. F_GETFD
  252. F_GETFL
  253. F_GETOWN
  254. F_OK
  255. F_SETFD
  256. F_SETFL
  257. F_SETOWN
  258. IN6ADDR_ANY
  259. IN6ADDR_LOOPBACK
  260. INADDR_ANY
  261. INADDR_BROADCAST
  262. INADDR_LOOPBACK
  263. INADDR_NONE
  264. IPPROTO_IP
  265. IPPROTO_IPV6
  266. IPPROTO_TCP
  267. IPPROTO_UDP
  268. IPV6_V6ONLY
  269. IP_ADD_MEMBERSHIP
  270. IP_DROP_MEMBERSHIP
  271. IP_MULTICAST_IF
  272. IP_MULTICAST_TTL
  273. ITIMER_PROF
  274. ITIMER_REAL
  275. ITIMER_VIRTUAL
  276. LC_ADDRESS
  277. LC_ALL
  278. LC_COLLATE
  279. LC_CTYPE
  280. LC_IDENTIFICATION
  281. LC_MEASUREMENT
  282. LC_MESSAGES
  283. LC_MONETARY
  284. LC_NAME
  285. LC_NUMERIC
  286. LC_PAPER
  287. LC_TELEPHONE
  288. LC_TIME
  289. LOCK_EX
  290. LOCK_NB
  291. LOCK_SH
  292. LOCK_UN
  293. MSG_DONTROUTE
  294. MSG_DONTWAIT
  295. MSG_OOB
  296. MSG_PEEK
  297. NSIG
  298. OPEN_BOTH
  299. OPEN_READ
  300. OPEN_WRITE
  301. O_APPEND
  302. O_ASYNC
  303. O_CLOEXEC
  304. O_CREAT
  305. O_DIRECT
  306. O_DIRECTORY
  307. O_EXCL
  308. O_IGNORE_CTTY
  309. O_LARGEFILE
  310. O_NDELAY
  311. O_NOATIME
  312. O_NOCTTY
  313. O_NOFOLLOW
  314. O_NOLINK
  315. O_NONBLOCK
  316. O_NOTRANS
  317. O_PATH
  318. O_RDONLY
  319. O_RDWR
  320. O_SYNC
  321. O_TMPFILE
  322. O_TRUNC
  323. O_WRONLY
  324. PF_INET
  325. PF_INET6
  326. PF_UNIX
  327. PF_UNSPEC
  328. PIPE_BUF
  329. PRIO_PGRP
  330. PRIO_PROCESS
  331. PRIO_USER
  332. R_OK
  333. SA_NOCLDSTOP
  334. SA_RESTART
  335. SEEK_CUR
  336. SEEK_DATA
  337. SEEK_END
  338. SEEK_HOLE
  339. SEEK_SET
  340. SIGABRT
  341. SIGALRM
  342. SIGBUS
  343. SIGCHLD
  344. SIGCLD
  345. SIGCONT
  346. SIGFPE
  347. SIGHUP
  348. SIGILL
  349. SIGINT
  350. SIGIO
  351. SIGIOT
  352. SIGKILL
  353. SIGPIPE
  354. SIGPOLL
  355. SIGPROF
  356. SIGPWR
  357. SIGQUIT
  358. SIGRTMAX
  359. SIGRTMIN
  360. SIGSEGV
  361. SIGSTKFLT
  362. SIGSTKSZ
  363. SIGSTOP
  364. SIGSYS
  365. SIGTERM
  366. SIGTRAP
  367. SIGTSTP
  368. SIGTTIN
  369. SIGTTOU
  370. SIGURG
  371. SIGUSR1
  372. SIGUSR2
  373. SIGVTALRM
  374. SIGWINCH
  375. SIGXCPU
  376. SIGXFSZ
  377. SIG_DFL
  378. SIG_IGN
  379. SOCK_CLOEXEC
  380. SOCK_DGRAM
  381. SOCK_NONBLOCK
  382. SOCK_RAW
  383. SOCK_RDM
  384. SOCK_SEQPACKET
  385. SOCK_STREAM
  386. SOL_SOCKET
  387. SO_BROADCAST
  388. SO_DEBUG
  389. SO_DONTROUTE
  390. SO_ERROR
  391. SO_KEEPALIVE
  392. SO_LINGER
  393. SO_NO_CHECK
  394. SO_OOBINLINE
  395. SO_PRIORITY
  396. SO_RCVBUF
  397. SO_RCVTIMEO
  398. SO_REUSEADDR
  399. SO_REUSEPORT
  400. SO_SNDBUF
  401. SO_SNDTIMEO
  402. SO_TYPE
  403. TCP_CORK
  404. TCP_NODELAY
  405. WAIT_ANY
  406. WAIT_MYPGRP
  407. WNOHANG
  408. WUNTRACED
  409. W_OK
  410. X_OK
  411. abort-hook
  412. abort-to-prompt*
  413. absolute-file-name?
  414. accept
  415. access?
  416. acosh
  417. add-hook!
  418. add-to-load-path
  419. addrinfo:addr
  420. addrinfo:canonname
  421. addrinfo:fam
  422. addrinfo:flags
  423. addrinfo:protocol
  424. addrinfo:socktype
  425. adjust-port-revealed!
  426. after-backtrace-hook
  427. after-error-hook
  428. after-eval-hook
  429. after-gc-hook
  430. after-print-hook
  431. after-read-hook
  432. alarm
  433. allocate-struct
  434. append!
  435. array->list
  436. array-cell-ref
  437. array-cell-set!
  438. array-contents
  439. array-copy!
  440. array-copy-in-order!
  441. array-dimensions
  442. array-equal?
  443. array-fill!
  444. array-for-each
  445. array-in-bounds?
  446. array-index-map!
  447. array-length
  448. array-map!
  449. array-map-in-order!
  450. array-rank
  451. array-ref
  452. array-set!
  453. array-shape
  454. array-slice
  455. array-slice-for-each
  456. array-slice-for-each-in-order
  457. array-type
  458. array-type-code
  459. array?
  460. asinh
  461. assert-load-verbosity
  462. assoc-remove!
  463. assoc-set!
  464. assq-remove!
  465. assq-set!
  466. assv-remove!
  467. assv-set!
  468. atanh
  469. autoload-done!
  470. autoload-done-or-in-progress?
  471. autoload-in-progress!
  472. autoloads-done
  473. autoloads-in-progress
  474. backtrace
  475. basename
  476. batch-mode?
  477. beautify-user-module!
  478. before-backtrace-hook
  479. before-error-hook
  480. before-eval-hook
  481. before-print-hook
  482. before-read-hook
  483. begin-deprecated
  484. bind
  485. bind-textdomain-codeset
  486. bindtextdomain
  487. bit-count
  488. bit-count*
  489. bit-extract
  490. bit-invert!
  491. bit-position
  492. bit-set*!
  493. bitvector->list
  494. bitvector-bit-clear?
  495. bitvector-bit-set?
  496. bitvector-clear-all-bits!
  497. bitvector-clear-bit!
  498. bitvector-clear-bits!
  499. bitvector-copy
  500. bitvector-count
  501. bitvector-count-bits
  502. bitvector-fill!
  503. bitvector-flip-all-bits!
  504. bitvector-position
  505. bitvector-set-all-bits!
  506. bitvector-set-bit!
  507. bitvector-set-bits!
  508. call-with-blocked-asyncs
  509. call-with-deferred-observers
  510. call-with-include-port
  511. call-with-module-autoload-lock
  512. call-with-unblocked-asyncs
  513. canonicalize-path
  514. catch
  515. ceiling-quotient
  516. ceiling-remainder
  517. ceiling/
  518. centered-quotient
  519. centered-remainder
  520. centered/
  521. char-general-category
  522. char-is-both?
  523. char-set
  524. char-set->list
  525. char-set->string
  526. char-set-adjoin
  527. char-set-adjoin!
  528. char-set-any
  529. char-set-complement
  530. char-set-complement!
  531. char-set-contains?
  532. char-set-copy
  533. char-set-count
  534. char-set-cursor
  535. char-set-cursor-next
  536. char-set-delete
  537. char-set-delete!
  538. char-set-diff+intersection
  539. char-set-diff+intersection!
  540. char-set-difference
  541. char-set-difference!
  542. char-set-every
  543. char-set-filter
  544. char-set-filter!
  545. char-set-fold
  546. char-set-for-each
  547. char-set-hash
  548. char-set-intersection
  549. char-set-intersection!
  550. char-set-map
  551. char-set-ref
  552. char-set-size
  553. char-set-unfold
  554. char-set-unfold!
  555. char-set-union
  556. char-set-union!
  557. char-set-xor
  558. char-set-xor!
  559. char-set:ascii
  560. char-set:blank
  561. char-set:designated
  562. char-set:digit
  563. char-set:empty
  564. char-set:full
  565. char-set:graphic
  566. char-set:hex-digit
  567. char-set:iso-control
  568. char-set:letter
  569. char-set:letter+digit
  570. char-set:lower-case
  571. char-set:printing
  572. char-set:punctuation
  573. char-set:symbol
  574. char-set:title-case
  575. char-set:upper-case
  576. char-set:whitespace
  577. char-set<=
  578. char-set=
  579. char-set?
  580. char-titlecase
  581. chdir
  582. chmod
  583. chmodat
  584. chown
  585. chown-at
  586. chroot
  587. close
  588. close-fdes
  589. closedir
  590. compose
  591. cond-expand-provide
  592. connect
  593. cons-source
  594. const
  595. convert-assignment
  596. copy-file
  597. copy-random-state
  598. cosh
  599. crypt
  600. ctermid
  601. current-filename
  602. current-language
  603. current-load-port
  604. current-module
  605. current-reader
  606. current-source-location
  607. current-warning-port
  608. datum->random-state
  609. debug-disable
  610. debug-enable
  611. debug-options
  612. debug-options-interface
  613. debug-set!
  614. default-duplicate-binding-handler
  615. default-duplicate-binding-procedures
  616. define!
  617. define-inlinable
  618. define-library
  619. define-macro
  620. define-module
  621. define-module*
  622. define-once
  623. define-option-interface
  624. define-private
  625. define-public
  626. define-syntax-parameter
  627. defined?
  628. defmacro
  629. defmacro-public
  630. delete
  631. delete!
  632. delete-file
  633. delete-file-at
  634. delete1!
  635. delv
  636. delv!
  637. delv1!
  638. directory-stream?
  639. dirname
  640. display-application
  641. display-backtrace
  642. display-error
  643. dup
  644. dup->fdes
  645. dup->inport
  646. dup->outport
  647. dup->port
  648. dup2
  649. duplicate-handlers
  650. duplicate-port
  651. dynamic-call
  652. dynamic-func
  653. dynamic-link
  654. dynamic-object?
  655. dynamic-pointer
  656. dynamic-unlink
  657. effective-version
  658. end-of-char-set?
  659. endgrent
  660. endhostent
  661. endnetent
  662. endprotoent
  663. endpwent
  664. endservent
  665. ensure-batch-mode!
  666. environ
  667. euclidean-quotient
  668. euclidean-remainder
  669. euclidean/
  670. eval
  671. eval-string
  672. eval-when
  673. exception-accessor
  674. exception-args
  675. exception-kind
  676. exception-predicate
  677. exception-type?
  678. execl
  679. execle
  680. execlp
  681. exit-hook
  682. export
  683. export!
  684. export-syntax
  685. false-if-exception
  686. fcntl
  687. fdes->inport
  688. fdes->outport
  689. fdes->ports
  690. fdopen
  691. file-encoding
  692. file-exists?
  693. file-is-directory?
  694. file-name-separator-string
  695. file-name-separator?
  696. file-port?
  697. file-position
  698. file-set-position
  699. fileno
  700. filter
  701. filter!
  702. flock
  703. fluid->parameter
  704. fluid-bound?
  705. fluid-ref*
  706. fluid-thread-local?
  707. fluid-unset!
  708. flush-all-ports
  709. frame-address
  710. frame-arguments
  711. frame-dynamic-link
  712. frame-instruction-pointer
  713. frame-previous
  714. frame-procedure-name
  715. frame-return-address
  716. frame-source
  717. frame-stack-pointer
  718. frame?
  719. fsync
  720. ftell
  721. gai-strerror
  722. gc
  723. gc-disable
  724. gc-dump
  725. gc-enable
  726. gc-run-time
  727. gc-stats
  728. gensym
  729. get-internal-real-time
  730. get-internal-run-time
  731. get-print-state
  732. getaddrinfo
  733. getaffinity
  734. getcwd
  735. getegid
  736. getenv
  737. geteuid
  738. getgid
  739. getgr
  740. getgrent
  741. getgrgid
  742. getgrnam
  743. getgroups
  744. gethost
  745. gethostbyaddr
  746. gethostbyname
  747. gethostent
  748. gethostname
  749. getitimer
  750. getlogin
  751. getnet
  752. getnetbyaddr
  753. getnetbyname
  754. getnetent
  755. getpass
  756. getpeername
  757. getpgrp
  758. getpid
  759. getppid
  760. getpriority
  761. getproto
  762. getprotobyname
  763. getprotobynumber
  764. getprotoent
  765. getpw
  766. getpwent
  767. getpwnam
  768. getpwuid
  769. getrlimit
  770. getserv
  771. getservbyname
  772. getservbyport
  773. getservent
  774. getsid
  775. getsockname
  776. getsockopt
  777. gettext
  778. gettimeofday
  779. getuid
  780. gmtime
  781. group:gid
  782. group:mem
  783. group:name
  784. group:passwd
  785. has-shown-backtrace-hint?
  786. hook->list
  787. hook-empty?
  788. hook?
  789. hostent:addr-list
  790. hostent:addrtype
  791. hostent:aliases
  792. hostent:length
  793. hostent:name
  794. identity
  795. import
  796. in-vicinity
  797. include
  798. include-ci
  799. include-deprecated-features
  800. include-library-declarations
  801. inet-lnaof
  802. inet-makeaddr
  803. inet-netof
  804. inet-ntop
  805. inet-pton
  806. inherit-print-state
  807. install-r6rs!
  808. install-r7rs!
  809. integer-expt
  810. integer-length
  811. interaction-environment
  812. internal-time-units-per-second
  813. iota
  814. isatty?
  815. issue-deprecation-warning
  816. keyword-like-symbol->keyword
  817. kill
  818. kw-arg-ref
  819. library
  820. link
  821. list->array
  822. list->bitvector
  823. list->char-set
  824. list->char-set!
  825. list->symbol
  826. list->typed-array
  827. list-cdr-ref
  828. list-cdr-set!
  829. list-head
  830. list-index
  831. listen
  832. load
  833. load-compiled
  834. load-extension
  835. load-from-path
  836. load-in-vicinity
  837. load-user-init
  838. local-define
  839. local-define-module
  840. local-ref
  841. local-ref-module
  842. local-remove
  843. local-set!
  844. localtime
  845. log10
  846. logcount
  847. lookup-duplicates-handlers
  848. lstat
  849. macro-binding
  850. macro-name
  851. macro-transformer
  852. macro-type
  853. macro?
  854. macroexpand
  855. macroexpanded?
  856. major-version
  857. make-array
  858. make-autoload-interface
  859. make-exception-type
  860. make-fresh-user-module
  861. make-generalized-vector
  862. make-guardian
  863. make-hook
  864. make-module
  865. make-modules-in
  866. make-mutable-parameter
  867. make-object-property
  868. make-procedure-with-setter
  869. make-record-type
  870. make-regexp
  871. make-shared-array
  872. make-socket-address
  873. make-soft-port
  874. make-stack
  875. make-struct-layout
  876. make-struct/no-tail
  877. make-struct/simple
  878. make-syntax-transformer
  879. make-thread-local-fluid
  880. make-typed-array
  881. make-unbound-fluid
  882. make-undefined-variable
  883. make-variable-transformer
  884. make-vtable
  885. map-in-order
  886. memoize-expression
  887. memoized-typecode
  888. merge
  889. merge!
  890. micro-version
  891. minor-version
  892. mkdir
  893. mkdirat
  894. mkdtemp
  895. mknod
  896. mkstemp
  897. mkstemp!
  898. mktime
  899. module-add!
  900. module-autoload!
  901. module-binder
  902. module-bound?
  903. module-call-observers
  904. module-clear!
  905. module-constructor
  906. module-declarative?
  907. module-defer-observers
  908. module-define!
  909. module-define-submodule!
  910. module-defined-hook
  911. module-defined?
  912. module-duplicates-handlers
  913. module-ensure-local-variable!
  914. module-export!
  915. module-export-all!
  916. module-filename
  917. module-for-each
  918. module-generate-unique-id!
  919. module-gensym
  920. module-import-interface
  921. module-import-obarray
  922. module-inlinable-exports
  923. module-kind
  924. module-local-variable
  925. module-locally-bound?
  926. module-make-local-var!
  927. module-map
  928. module-modified
  929. module-name
  930. module-next-unique-id
  931. module-obarray
  932. module-obarray-get-handle
  933. module-obarray-ref
  934. module-obarray-remove!
  935. module-obarray-set!
  936. module-observe
  937. module-observe-weak
  938. module-observers
  939. module-public-interface
  940. module-re-export!
  941. module-ref
  942. module-ref-submodule
  943. module-remove!
  944. module-replace!
  945. module-replacements
  946. module-reverse-lookup
  947. module-search
  948. module-set!
  949. module-submodule-binder
  950. module-submodules
  951. module-symbol-binding
  952. module-symbol-interned?
  953. module-symbol-local-binding
  954. module-symbol-locally-interned?
  955. module-transformer
  956. module-type
  957. module-unobserve
  958. module-use!
  959. module-use-interfaces!
  960. module-uses
  961. module-variable
  962. module-version
  963. module-weak-observers
  964. module?
  965. modulo-expt
  966. move->fdes
  967. nested-define!
  968. nested-define-module!
  969. nested-ref
  970. nested-ref-module
  971. nested-remove!
  972. nested-set!
  973. netent:addrtype
  974. netent:aliases
  975. netent:name
  976. netent:net
  977. ngettext
  978. nice
  979. nil?
  980. noop
  981. object-address
  982. object-properties
  983. object-property
  984. open
  985. open-fdes
  986. open-fdes-at
  987. open-file
  988. open-file
  989. open-io-file
  990. openat
  991. opendir
  992. parameter-converter
  993. parameter-fluid
  994. parse-path
  995. parse-path-with-ellipsis
  996. passwd:dir
  997. passwd:gecos
  998. passwd:gid
  999. passwd:name
  1000. passwd:passwd
  1001. passwd:shell
  1002. passwd:uid
  1003. pause
  1004. pipe
  1005. port->fdes
  1006. port-conversion-strategy
  1007. port-encoding
  1008. port-for-each
  1009. port-mode
  1010. port-revealed
  1011. port-with-print-state
  1012. prefab-record-types
  1013. primitive-_exit
  1014. primitive-eval
  1015. primitive-exit
  1016. primitive-fork
  1017. primitive-load
  1018. primitive-load-path
  1019. primitive-move->fdes
  1020. primitive-read
  1021. print-disable
  1022. print-enable
  1023. print-exception
  1024. print-options
  1025. print-options-interface
  1026. print-set!
  1027. procedure
  1028. procedure-documentation
  1029. procedure-minimum-arity
  1030. procedure-name
  1031. procedure-properties
  1032. procedure-property
  1033. procedure-source
  1034. procedure-with-setter?
  1035. process-use-modules
  1036. protoent:aliases
  1037. protoent:name
  1038. protoent:proto
  1039. provide
  1040. provided?
  1041. purify-module!
  1042. putenv
  1043. raise
  1044. random
  1045. random-state->datum
  1046. random-state-from-platform
  1047. random:exp
  1048. random:hollow-sphere!
  1049. random:normal
  1050. random:normal-vector!
  1051. random:solid-sphere!
  1052. random:uniform
  1053. re-export
  1054. re-export-syntax
  1055. read-disable
  1056. read-enable
  1057. read-eval?
  1058. read-hash-extend
  1059. read-hash-procedure
  1060. read-hash-procedures
  1061. read-options
  1062. read-options-interface
  1063. read-set!
  1064. read-syntax
  1065. readdir
  1066. readlink
  1067. record-accessor
  1068. record-constructor
  1069. record-modifier
  1070. record-predicate
  1071. record-type-constructor
  1072. record-type-descriptor
  1073. record-type-extensible?
  1074. record-type-fields
  1075. record-type-has-parent?
  1076. record-type-mutable-fields
  1077. record-type-name
  1078. record-type-opaque?
  1079. record-type-parent
  1080. record-type-properties
  1081. record-type-uid
  1082. record-type-vtable
  1083. record-type?
  1084. recv!
  1085. recvfrom!
  1086. redirect-port
  1087. regexp-exec
  1088. regexp/basic
  1089. regexp/extended
  1090. regexp/icase
  1091. regexp/newline
  1092. regexp/notbol
  1093. regexp/noteol
  1094. regexp?
  1095. release-port-handle
  1096. reload-module
  1097. remove-hook!
  1098. rename-file
  1099. rename-file-at
  1100. repl-reader
  1101. require-extension
  1102. reset-hook!
  1103. resolve-interface
  1104. resolve-module
  1105. resolve-r6rs-interface
  1106. restore-signals
  1107. restricted-vector-sort!
  1108. reverse!
  1109. reverse-list->string
  1110. rewinddir
  1111. rmdir
  1112. round-ash
  1113. round-quotient
  1114. round-remainder
  1115. round/
  1116. run-hook
  1117. save-module-excursion
  1118. scm-error
  1119. search-path
  1120. seed->random-state
  1121. seek
  1122. select
  1123. self-evaluating?
  1124. send
  1125. sendfile
  1126. sendto
  1127. servent:aliases
  1128. servent:name
  1129. servent:port
  1130. servent:proto
  1131. set-autoloaded!
  1132. set-current-dynamic-state
  1133. set-current-error-port
  1134. set-current-input-port
  1135. set-current-module
  1136. set-current-output-port
  1137. set-exception-printer!
  1138. set-module-binder!
  1139. set-module-declarative?!
  1140. set-module-duplicates-handlers!
  1141. set-module-filename!
  1142. set-module-inlinable-exports!
  1143. set-module-kind!
  1144. set-module-name!
  1145. set-module-next-unique-id!
  1146. set-module-obarray!
  1147. set-module-observers!
  1148. set-module-public-interface!
  1149. set-module-submodule-binder!
  1150. set-module-submodules!
  1151. set-module-transformer!
  1152. set-module-uses!
  1153. set-module-version!
  1154. set-object-properties!
  1155. set-object-property!
  1156. set-port-column!
  1157. set-port-conversion-strategy!
  1158. set-port-encoding!
  1159. set-port-encoding!
  1160. set-port-filename!
  1161. set-port-line!
  1162. set-port-revealed!
  1163. set-procedure-minimum-arity!
  1164. set-procedure-properties!
  1165. set-procedure-property!
  1166. set-program-arguments
  1167. set-source-properties!
  1168. set-source-property!
  1169. set-struct-vtable-name!
  1170. set-symbol-property!
  1171. set-tm:gmtoff
  1172. set-tm:hour
  1173. set-tm:isdst
  1174. set-tm:mday
  1175. set-tm:min
  1176. set-tm:mon
  1177. set-tm:sec
  1178. set-tm:wday
  1179. set-tm:yday
  1180. set-tm:year
  1181. set-tm:zone
  1182. setaffinity
  1183. setegid
  1184. setenv
  1185. seteuid
  1186. setgid
  1187. setgr
  1188. setgrent
  1189. setgroups
  1190. sethost
  1191. sethostent
  1192. sethostname
  1193. setitimer
  1194. setlocale
  1195. setnet
  1196. setnetent
  1197. setpgid
  1198. setpriority
  1199. setproto
  1200. setprotoent
  1201. setpw
  1202. setpwent
  1203. setrlimit
  1204. setserv
  1205. setservent
  1206. setsid
  1207. setsockopt
  1208. setter
  1209. setuid
  1210. setvbuf
  1211. shared-array-increments
  1212. shared-array-offset
  1213. shared-array-root
  1214. shutdown
  1215. sigaction
  1216. signal-handlers
  1217. sinh
  1218. sleep
  1219. sloppy-assoc
  1220. sloppy-assq
  1221. sloppy-assv
  1222. sockaddr:addr
  1223. sockaddr:fam
  1224. sockaddr:flowinfo
  1225. sockaddr:path
  1226. sockaddr:port
  1227. sockaddr:scopeid
  1228. socket
  1229. socketpair
  1230. sort
  1231. sort!
  1232. sort-list
  1233. sort-list!
  1234. sorted?
  1235. source-properties
  1236. source-property
  1237. source-whash
  1238. spawn
  1239. stable-sort
  1240. stable-sort!
  1241. stack-id
  1242. stack-length
  1243. stack-ref
  1244. stack?
  1245. standard-vtable-fields
  1246. start-stack
  1247. stat
  1248. stat:atime
  1249. stat:atimensec
  1250. stat:blksize
  1251. stat:blocks
  1252. stat:ctime
  1253. stat:ctimensec
  1254. stat:dev
  1255. stat:gid
  1256. stat:ino
  1257. stat:mode
  1258. stat:mtime
  1259. stat:mtimensec
  1260. stat:nlink
  1261. stat:perms
  1262. stat:rdev
  1263. stat:size
  1264. stat:type
  1265. stat:uid
  1266. statat
  1267. status:exit-val
  1268. status:stop-sig
  1269. status:term-sig
  1270. strerror
  1271. strftime
  1272. string->char-set
  1273. string->char-set!
  1274. string-any
  1275. string-any-c-code
  1276. string-append/shared
  1277. string-bytes-per-char
  1278. string-capitalize
  1279. string-capitalize!
  1280. string-ci->symbol
  1281. string-ci<
  1282. string-ci<=
  1283. string-ci<>
  1284. string-ci=
  1285. string-ci>
  1286. string-ci>=
  1287. string-compare
  1288. string-compare-ci
  1289. string-concatenate
  1290. string-concatenate-reverse
  1291. string-concatenate-reverse/shared
  1292. string-concatenate/shared
  1293. string-contains
  1294. string-contains-ci
  1295. string-count
  1296. string-delete
  1297. string-downcase!
  1298. string-drop
  1299. string-drop-right
  1300. string-every
  1301. string-every-c-code
  1302. string-filter
  1303. string-fold
  1304. string-fold-right
  1305. string-for-each-index
  1306. string-hash
  1307. string-hash-ci
  1308. string-index
  1309. string-index-right
  1310. string-join
  1311. string-map
  1312. string-map!
  1313. string-normalize-nfc
  1314. string-normalize-nfd
  1315. string-normalize-nfkc
  1316. string-normalize-nfkd
  1317. string-null?
  1318. string-pad
  1319. string-pad-right
  1320. string-prefix-ci?
  1321. string-prefix-length
  1322. string-prefix-length-ci
  1323. string-prefix?
  1324. string-replace
  1325. string-reverse
  1326. string-reverse!
  1327. string-rindex
  1328. string-skip
  1329. string-skip-right
  1330. string-split
  1331. string-suffix-ci?
  1332. string-suffix-length
  1333. string-suffix-length-ci
  1334. string-suffix?
  1335. string-tabulate
  1336. string-take
  1337. string-take-right
  1338. string-titlecase
  1339. string-titlecase!
  1340. string-tokenize
  1341. string-trim
  1342. string-trim-both
  1343. string-trim-right
  1344. string-unfold
  1345. string-unfold-right
  1346. string-upcase!
  1347. string-utf8-length
  1348. string-xcopy!
  1349. string<
  1350. string<=
  1351. string<>
  1352. string=
  1353. string>
  1354. string>=
  1355. strptime
  1356. struct-layout
  1357. struct-ref
  1358. struct-ref/unboxed
  1359. struct-set!
  1360. struct-set!/unboxed
  1361. struct-vtable
  1362. struct-vtable-name
  1363. struct-vtable?
  1364. struct?
  1365. substring-fill!
  1366. substring-move!
  1367. substring/copy
  1368. substring/read-only
  1369. substring/shared
  1370. supports-source-properties?
  1371. symbol
  1372. symbol-append
  1373. symbol-fref
  1374. symbol-fset!
  1375. symbol-hash
  1376. symbol-interned?
  1377. symbol-pref
  1378. symbol-prefix-proc
  1379. symbol-property
  1380. symbol-property-remove!
  1381. symbol-pset!
  1382. symlink
  1383. symlinkat
  1384. sync
  1385. syntax-parameterize
  1386. syntax-source
  1387. syntax-violation
  1388. system
  1389. system*
  1390. system-async-mark
  1391. system-error-errno
  1392. system-file-name-convention
  1393. tanh
  1394. tcgetpgrp
  1395. tcsetpgrp
  1396. textdomain
  1397. the-root-module
  1398. the-scm-module
  1399. thunk?
  1400. times
  1401. tm:gmtoff
  1402. tm:hour
  1403. tm:isdst
  1404. tm:mday
  1405. tm:min
  1406. tm:mon
  1407. tm:sec
  1408. tm:wday
  1409. tm:yday
  1410. tm:year
  1411. tm:zone
  1412. tmpfile
  1413. tmpnam
  1414. tms:clock
  1415. tms:cstime
  1416. tms:cutime
  1417. tms:stime
  1418. tms:utime
  1419. transpose-array
  1420. truncate
  1421. truncate-file
  1422. truncate-quotient
  1423. truncate-remainder
  1424. truncate/
  1425. try-load-module
  1426. try-module-autoload
  1427. ttyname
  1428. typed-array?
  1429. tzset
  1430. ucs-range->char-set
  1431. ucs-range->char-set!
  1432. umask
  1433. uname
  1434. unmemoize-expression
  1435. unread-char
  1436. unread-string
  1437. unsetenv
  1438. use-modules
  1439. use-srfis
  1440. user-modules-declarative?
  1441. using-readline?
  1442. usleep
  1443. utime
  1444. utsname:machine
  1445. utsname:nodename
  1446. utsname:release
  1447. utsname:sysname
  1448. utsname:version
  1449. variable-bound?
  1450. variable-unset!
  1451. vector-move-left!
  1452. vector-move-right!
  1453. version
  1454. version-matches?
  1455. vtable-index-layout
  1456. vtable-index-printer
  1457. vtable-offset-user
  1458. waitpid
  1459. warn
  1460. while
  1461. with-continuation-barrier
  1462. with-ellipsis
  1463. with-fluids*
  1464. with-throw-handler
  1465. xsubstring))
  1466. (library (guile)
  1467. (export %make-void-port
  1468. &compound-exception
  1469. &error
  1470. &exception
  1471. &non-continuable
  1472. *
  1473. *unspecified*
  1474. +
  1475. -
  1476. ->bool
  1477. ...
  1478. /
  1479. 1+ 1-
  1480. <
  1481. <=
  1482. =
  1483. =>
  1484. >
  1485. >=
  1486. _
  1487. abort-to-prompt
  1488. abs
  1489. acons
  1490. acos
  1491. and
  1492. and-map
  1493. and=>
  1494. angle
  1495. append
  1496. apply
  1497. ash
  1498. asin
  1499. assoc
  1500. assoc-ref
  1501. assq
  1502. assq-ref
  1503. assv
  1504. assv-ref
  1505. atan
  1506. begin
  1507. bitvector
  1508. bitvector-length
  1509. bitvector-ref
  1510. bitvector-set!
  1511. bitvector?
  1512. boolean?
  1513. bound-identifier=?
  1514. caaaar
  1515. caaadr
  1516. caaar
  1517. caadar
  1518. caaddr
  1519. caadr
  1520. caar
  1521. cadaar
  1522. cadadr
  1523. cadar
  1524. caddar
  1525. cadddr
  1526. caddr
  1527. cadr
  1528. call-with-current-continuation
  1529. call-with-input-file
  1530. call-with-input-string
  1531. call-with-output-file
  1532. call-with-output-string
  1533. call-with-port
  1534. call-with-prompt
  1535. call-with-values
  1536. call/cc
  1537. car
  1538. case
  1539. case-lambda
  1540. case-lambda*
  1541. cdaaar
  1542. cdaadr
  1543. cdaar
  1544. cdadar
  1545. cdaddr
  1546. cdadr
  1547. cdar
  1548. cddaar
  1549. cddadr
  1550. cddar
  1551. cdddar
  1552. cddddr
  1553. cdddr
  1554. cddr
  1555. cdr
  1556. ceiling
  1557. char->integer
  1558. char-alphabetic?
  1559. char-ci<=?
  1560. char-ci<?
  1561. char-ci=?
  1562. char-ci>=?
  1563. char-ci>?
  1564. char-downcase
  1565. char-lower-case?
  1566. char-numeric?
  1567. char-ready?
  1568. char-upcase
  1569. char-upper-case?
  1570. char-whitespace?
  1571. char<=?
  1572. char<?
  1573. char=?
  1574. char>=?
  1575. char>?
  1576. char?
  1577. close-input-port
  1578. close-output-port
  1579. close-port
  1580. command-line
  1581. complex?
  1582. cond
  1583. cond-expand
  1584. cons
  1585. cons*
  1586. cos
  1587. current-dynamic-state
  1588. current-error-port
  1589. current-input-port
  1590. current-output-port
  1591. current-time
  1592. datum->syntax
  1593. default-prompt-tag
  1594. define
  1595. define*
  1596. define-syntax
  1597. define-syntax-rule
  1598. define-values
  1599. delay
  1600. delq
  1601. delq!
  1602. delq1!
  1603. denominator
  1604. display
  1605. do
  1606. doubly-weak-hash-table?
  1607. drain-input
  1608. dynamic-state?
  1609. dynamic-wind
  1610. else
  1611. eof-object?
  1612. eq?
  1613. equal?
  1614. eqv?
  1615. error
  1616. even?
  1617. (rename inexact exact->inexact)
  1618. exact-integer-sqrt
  1619. exact-integer?
  1620. exact?
  1621. exception?
  1622. exit
  1623. exp
  1624. expt
  1625. finite?
  1626. floor
  1627. floor-quotient
  1628. floor-remainder
  1629. floor/
  1630. fluid-ref
  1631. fluid-set!
  1632. fluid?
  1633. for-each
  1634. force
  1635. force-output
  1636. format
  1637. free-identifier=?
  1638. gcd
  1639. generate-temporaries
  1640. get-output-string
  1641. hash
  1642. hash-clear!
  1643. hash-count
  1644. hash-create-handle!
  1645. hash-fold
  1646. hash-for-each
  1647. hash-for-each-handle
  1648. hash-get-handle
  1649. hash-map->list
  1650. hash-ref
  1651. hash-remove!
  1652. hash-set!
  1653. hash-table?
  1654. hashq
  1655. hashq-create-handle!
  1656. hashq-get-handle
  1657. hashq-ref
  1658. hashq-remove!
  1659. hashq-set!
  1660. hashv
  1661. hashv-create-handle!
  1662. hashv-get-handle
  1663. hashv-ref
  1664. hashv-remove!
  1665. hashv-set!
  1666. hashx-create-handle!
  1667. hashx-get-handle
  1668. hashx-ref
  1669. hashx-remove!
  1670. hashx-set!
  1671. identifier-syntax
  1672. identifier?
  1673. if
  1674. imag-part
  1675. include-from-path
  1676. (rename exact inexact->exact)
  1677. inexact?
  1678. inf
  1679. (rename infinite? inf?)
  1680. input-port?
  1681. integer->char
  1682. integer?
  1683. keyword->symbol
  1684. keyword?
  1685. lambda
  1686. lambda*
  1687. last-pair
  1688. lcm
  1689. length
  1690. let
  1691. let*
  1692. let-syntax
  1693. letrec
  1694. letrec*
  1695. letrec-syntax
  1696. list
  1697. list->string
  1698. list->vector
  1699. list-copy
  1700. list-ref
  1701. list-set!
  1702. list-tail
  1703. list?
  1704. log
  1705. logand
  1706. logbit?
  1707. logior
  1708. lognot
  1709. logtest
  1710. logxor
  1711. magnitude
  1712. make-bitvector
  1713. make-doubly-weak-hash-table
  1714. make-exception
  1715. make-exception-from-throw
  1716. make-fluid
  1717. make-hash-table
  1718. make-list
  1719. make-parameter
  1720. make-polar
  1721. make-promise
  1722. make-prompt-tag
  1723. make-rectangular
  1724. make-string
  1725. make-symbol
  1726. (rename make-box make-variable)
  1727. make-vector
  1728. make-weak-key-hash-table
  1729. make-weak-value-hash-table
  1730. map
  1731. max
  1732. member
  1733. memq
  1734. memv
  1735. min
  1736. modulo
  1737. most-negative-fixnum
  1738. most-positive-fixnum
  1739. nan
  1740. nan?
  1741. negate
  1742. negative?
  1743. newline
  1744. not
  1745. null?
  1746. number->string
  1747. number?
  1748. numerator
  1749. object->string
  1750. odd?
  1751. open-input-file
  1752. open-input-string
  1753. open-output-file
  1754. open-output-string
  1755. or
  1756. or-map
  1757. output-port?
  1758. pair?
  1759. parameter?
  1760. parameterize
  1761. peek
  1762. peek-char
  1763. pk
  1764. port-closed?
  1765. port-column
  1766. port-filename
  1767. port-line
  1768. port?
  1769. positive?
  1770. procedure?
  1771. program-arguments
  1772. promise?
  1773. quasiquote
  1774. quasisyntax
  1775. quit
  1776. quote
  1777. quote-syntax
  1778. quotient
  1779. raise-exception
  1780. rational?
  1781. rationalize
  1782. read
  1783. read-char
  1784. real-part
  1785. real?
  1786. record-type-parents
  1787. record?
  1788. remainder
  1789. reverse
  1790. round
  1791. set!
  1792. set-car!
  1793. set-cdr!
  1794. simple-exceptions
  1795. simple-format
  1796. sin
  1797. sqrt
  1798. string
  1799. string->list
  1800. string->number
  1801. string->symbol
  1802. string-append
  1803. string-ci<=?
  1804. string-ci<?
  1805. string-ci=?
  1806. string-ci>=?
  1807. string-ci>?
  1808. string-copy
  1809. string-copy!
  1810. string-downcase
  1811. string-fill!
  1812. string-for-each
  1813. string-length
  1814. string-ref
  1815. string-set!
  1816. string-upcase
  1817. string<=?
  1818. string<?
  1819. string=?
  1820. string>=?
  1821. string>?
  1822. string?
  1823. substring
  1824. symbol->keyword
  1825. symbol->string
  1826. symbol?
  1827. syntax
  1828. syntax->datum
  1829. syntax-case
  1830. syntax-error
  1831. syntax-rules
  1832. tan
  1833. the-eof-object
  1834. throw
  1835. unless
  1836. unquote
  1837. unquote-splicing
  1838. unspecified?
  1839. unsyntax
  1840. unsyntax-splicing
  1841. values
  1842. (rename box-ref variable-ref)
  1843. (rename box-set! variable-set!)
  1844. (rename box? variable?)
  1845. vector
  1846. vector->list
  1847. vector-copy
  1848. vector-copy!
  1849. vector-fill!
  1850. vector-length
  1851. vector-ref
  1852. vector-set!
  1853. vector?
  1854. weak-key-hash-table?
  1855. weak-value-hash-table?
  1856. when
  1857. with-dynamic-state
  1858. with-error-to-file
  1859. with-error-to-port
  1860. with-error-to-string
  1861. with-exception-handler
  1862. with-fluid*
  1863. with-fluids
  1864. with-input-from-file
  1865. with-input-from-port
  1866. with-input-from-string
  1867. with-output-to-file
  1868. with-output-to-port
  1869. with-output-to-string
  1870. with-syntax
  1871. write
  1872. write-char
  1873. zero?
  1874. λ)
  1875. (import (hoot assoc)
  1876. (hoot bitvectors)
  1877. (hoot bitwise)
  1878. (hoot boxes)
  1879. (hoot bytevectors)
  1880. (hoot char)
  1881. (hoot cond-expand)
  1882. (hoot control)
  1883. (hoot dynamic-states)
  1884. (hoot dynamic-wind)
  1885. (hoot eq)
  1886. (hoot equal)
  1887. (hoot error-handling)
  1888. (hoot errors)
  1889. (hoot exceptions)
  1890. (hoot features)
  1891. (hoot fluids)
  1892. (hoot hashtables)
  1893. (hoot keywords)
  1894. (hoot lists)
  1895. (hoot not)
  1896. (hoot numbers)
  1897. (hoot pairs)
  1898. (hoot parameters)
  1899. (hoot ports)
  1900. (only (hoot primitives) apply)
  1901. (hoot procedures)
  1902. (only (hoot read) read string->number)
  1903. (hoot strings)
  1904. (hoot syntax)
  1905. (hoot symbols)
  1906. (hoot values)
  1907. (hoot vectors)
  1908. (hoot write)
  1909. (ice-9 match)
  1910. (only (scheme base) boolean?)
  1911. (only (scheme char)
  1912. char-ci<? char-ci<=? char-ci=? char-ci>=? char-ci>?
  1913. string-ci<? string-ci<=? string-ci=? string-ci>=? string-ci>?)
  1914. (only (scheme file)
  1915. open-input-file
  1916. open-output-file
  1917. call-with-input-file
  1918. call-with-output-file
  1919. with-input-from-file
  1920. with-output-to-file)
  1921. (scheme lazy)
  1922. (scheme process-context)
  1923. (scheme time)
  1924. (srfi srfi-9))
  1925. (define (%make-void-port mode)
  1926. (define (mode-prefix-match? test)
  1927. (call-with-input-string mode
  1928. (lambda (p)
  1929. (let lp ((c (read-char p)))
  1930. (cond
  1931. ((eof-object? c) #f)
  1932. ((or (test c)
  1933. (char-ci=? c #\+)) #t)
  1934. (else (lp (read-char p))))))))
  1935. (define %read
  1936. (and (mode-prefix-match? (lambda (c)
  1937. (char-ci=? c #\r)))
  1938. (lambda (bv start count) (eof-object))))
  1939. (define %write
  1940. (and (mode-prefix-match? (lambda (c)
  1941. (or (char-ci=? c #\w)
  1942. (char-ci=? c #\a))))
  1943. (lambda (bv start count) count)))
  1944. (make-port %read ; read
  1945. %write ; write
  1946. #f ; input-waiting?
  1947. #f ; seek
  1948. #f ; close
  1949. #f ; truncate
  1950. "void" ; repr
  1951. #f ; filename
  1952. 1024 ; read-buf-size
  1953. 1024 ; write-buf-size
  1954. #f ; r/w-random-access
  1955. #f ; fold-case?
  1956. #f ; private data
  1957. ))
  1958. (define-syntax *unspecified*
  1959. (identifier-syntax (if #f #f)))
  1960. (define (->bool x) (if x #t #f))
  1961. (define (and-map f l)
  1962. (match l
  1963. (() #t)
  1964. ((x . l)
  1965. (and (f x) (and-map f l)))))
  1966. (define (or-map f l)
  1967. (match l
  1968. (() #f)
  1969. ((x . l)
  1970. (or (f x) (or-map f l)))))
  1971. (define (and=> x f) (and x (f x)))
  1972. (define (assq-ref alist x) (and=> (assq x alist) cdr))
  1973. (define (assv-ref alist x) (and=> (assv x alist) cdr))
  1974. (define (assoc-ref alist x) (and=> (assoc x alist) cdr))
  1975. (define (delq item lst)
  1976. (match lst
  1977. (() '())
  1978. ((x . rest)
  1979. (if (eq? item x)
  1980. (delq item rest)
  1981. (cons x (delq item rest))))))
  1982. (define (delq! item lst)
  1983. (match lst
  1984. (() '())
  1985. ((x . rest)
  1986. (if (eq? item x)
  1987. (delq! item rest)
  1988. (let ((rest* (delq! item rest)))
  1989. (set-cdr! lst rest*)
  1990. lst)))))
  1991. (define (delq1! item lst)
  1992. (match lst
  1993. (() '())
  1994. ((x . rest)
  1995. (if (eq? item x)
  1996. rest
  1997. (let ((rest* (delq1! item rest)))
  1998. (set-cdr! lst rest*)
  1999. lst)))))
  2000. (define (call-with-input-string str proc)
  2001. (proc (open-input-string str)))
  2002. (define (call-with-output-string proc)
  2003. (let ((port (open-output-string)))
  2004. (proc port)
  2005. (get-output-string port)))
  2006. (define (with-input-from-string str thunk)
  2007. (call-with-input-string str
  2008. (lambda (port)
  2009. (with-input-from-port port thunk))))
  2010. (define (with-output-to-string thunk)
  2011. (call-with-output-string
  2012. (lambda (port)
  2013. (with-output-to-port port thunk))))
  2014. (define (with-input-from-port port thunk)
  2015. (parameterize ((current-input-port port))
  2016. (thunk)))
  2017. (define (with-output-to-port port thunk)
  2018. (parameterize ((current-output-port port))
  2019. (thunk)))
  2020. (define (with-error-to-port port thunk)
  2021. (parameterize ((current-error-port port))
  2022. (thunk)))
  2023. (define (with-error-to-file filename thunk)
  2024. (call-with-port (open-output-file filename)
  2025. (lambda (port)
  2026. (with-error-to-port port thunk))))
  2027. (define (with-error-to-string thunk)
  2028. (call-with-output-string
  2029. (lambda (port) (with-error-to-port port thunk))))
  2030. (define (current-time) (current-jiffy))
  2031. (define* (drain-input #:optional (port (current-input-port)))
  2032. (flush-input-port port))
  2033. (define* (force-output #:optional (port (current-output-port)))
  2034. (flush-output-port port))
  2035. (define (simple-format port template . args)
  2036. (define (do-format port)
  2037. (call-with-input-string
  2038. template
  2039. (lambda (in)
  2040. (let lp ((args args))
  2041. (match (read-char in)
  2042. ((? eof-object?)
  2043. (match args
  2044. (() (force-output port))
  2045. (_ (error "leftover format args" template args))))
  2046. (#\~
  2047. (match (read-char in)
  2048. ((or #\a #\A)
  2049. (match args
  2050. ((x . args) (display x port) (lp args))
  2051. (_ (error "not enough format args" template))))
  2052. ((or #\s #\S)
  2053. (match args
  2054. ((x . args) (write x port) (lp args))
  2055. (_ (error "not enough format args" template))))
  2056. (#\~ (write-char #\~ port) (lp args))
  2057. (#\% (newline port) (lp args))
  2058. (ch (error "unexpected format directive" template ch))))
  2059. (ch (write-char ch port) (lp args)))))))
  2060. (match port
  2061. (#t (do-format (current-output-port)))
  2062. (#f (call-with-output-string do-format))
  2063. ((? output-port?) (do-format port))
  2064. (_ (error "invalid format destination" port))))
  2065. (define format simple-format)
  2066. (define (inf) +inf.0)
  2067. (define (nan) +nan.0)
  2068. (define (negate x) (- x))
  2069. (define* (object->string obj #:optional (print write))
  2070. (call-with-output-string (lambda (port) (print obj port))))
  2071. (define (last-pair l)
  2072. (match l
  2073. ((_ . (and l (_ . _))) (last-pair l))
  2074. ((_ . _) l)
  2075. (_ (error "not a pair" l))))
  2076. (define (peek . stuff)
  2077. (newline)
  2078. (display ";;; ")
  2079. (write stuff)
  2080. (newline)
  2081. (flush-output-port (current-output-port))
  2082. (car (last-pair stuff)))
  2083. (define pk peek)
  2084. (define (port-closed? port) (not (port-open? port)))
  2085. (define (program-arguments) (command-line))
  2086. (define quit exit)
  2087. (define the-eof-object (eof-object))
  2088. (define (unspecified? x) (eq? x *unspecified*))
  2089. (define-syntax-rule (λ formals body ...)
  2090. (lambda formals body ...))
  2091. ;; TODO: Implement Guile's conversions based on key.
  2092. (define (make-exception-from-throw key args)
  2093. (make-exception-with-irritants args))
  2094. (define (throw key . args)
  2095. (raise-exception (make-exception-from-throw key args)))
  2096. ;; Hash table API compatibility shim:
  2097. ;;
  2098. ;; Guile's legacy hash table API is not so great. It allows for
  2099. ;; mixing different hash functions in the same table, which is why
  2100. ;; there are *four* variants for ref/set!/remove! procedures. On
  2101. ;; top of that, the API is also polymorphic. Those same procedures
  2102. ;; are used on "normal", weak key, weak value, and doubly weak
  2103. ;; tables.
  2104. ;;
  2105. ;; We made a better interface in (hoot hashtables) that resembles
  2106. ;; the R6RS API and is monomorphic. However, in the interest of
  2107. ;; maximizing the amount of existing Guile code that can be compiled
  2108. ;; as-is with Hoot, we have provided this compatibility shim.
  2109. ;;
  2110. ;; Hoot does *not* provide full compatibility, just partial
  2111. ;; compatibility for common use-cases. Code that is mixing hash
  2112. ;; functions in the same table or using
  2113. ;; hash-get-handle/hash-create-handle! is not supported. Also,
  2114. ;; because hashx-* procedures use assoc and friends, which is
  2115. ;; incompatible with how (hoot hashtables) does equality testing, we
  2116. ;; force equal? as the equivalence function.
  2117. (define-record-type <hash-table>
  2118. (%make-hash-table type)
  2119. hash-table?
  2120. (type hash-table-type) ; normal, weak-key, weak-value, doubly-weak
  2121. (table hash-table-table set-hash-table-table!)) ; lazily initialized
  2122. (define* (make-hash-table #:optional size)
  2123. "Return a new hash table. @var{size} is ignored."
  2124. (%make-hash-table 'normal))
  2125. (define* (make-weak-key-hash-table #:optional size)
  2126. "Return a new weak key hash table. @var{size} is ignored."
  2127. (%make-hash-table 'weak-key))
  2128. (define* (make-weak-value-hash-table #:optional size)
  2129. "Return a new weak value hash table. @var{size} is ignored."
  2130. (%make-hash-table 'weak-value))
  2131. (define* (make-doubly-weak-hash-table #:optional size)
  2132. "Return a new doubly weak hash table. @var{size} is ignored."
  2133. (%make-hash-table 'doubly-weak))
  2134. (define (weak-key-hash-table? obj)
  2135. "Return @code{#t} if @var{obj} is a weak key hash table."
  2136. (and (hash-table? obj) (eq? (hash-table-type obj) 'weak-key)))
  2137. (define (weak-value-hash-table? obj)
  2138. "Return @code{#t} if @var{obj} is a weak value hash table."
  2139. (and (hash-table? obj) (eq? (hash-table-type obj) 'weak-value)))
  2140. (define (doubly-weak-hash-table? obj)
  2141. "Return @code{#t} if @var{obj} is a doubly weak hash table."
  2142. (and (hash-table? obj) (eq? (hash-table-type obj) 'doubly-weak)))
  2143. ;; Should these assert that the hash and equiv functions are what we
  2144. ;; expect? Currently, mixing hash functions on the same table will
  2145. ;; just silently use the hash function of the first ref/set!/remove!
  2146. ;; call.
  2147. (define (maybe-init-equal-hashtable table)
  2148. (unless (hash-table-table table)
  2149. (match (hash-table-type table)
  2150. ('normal (set-hash-table-table! table (make-hashtable)))
  2151. ('weak-key (raise (make-unimplemented-error 'maybe-init-equal-hash-table)))
  2152. ('weak-value (raise (make-unimplemented-error 'maybe-init-equal-hash-table)))
  2153. ('doubly-weak (raise (make-unimplemented-error 'maybe-init-equal-hash-table))))))
  2154. (define (maybe-init-eq-hashtable table)
  2155. (unless (hash-table-table table)
  2156. (match (hash-table-type table)
  2157. ('normal (set-hash-table-table! table (make-eq-hashtable)))
  2158. ('weak-key (set-hash-table-table! table (make-weak-key-hashtable)))
  2159. ('weak-value (raise (make-unimplemented-error 'maybe-init-eq-hash-table)))
  2160. ('doubly-weak (raise (make-unimplemented-error 'maybe-init-eq-hash-table))))))
  2161. (define (maybe-init-eqv-hashtable table)
  2162. (unless (hash-table-table table)
  2163. (match (hash-table-type table)
  2164. ('normal (set-hash-table-table! table (make-eqv-hashtable)))
  2165. ('weak-key (raise (make-unimplemented-error 'maybe-init-eqv-hash-table)))
  2166. ('weak-value (raise (make-unimplemented-error 'maybe-init-eqv-hash-table)))
  2167. ('doubly-weak (raise (make-unimplemented-error 'maybe-init-eqv-hash-table))))))
  2168. (define (maybe-init-custom-hashtable table hash equiv)
  2169. (unless (hash-table-table table)
  2170. (match (hash-table-type table)
  2171. ('normal (set-hash-table-table! table (make-hashtable hash equiv)))
  2172. ('weak-key (raise (make-unimplemented-error 'maybe-init-custom-hash-table)))
  2173. ('weak-value (raise (make-unimplemented-error 'maybe-init-custom-hash-table)))
  2174. ('doubly-weak (raise (make-unimplemented-error 'maybe-init-custom-hash-table))))))
  2175. (define (%hash-ref who table key default)
  2176. (let ((table* (hash-table-table table)))
  2177. (match (hash-table-type table)
  2178. ('normal (hashtable-ref table* key default))
  2179. ('weak-key (weak-key-hashtable-ref table* key default))
  2180. ('weak-value (raise (make-unimplemented-error who)))
  2181. ('doubly-weak (raise (make-unimplemented-error who))))))
  2182. (define* (hash-ref table key #:optional default)
  2183. "Look up @var{key} in the hash table @var{table}, and return the
  2184. value associated with it. If @var{key} is not found, return
  2185. @var{default} (if specified) or @code{#f}. Uses @code{equal?} for
  2186. equality testing."
  2187. (maybe-init-equal-hashtable table)
  2188. (%hash-ref 'hash-ref table key default))
  2189. (define* (hashq-ref table key #:optional default)
  2190. "Look up @var{key} in the hash table @var{table}, and return the
  2191. value associated with it. If @var{key} is not found, return
  2192. @var{default} (if specified) or @code{#f}. Uses @code{eq?} for
  2193. equality testing."
  2194. (maybe-init-eq-hashtable table)
  2195. (%hash-ref 'hashq-ref table key default))
  2196. (define* (hashv-ref table key #:optional default)
  2197. "Look up @var{key} in the hash table @var{table}, and return the
  2198. value associated with it. If @var{key} is not found, return
  2199. @var{default} (if specified) or @code{#f}. Uses @code{eqv?} for
  2200. equality testing."
  2201. (maybe-init-eqv-hashtable table)
  2202. (%hash-ref 'hashv-ref table key default))
  2203. (define* (hashx-ref hash assoc table key #:optional default)
  2204. "Look up @var{key} in the hash table @var{table}, and return the
  2205. value associated with it. If @var{key} is not found, return
  2206. @var{default} (if specified) or @code{#f}. Uses @var{hash} as the
  2207. hash function. @var{assoc} is ignored and @code{equal?} is used for
  2208. equality testing."
  2209. (maybe-init-custom-hashtable table hash equal?)
  2210. (%hash-ref 'hashx-ref table key default))
  2211. (define (%hash-set! who table key val)
  2212. (let ((table* (hash-table-table table)))
  2213. (match (hash-table-type table)
  2214. ('normal (hashtable-set! table* key val))
  2215. ('weak-key (weak-key-hashtable-set! table* key val))
  2216. ('weak-value (raise (make-unimplemented-error who)))
  2217. ('doubly-weak (raise (make-unimplemented-error who))))))
  2218. (define (hash-set! table key val)
  2219. "Find the entry in @var{table} associated with @var{key} and store
  2220. @var{val} there. Uses @code{equal?} for equality testing."
  2221. (maybe-init-equal-hashtable table)
  2222. (%hash-set! 'hash-set! table key val))
  2223. (define (hashq-set! table key val)
  2224. "Find the entry in @var{table} associated with @var{key} and store
  2225. @var{val} there. Uses @code{eq?} for equality testing."
  2226. (maybe-init-eq-hashtable table)
  2227. (%hash-set! 'hashq-set! table key val))
  2228. (define (hashv-set! table key val)
  2229. "Find the entry in @var{table} associated with @var{key} and store
  2230. @var{val} there. Uses @code{eqv?} for equality testing."
  2231. (maybe-init-eqv-hashtable table)
  2232. (%hash-set! 'hashv-set! table key val))
  2233. (define (hashx-set! hash assoc table key val)
  2234. "Find the entry in @var{table} associated with @var{key} and store
  2235. @var{val} there. Uses @var{hash} as the hash function. @var{assoc}
  2236. is ignored and @code{equal?} is used for equality testing."
  2237. (maybe-init-custom-hashtable table hash equal?)
  2238. (%hash-set! 'hashx-set! table key val))
  2239. (define (%hash-remove! who table key)
  2240. (let ((table* (hash-table-table table)))
  2241. (match (hash-table-type table)
  2242. ('normal (hashtable-delete! table* key))
  2243. ('weak-key (weak-key-hashtable-delete! table* key))
  2244. ('weak-value (raise (make-unimplemented-error who)))
  2245. ('doubly-weak (raise (make-unimplemented-error who))))))
  2246. (define (hash-remove! table key)
  2247. "Remove @var{key} from @var{table}. Uses @code{equal?} for equality
  2248. testing."
  2249. (maybe-init-equal-hashtable table)
  2250. (%hash-remove! 'hash-remove! table key))
  2251. (define (hashq-remove! table key)
  2252. "Remove @var{key} from @var{table}. Uses @code{eq?} for equality
  2253. testing."
  2254. (maybe-init-eq-hashtable table)
  2255. (%hash-remove! 'hashq-remove! table key))
  2256. (define (hashv-remove! table key)
  2257. "Remove @var{key} from @var{table}. Uses @code{eqv?} for equality
  2258. testing."
  2259. (maybe-init-eqv-hashtable table)
  2260. (%hash-remove! 'hashv-remove! table key))
  2261. (define (hashx-remove! hash assoc table key)
  2262. "Remove @var{key} from @var{table}. Uses @var{hash} as the hash
  2263. function. @var{assoc} is ignored and @code{equal?} is used for
  2264. equality testing."
  2265. (maybe-init-custom-hashtable table hash equal?)
  2266. (%hash-remove! 'hashx-remove! table key))
  2267. (define (hash-get-handle table key)
  2268. (raise (make-unimplemented-error 'hash-get-handle)))
  2269. (define (hashq-get-handle table key)
  2270. (raise (make-unimplemented-error 'hashq-get-handle)))
  2271. (define (hashv-get-handle table key)
  2272. (raise (make-unimplemented-error 'hashv-get-handle)))
  2273. (define (hashx-get-handle hash assoc table key)
  2274. (raise (make-unimplemented-error 'hashx-get-handle)))
  2275. (define (hash-create-handle! table key init)
  2276. (raise (make-unimplemented-error 'hash-create-handle!)))
  2277. (define (hashq-create-handle! table key init)
  2278. (raise (make-unimplemented-error 'hashq-create-handle!)))
  2279. (define (hashv-create-handle! table key init)
  2280. (raise (make-unimplemented-error 'hashv-create-handle!)))
  2281. (define (hashx-create-handle! hash assoc table key init)
  2282. (raise (make-unimplemented-error 'hashx-create-handle!)))
  2283. (define (hash-clear! table)
  2284. "Remove all items from @var{table}."
  2285. (match (hash-table-table table)
  2286. (#f (values))
  2287. (table*
  2288. (match (hash-table-type table)
  2289. ('normal (hashtable-clear! table*))
  2290. ('weak-key (raise (make-unimplemented-error 'hash-clear!)))
  2291. ('weak-value (raise (make-unimplemented-error 'hash-clear!)))
  2292. ('doubly-weak (raise (make-unimplemented-error 'hash-clear!)))))))
  2293. (define (hash-fold proc init table)
  2294. "Accumulate a result by applying @var{proc} with each key/value
  2295. association in @var{table} and the result of the previous @var{proc}
  2296. call. Each call is of the form @code{(proc key value prev)}. For the
  2297. first call, @code{prev} is the initial value @var{init}."
  2298. (match (hash-table-table table)
  2299. (#f init)
  2300. (table*
  2301. (match (hash-table-type table)
  2302. ('normal (hashtable-fold proc init table*))
  2303. ('weak-key (raise (make-unimplemented-error 'hash-fold)))
  2304. ('weak-value (raise (make-unimplemented-error 'hash-fold)))
  2305. ('doubly-weak (raise (make-unimplemented-error 'hash-fold)))))))
  2306. (define (hash-map->list proc table)
  2307. "Return an association list of key/value mappings in @var{table}."
  2308. (hash-fold (lambda (key value result)
  2309. (cons (proc key value) result))
  2310. '() table))
  2311. (define (hash-count pred table)
  2312. "Return the number of elements in @var{table} that satisfy @code{(pred
  2313. key value)}."
  2314. (hash-fold (lambda (key val count)
  2315. (if (pred key val)
  2316. (1+ count)
  2317. count))
  2318. 0 table))
  2319. (define (hash-for-each proc table)
  2320. "Apply @var{proc} to each key/value association in @var{table}.
  2321. Each call is of the form @code{(proc key value)}."
  2322. (match (hash-table-table table)
  2323. (#f (values))
  2324. (table*
  2325. (match (hash-table-type table)
  2326. ('normal (hashtable-for-each proc table*))
  2327. ('weak-key (raise (make-unimplemented-error 'hash-for-each)))
  2328. ('weak-value (raise (make-unimplemented-error 'hash-for-each)))
  2329. ('doubly-weak (raise (make-unimplemented-error 'hash-for-each)))))))
  2330. (define (hash-for-each-handle proc table)
  2331. (raise (make-unimplemented-error 'hash-for-each-handle))))