-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SRFI 27: Sources of Random Bits #16
Comments
Some procedures such as |
One way is to use an explicit namespace declaration in your code, for example:
|
Nice. That doesn't seem to affect re-exports, however. These don't currently work: (define-library (srfi 27)
(export random-integer)
(begin (##namespace ("" random-integer))))
(define-library (srfi 27)
(import (only (scheme base) define))
(export random-integer)
(begin (##namespace ("" random-integer))
(define random-integer random-integer)))
(define-library (srfi 27)
(import (only (scheme base) define let))
(export random-integer)
(begin (define random-integer
((lambda ()
(namespace ("" random-integer))
random-integer))))) |
These explicit |
Actually this was my mistake: (define-library (srfi 27)
(import (only (scheme base) define let))
(export random-integer)
(begin (define random-integer
((lambda ()
(namespace ("" random-integer))
random-integer))))) This works fine: (define-library (srfi 27)
(import (only (scheme base) define lambda))
(export random-integer)
(begin (define random-integer
((lambda ()
(##namespace ("" random-integer))
random-integer))))) I can do the wrappers using this technique. |
OK... BTW it is shorter to do |
$ gsi gambit/libs/
Gambit v4.9.3
> (define original random-integer)
> (eq? original random-integer)
#t
> (import (srfi 27))
> (apropos "random-integer")
"srfi/27#" namespace:
random-integer
empty namespace:
random-integer
> srfi/27#random-integer
#<procedure #2 random-integer>
> (eq? srfi/27#random-integer random-integer)
#t
> (eq? srfi/27#random-integer original)
#t |
You're right. I didn't realize Gambit supports a |
Seems |
The shim approach will work for now, but with reexportation it will be possible to eliminate the I'm currently working on implementing reexportation... |
Great! How difficult is it to implement? If it's just a few days, I'll wait until it's done before doing the SRFI wrappers. |
BTW, you might be interested in knowing that in the external representation for procedures
The reexportation feature should be available later today. |
Makes sense. In a similar vein, Emacs has an Once again, thank you for your impressive dedication in taking care of Gambit. |
https://srfi.schemers.org/srfi-27/srfi-27.html
According to Gambit's manual, this is already built-in. We just need to add a
(srfi 27)
library wrapper.The text was updated successfully, but these errors were encountered: