Re: [racket-users] Trying to understand the module system.

2018-08-04 Thread Philip McGrath
There are several different issues here, but I'll try to touch on a few of them. On Sat, Aug 4, 2018 at 9:33 AM, Alex Gian wrote: > Say I have written a little library, perhaps of various maths utilities. > … I have also made this an installable #lang, lets's call it '#lang rat' > (for

Re: [racket-users] Trying to understand the module system.

2018-08-04 Thread Alex Gian
Well, here we are: the essence of the problem lies in that scmutils defines certain modules, "environments" as it calls them, which it then proceeds to augment or access from other locations with gay abandon. One use of this, for instance, is switching between the genericised and the explicit

Re: [racket-users] parameterize and keyword - doable?

2018-08-04 Thread Greg Hendershott
Do you mean that in something like this: (for/sum ([x '(1 2 3 4 5)] #:unless (odd? x)) x) ;6 You have many occurrences of the `(odd? x)` and you'd like to define that in one place that you can vary? If so: First, if they're in the same local scope, you could use `let`:

Re: [racket-users] parameterize and keyword - doable?

2018-08-04 Thread Sanjeev Sharma
the specific case I had in mind was near this (let ([unless? odd?]) (for/sum ([x '(1 2 3 4 5)] #:unless (uless? x)) x)) ;6 but as long as one is defaulting #:unless PLUS #unless is common to all the for's across some arbitrary scope, ideally one could

Re: [racket-users] Trying to understand the module system.

2018-08-04 Thread Alex Gian
Hi Greg Maybe I've got this wrong, but the way I understand it is that (apart from an actual language) #lang can be used for a development environment that is independent in some unique way. If I'm not mistaken even SICP is a #lang, and some old Scheme books too, never mind the heaps of

[racket-users] Racket PEG parser library release 0.3

2018-08-04 Thread rain1
Hello! Released by PEG parser library version 0.3 today. It has got semantic actions now, which lets you parse and transform at the same time. I hope the code is useful and interesting to you. It can easily be installed via the racket package manager as "peg" and there are docs here: -

off-topic: on ``[racket-users]'' not added to this subthread (Was: Re: Parameters considered often harmful (was: Re: [racket-users] Re: A (long) question regarding parameters and scope))

2018-08-04 Thread Robert Girault
Why didn't [racket-users] tag get added to John Clements' message ``Parameters considered often harmful''. Was it because the tag was already contained in the subject? Is that how Google Groups avoids always adding the tag forever? I wonder why they don't use message headers to know whether

Re: [racket-users] Trying to understand the module system.

2018-08-04 Thread Greg Hendershott
Hi, Alex. This sounds fun! > - re rat: just humour me on this, it's a temporary name anyway, until the > full deployment of the project, which incidentally, is the Racket port of > scmutils > - following from the above, so yes, it will certainly have to be a #lang, no > questions there.

Re: [racket-users] Re: SICM, scmutils, MIT-Scheme, CAS systems, etc, etc...

2018-08-04 Thread Alex Gian
I shouldn't have, really, it was in no state to be uploaded, but out of consideration to the many folks that have helped me so far, I've put it up here . Actually, although it's quite the mess now, once I've sorted out what to do about the "environments"

Re: [racket-users] parameterize and keyword - doable?

2018-08-04 Thread Philip McGrath
On Sat, Aug 4, 2018 at 3:18 PM, Sanjeev Sharma wrote: > but as long as one is defaulting #:unless > PLUS #unless is common to all the for's across some arbitrary scope, > ideally one could elide it from each of the for's within that scope. > Local macros might be part of what you want: #lang

Re: [racket-users] Re: parameterize and keyword - doable?

2018-08-04 Thread Philip McGrath
On Sat, Aug 4, 2018 at 5:26 AM, George Neuner wrote: > On Sat, 4 Aug 2018 00:08:46 -0500, Philip McGrath > wrote: > > >You can call a function with dynamically calculated keyword arguments > using > >keyword-apply > >

[racket-users] Re: Trying to understand the module system.

2018-08-04 Thread Alex Gian
In fact, even this (module polynomial racket (require "pcf.rkt" "fpf.rkt" "rcf.rkt" "pcf-fpf.rkt") (provide (all-from-out "pcf.rkt" "fpf.rkt" "rcf.rkt" "pcf-fpf.rkt")) ) (require 'polynomial) (define ns (module->namespace ''polynomial)) (eval '(poly/make-from-dense 1 '(1 -1)) ns) which is

Re: [racket-users] Trying to understand the module system.

2018-08-04 Thread Alex Gian
Thanks for the reply Phillip - re rat: just humour me on this, it's a temporary name anyway, until the full deployment of the project, which incidentally, is the Racket port of scmutils - following from the above, so yes, it will *certainly* have to be a *#lang*, no questions there. - re

Re: [racket-users] Re: parameterize and keyword - doable?

2018-08-04 Thread George Neuner
On 8/4/2018 7:24 AM, Philip McGrath wrote: On Sat, Aug 4, 2018 at 5:26 AM, George Neuner > wrote: On Sat, 4 Aug 2018 00:08:46 -0500, Philip McGrath mailto:phi...@philipmcgrath.com>> wrote: >and you can create a function that accepts arbitrary or

Re: [racket-users] Re: parameterize and keyword - doable?

2018-08-04 Thread Philip McGrath
I remembered there is also a paper by Matthew Flatt and Eli Barzilay about the design of Racket's keyword argument system, including some of the limitations of symbols-as-keywords systems (especially in sections 6 and 7, "Experience" and "Related Work"). I obviously found it very persuasive.

Re: [racket-users] Using ->i to allow only valid Sneetches for the McBean machine

2018-08-04 Thread Sage Gerard
Just following up to say thank you. I especially appreciated seeing several iterations of this to clarify things. On Mon, Jul 30, 2018 at 6:40 AM Philip McGrath wrote: > Since #t and #f can be used as contracts that recognize only themselves, > you can get a step better in terms of concision: >

[racket-users] Re: parameterize and keyword - doable?

2018-08-04 Thread George Neuner
Hi Philip, On Sat, 4 Aug 2018 00:08:46 -0500, Philip McGrath wrote: >I'm still not sure that I understand what the original questioner is trying >to do. It might help to see an example in code to be clear that we're all >talking about the same thing. I'm not really certain either, but

[racket-users] Trying to understand the module system.

2018-08-04 Thread Alex Gian
A simplified view of the problem I am trying to sort out: Say I have written a little library, perhaps of various maths utilities. There are several files all providing different features. I make them available to the user by 'requiring' them and 'providing' them all from the top-level

[racket-users] current build instructions for racketcs?

2018-08-04 Thread Sanjeev Sharma
I haven't done this in a while & the config / build from src/cs/c/ using racket 7 source with built packages failed this morning. Are the READMEs still up to date? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this

Re: [racket-users] Trying to understand the module system.

2018-08-04 Thread Alex Gian
Well, I can now get a namespace out of any particular module! e.g: > (module->namespace 'rat/src/polynomial/polynomial) # Many, many thanks to those who helped clear this up. Onward now, to see how that will work with eval. And then to see if those scmutils environments can be sensibly