Re: [racket-users] Using expr/c within one syntax class?

2020-12-16 Thread Sage Gerard
Typos: - "*" remove a bound ==> "*" removes a bound - All examples should read (versions ...), not (version ...) ~slg ‐‐‐ Original Message ‐‐‐ On Wednesday, December 16, 2020 6:27 PM, Sage Gerard wrote: > I'm trying to learn how to write syntax classes. My intended macro expresses >

[racket-users] Dynamic-place module-predifined? requirement

2020-12-16 Thread Nathaniel W Griswold
Hello. The docs at https://docs.racket-lang.org/reference/places.html?q=places#(def._((lib._racket%2Fplace..rkt)._dynamic-place)) state: "The module-path argument must not be a module path of the form (quote sym) unless the module is predefined (see module-predefined?).” Is this true? I

[racket-users] Using expr/c within one syntax class?

2020-12-16 Thread Sage Gerard
I'm trying to learn how to write syntax classes. My intended macro expresses a set of Racket versions, either as inclusive intervals or as exact versions. In an interval, "*" remove a bound. - (version "6.5") means exactly version "6.5", as does (version ("6.5" "6.5")) - (versions ("7.0"

Re: [racket-users] compose in Typed Racket

2020-12-16 Thread unlimitedscolobb
Oh wow, that's impressively better than what I wrote! I didn't know one could have *recursive* macros, to say nothing about the proper usage of syntax-parse. Thank you very much for your quick answer! - Sergiu On Wednesday, December 16, 2020 at 11:03:49 PM UTC+1 sorawe...@gmail.com wrote:

Re: [racket-users] compose in Typed Racket

2020-12-16 Thread Sorawee Porncharoenwase
syntax-parse can already perform pattern matching. No need to use match (define-syntax (multi-compose stx) (syntax-parse stx [(_ f:expr g:expr) #'(compose f g)] [(_ f:expr funcs:expr ...) #'(compose f (multi-compose funcs ...))])) On Wed, Dec 16, 2020 at 1:37 PM

Re: [racket-users] compose in Typed Racket

2020-12-16 Thread unlimitedscolobb
On Thursday, December 10, 2020 at 6:01:52 PM UTC+1 unlimitedscolobb wrote: > On Thursday, December 10, 2020 at 5:49:43 PM UTC+1 hen...@topoi.pooq.com > wrote: > > A macro might be able to generate either of the above from >> (comp f g h k) >> . >> > Indeed. I'm re-reading the docs on macros

Re: [racket-users] Permutations ind Racket

2020-12-16 Thread 'John Clements' via Racket Users
Are you using the “How To Design Programs” textbook? It’s free, online, and written by the team that developed Racket: https://htdp.org/2020-8-1/Book/index.html Indeed, it would not be a stretch to say that Racket and this textbook are part of the same project. How To Design Programs (or

[racket-users] Re: Permutations ind Racket

2020-12-16 Thread schle...@gmail.com
Stepping through the code with the drracket debugger and inspecting the values on the way may also be a good way to identify areas where your code doesn't work like you had expected. Maybe write some more testcases / example applications of your function and see which inputs already work and

[racket-users] scheme_eval_string equivalent for racket-cs

2020-12-16 Thread Dan Dexter
I'm porting existing code that is embedding racket and I'm going from racket-bc to racket-cs. In racket-bc, the code is calling scheme_eval_string() and scheme_eval_string_all(). I don't see a direct replacement for these functions in racket-cs. Based on the embedding example in the docs,

Re: [racket-users] Using current-process-memory with 'cumulative argument

2020-12-16 Thread Alex Harsanyi
Thanks for providing the fix. This is most likely the cause, as my own test program is essentially the same as yours, except that I collect the samples separately rather than checking for the memory decrease immediately. Alex. On Wednesday, December 16, 2020 at 10:11:25 AM UTC+8 Matthew