Re: [racket-dev] using module system for alternate namespaces
I'm having trouble understanding the problem. In your example, is 'base the namespace API that you have available? It has a way of referencing an identifier and making a binding? And you are looking at a way to take modules like 'm1 (which are really written using this namespace mechanism) and then turn them into Racket modules? So, there is some pre-existing thing like 'm1 and you want to turn it into a Racket-y thing that doesn't need to explicitly use the namespace API? If that is mostly accurate, then here are some ideas: - If the other namespaces are fixed before the program runs, then you can make them constructed through a macro that uses the namespace API to query the namespace and set up bindings in (sub)modules that call the reference function, some thing: (define-syntax-rule (define-module-of namespace-id) (module namespace-id namespace/reflect namespace-id)) where namespace/reflect is a module language that has a #%module-begin like (define-syntax (#%module-begin stx) (syntax-case stx () [(_ . namespace-id) (with-syntax ([(id ...) (namespace-binding-list (syntax->datum #'namespace-id))]) (syntax (begin (define id (namespace-get 'namespace-id 'id)) ... (provide (all-defined-out)])) Then your Racket code could just (require (submod "." 'whatever)) and get the macro-generated 'whatever namespace as Racket bindings. This would work with separate compilation. - If the other namespaces are dynamically created with the Racket program, then you could follow a similar technique, but create an evaluator in the main Racket program and then generate a call to (define-module-of n) when the n namespace was ready and then inject a Racket expression that wants to use those bindings into the evaluator or something like that. - I feel like this is vaguely similar to how the Web server's templating system works. Jay On Mon, Oct 27, 2014 at 7:00 PM, Dan Liebgold wrote: > I have a namespace behind a particular API. I'd love to hook into the module > system to control compilation, visibility, etc. of all the definitions and > references. > > Here's an example. 'a' is available in the top level module even though it > was defined by module 'm1' and not provided by any explicit mechanism. > (Also, order dependencies seem imminent.) > > #lang racket > > (module base racket > (define my-table (make-hasheq)) > > (define-syntax (my-define stx) > (syntax-case stx () > [(_ my-id expr) (identifier? #'my-id) > #'(hash-set! my-table 'my-id expr)])) > > (define-syntax (my-eval stx) > (syntax-case stx () > [(_ my-id) > #'(hash-ref my-table my-id #f)])) > > (provide my-define > my-eval) > ) > > (module m1 racket > (require (submod ".." base)) > (my-define a (+ 1 2)) > ) > > (require 'base > 'm1) > > (my-eval 'a) > > > Is there any example of doing something like this using the module system > without polluting the top level namespace? Am I correct in assuming that > this will not work under separate module compilation? > > -- > Dan Liebgold[dan.liebg...@gmail.com] > > _ > Racket Developers list: > http://lists.racket-lang.org/dev > -- Jay McCarthy http://jeapostrophe.github.io "Wherefore, be not weary in well-doing, for ye are laying the foundation of a great work. And out of small things proceedeth that which is great." - D&C 64:33 _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] using module system for alternate namespaces
I have a namespace behind a particular API. I'd love to hook into the module system to control compilation, visibility, etc. of all the definitions and references. Here's an example. 'a' is available in the top level module even though it was defined by module 'm1' and not provided by any explicit mechanism. (Also, order dependencies seem imminent.) #lang racket (module base racket (define my-table (make-hasheq)) (define-syntax (my-define stx) (syntax-case stx () [(_ my-id expr) (identifier? #'my-id) #'(hash-set! my-table 'my-id expr)])) (define-syntax (my-eval stx) (syntax-case stx () [(_ my-id) #'(hash-ref my-table my-id #f)])) (provide my-define my-eval) ) (module m1 racket (require (submod ".." base)) (my-define a (+ 1 2)) ) (require 'base 'm1) (my-eval 'a) Is there any example of doing something like this using the module system without polluting the top level namespace? Am I correct in assuming that this will not work under separate module compilation? -- Dan Liebgold[dan.liebg...@gmail.com] _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.1.1
On 10/27/2014 12:25 PM, Ryan Culpepper wrote: neil: - remove dependence on libgtkgl (c601b82f) * For OpenGL on Linux, removed dependence on libgtkgl and added support for core profiles (see `set-legacy?`). Neil ⊥ _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.1.1
For TR: * Exception handling changed to be safe. This may break existing programs that rely on unsafe behavior. * Exports from the GUI and framework libraries have types, and can be used transparently from typed programs. * Casts and predicates are supported in typed regions. Vincent At Mon, 27 Oct 2014 12:25:22 -0400, Ryan Culpepper wrote: > > The release announcement sketch that I have so far is below. Please > mail me new items and/or edits. > -- > > mflatt: > - optimizations (most from Gustavo Massaccesi) (82ffd405, 25c05d66, >a7a912ee, 1f2f7a1d, d14b4a80, 769c5b6e, 35eb6562, 15423988) > - add replace-evt (as suggested by Jan Dvořák) (bc69a9b0) > - performance tuning (c570a862, 1809df45) > - windows: use native api for dates (135ccf09) > - allow mixing exceptions with ffi/unsafe/alloc (from Jan Dvořák) > (8bd5aa38) > - fixing letrec updates? (eg 926e64f5?) > - senora gc (2916fc34, a312f499, 881990ed) > - raco pkg add '--binary-lib' (05523a0b, b2b00010) > - Mac OS X Yosemite Pango repair (76f1ebde) > - throw out latex back-end for picts ? (77ddf71b) > - chaperones w/o redirections (1f1a10db, a8d0534e) > - DPI-aware racket/gui on Windows (a64a1cb1) > - Windows: fix handling of junctions as links (cf7c0134) > - behavior of numpad Enter (7d388a07, a41cc0c3) > - UDP improvements (2a387ace) > - natipkg (40f5ec07) > > robby: > - add #:post condition to meta functions (e991dd46) > - improve the random checking for ->i (72c83a32) > - add contract-correct caveat to error messages (1dda800c) > - add #:pre to define-judgment-form (54a6d317) > - contract-stronger (eaf48bbb, 05185dcd, f669c47c, ...) > > matthias: > - check-satisfied (ecfafe63, and following) > > neil: > - remove dependence on libgtkgl (c601b82f) > > ryanc: > - add pattern expanders to syntax/parse (from Alex Knauth) (81cc6bf4) > - openssl server-side SNI (from Jay Kominek) (320079ee, 2d2f5dc3) > > -- > > _ > Racket Developers list: > http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.1.1
For me: * Added the drracket/check-syntax library to facilitate check syntax-like behavior in other IDEs * Redex: explained the benchmark programs added a conditional-form to metafunctions * 2htdp/image's notion of equality no longer considers an image's baseline. * Contracts: contract-stronger? is now more consistently useful and contract error messages now admit the contract itself might be wrong Robby On Mon, Oct 27, 2014 at 12:08 PM, Matthew Flatt wrote: > At Mon, 27 Oct 2014 12:25:22 -0400, Ryan Culpepper wrote: >> mflatt: >> - optimizations (most from Gustavo Massaccesi) (82ffd405, 25c05d66, >> a7a912ee, 1f2f7a1d, d14b4a80, 769c5b6e, 35eb6562, 15423988) >> - add replace-evt (as suggested by Jan Dvořák) (bc69a9b0) >> - fixing letrec updates? (eg 926e64f5?) >> - Mac OS X Yosemite Pango repair (76f1ebde) >> - DPI-aware racket/gui on Windows (a64a1cb1) >> - raco pkg add '--binary-lib' (05523a0b, b2b00010) > > Plus the 32-bit Windows repair: > > * Mac OS X Yosemite: fixed compatibility problems, mainly by patching >the Pango text-drawing library that is bundled with Racket. > > * Windows, 32-bit version: fixed window-update crashes by patching the >Cairo drawing library that is bundled with Racket. > > * Windows: made the GUI library DPI-aware. > > * Added a "binary library" installation mode to install packages >without source or documentation. Use the `--binary-lib` option with >`raco pkg install`. > > * Repaired the compiler's use-before-defined analysis for certain >forms of nested `letrec`, some `let` forms, and some uses of `set!` >or `with-continuation-mark`. > > * Added bytecode optimizations (thanks to Gustavo Massaccesi). > > * Added a `replace-evt` event constructor (as suggested by Jan Dvořák). > > >> - performance tuning (c570a862, 1809df45) >> - windows: use native api for dates (135ccf09) >> - allow mixing exceptions with ffi/unsafe/alloc (from Jan Dvořák) >>(8bd5aa38) >> - senora gc (2916fc34, a312f499, 881990ed) >> - throw out latex back-end for picts ? (77ddf71b) >> - chaperones w/o redirections (1f1a10db, a8d0534e) >> - Windows: fix handling of junctions as links (cf7c0134) >> - behavior of numpad Enter (7d388a07, a41cc0c3) >> - UDP improvements (2a387ace) >> - natipkg (40f5ec07) > > These seem too minor for the announcement. > > > _ > Racket Developers list: > http://lists.racket-lang.org/dev _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Release Announcement for v6.1.1
At Mon, 27 Oct 2014 12:25:22 -0400, Ryan Culpepper wrote: > mflatt: > - optimizations (most from Gustavo Massaccesi) (82ffd405, 25c05d66, > a7a912ee, 1f2f7a1d, d14b4a80, 769c5b6e, 35eb6562, 15423988) > - add replace-evt (as suggested by Jan Dvořák) (bc69a9b0) > - fixing letrec updates? (eg 926e64f5?) > - Mac OS X Yosemite Pango repair (76f1ebde) > - DPI-aware racket/gui on Windows (a64a1cb1) > - raco pkg add '--binary-lib' (05523a0b, b2b00010) Plus the 32-bit Windows repair: * Mac OS X Yosemite: fixed compatibility problems, mainly by patching the Pango text-drawing library that is bundled with Racket. * Windows, 32-bit version: fixed window-update crashes by patching the Cairo drawing library that is bundled with Racket. * Windows: made the GUI library DPI-aware. * Added a "binary library" installation mode to install packages without source or documentation. Use the `--binary-lib` option with `raco pkg install`. * Repaired the compiler's use-before-defined analysis for certain forms of nested `letrec`, some `let` forms, and some uses of `set!` or `with-continuation-mark`. * Added bytecode optimizations (thanks to Gustavo Massaccesi). * Added a `replace-evt` event constructor (as suggested by Jan Dvořák). > - performance tuning (c570a862, 1809df45) > - windows: use native api for dates (135ccf09) > - allow mixing exceptions with ffi/unsafe/alloc (from Jan Dvořák) >(8bd5aa38) > - senora gc (2916fc34, a312f499, 881990ed) > - throw out latex back-end for picts ? (77ddf71b) > - chaperones w/o redirections (1f1a10db, a8d0534e) > - Windows: fix handling of junctions as links (cf7c0134) > - behavior of numpad Enter (7d388a07, a41cc0c3) > - UDP improvements (2a387ace) > - natipkg (40f5ec07) These seem too minor for the announcement. _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Release Announcement for v6.1.1
The release announcement sketch that I have so far is below. Please mail me new items and/or edits. -- mflatt: - optimizations (most from Gustavo Massaccesi) (82ffd405, 25c05d66, a7a912ee, 1f2f7a1d, d14b4a80, 769c5b6e, 35eb6562, 15423988) - add replace-evt (as suggested by Jan Dvořák) (bc69a9b0) - performance tuning (c570a862, 1809df45) - windows: use native api for dates (135ccf09) - allow mixing exceptions with ffi/unsafe/alloc (from Jan Dvořák) (8bd5aa38) - fixing letrec updates? (eg 926e64f5?) - senora gc (2916fc34, a312f499, 881990ed) - raco pkg add '--binary-lib' (05523a0b, b2b00010) - Mac OS X Yosemite Pango repair (76f1ebde) - throw out latex back-end for picts ? (77ddf71b) - chaperones w/o redirections (1f1a10db, a8d0534e) - DPI-aware racket/gui on Windows (a64a1cb1) - Windows: fix handling of junctions as links (cf7c0134) - behavior of numpad Enter (7d388a07, a41cc0c3) - UDP improvements (2a387ace) - natipkg (40f5ec07) robby: - add #:post condition to meta functions (e991dd46) - improve the random checking for ->i (72c83a32) - add contract-correct caveat to error messages (1dda800c) - add #:pre to define-judgment-form (54a6d317) - contract-stronger (eaf48bbb, 05185dcd, f669c47c, ...) matthias: - check-satisfied (ecfafe63, and following) neil: - remove dependence on libgtkgl (c601b82f) ryanc: - add pattern expanders to syntax/parse (from Alex Knauth) (81cc6bf4) - openssl server-side SNI (from Jay Kominek) (320079ee, 2d2f5dc3) -- _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Update libffi to 3.1
Thank you, Jay. Yes, e. g. six new architectures were added and many testsuits have been updated > From: Jay McCarthy [mailto:jay.mccar...@gmail.com] > Sent: segunda-feira, 27 de outubro de 2014 11:38 > To: Gustavo Frederico Temple Pedrosa > Cc: dev@racket-lang.org > Subject: Re: [racket-dev] Update libffi to 3.1 > > I am always inclined to update. Is there also some new benefit or feature to > 3.1? > > Jay > > On Mon, Oct 27, 2014 at 9:29 AM, Gustavo Frederico Temple Pedrosa > wrote: > > Hello all, > > > > > > > > I submitted a commit for updating the libffi, I tested it and it works fine: > > > > > > > > https://github.com/plt/racket/pull/806 > > > > > > > > Any suggestion, please talk to me :) > > > > > > > > Thank you. > > > > > > _ > > Racket Developers list: > > http://lists.racket-lang.org/dev > > > > > > -- > Jay McCarthy > http://jeapostrophe.github.io > >"Wherefore, be not weary in well-doing, > for ye are laying the foundation of a great work. > And out of small things proceedeth that which is great." > - D&C 64:33 _ Racket Developers list: http://lists.racket-lang.org/dev
Re: [racket-dev] Update libffi to 3.1
I am always inclined to update. Is there also some new benefit or feature to 3.1? Jay On Mon, Oct 27, 2014 at 9:29 AM, Gustavo Frederico Temple Pedrosa wrote: > Hello all, > > > > I submitted a commit for updating the libffi, I tested it and it works fine: > > > > https://github.com/plt/racket/pull/806 > > > > Any suggestion, please talk to me :) > > > > Thank you. > > > _ > Racket Developers list: > http://lists.racket-lang.org/dev > -- Jay McCarthy http://jeapostrophe.github.io "Wherefore, be not weary in well-doing, for ye are laying the foundation of a great work. And out of small things proceedeth that which is great." - D&C 64:33 _ Racket Developers list: http://lists.racket-lang.org/dev
[racket-dev] Update libffi to 3.1
Hello all, I submitted a commit for updating the libffi, I tested it and it works fine: https://github.com/plt/racket/pull/806 Any suggestion, please talk to me :) Thank you. _ Racket Developers list: http://lists.racket-lang.org/dev