Re: [racket-users] Help with generators from python land!

2019-02-20 Thread Jon Zeppieri
On Wed, Feb 20, 2019 at 9:14 PM Dave McDaniel wrote: > Thanks Jon and Jen, This is a great! I figured there must be a > straightforward way to do this with a `for/hash` implementation. I have > not seen these 2 methods `in-hash` and `in-list` vs just using the hash or > list without that

Re: [racket-users] raise an exception in a generator

2019-02-20 Thread Kees-Jochem Wehrmeijer
> > Yes, you could define an impersonator property and then wrap your > generator with `impersonate-procedure`: > This is amazing! I feel it now does exactly what I want. Thanks! > > > > #lang racket > (require (except-in racket/generator yield) >

Re: [racket-users] Help with generators from python land!

2019-02-20 Thread Dave McDaniel
Thanks Jon and Jen, This is a great! I figured there must be a straightforward way to do this with a `for/hash` implementation. I have not seen these 2 methods `in-hash` and `in-list` vs just using the hash or list without that sequence modifier. Can you comment on what is going on with

Re: [racket-users] raise an exception in a generator

2019-02-20 Thread Matthew Butterick
> On Feb 20, 2019, at 4:29 PM, Kees-Jochem Wehrmeijer wrote: > > With your define/ideal-world form, is there a way to test whether something > was created using that form? E.g. by generating a predicate like ideal-world? > That way I can make sure with a contract that my function gets passed

Re: [racket-users] raise an exception in a generator

2019-02-20 Thread Kees-Jochem Wehrmeijer
> You can make a new `define` form where `yield` means something different: > Ha that's really cool! I definitely need to read up more on the different macro tricks. I'm new to Racket (my nearest experience is in Clojure), so David's point about looking for idiomatic ways is well taken. There's

Re: [racket-users] raise an exception in a generator

2019-02-20 Thread Kees-Jochem Wehrmeijer
> You would know better than I would, but I wonder if you are making an > effort to bring familiar constructs into Racket that don't really fit, > instead of looking for more idiomatic ways to do what you want. > Yeah, I know what you mean. It's always a struggle to remain both concise, but at

Re: [racket-users] raise an exception in a generator

2019-02-20 Thread Matthew Butterick
> On Feb 20, 2019, at 8:47 AM, Kees-Jochem Wehrmeijer wrote: > > While this scheme works, it silently breaks if a user accidentally calls > (yield) instead of ((yield)). It might not be a big deal, but in an ideal > world I'd only allow the 'correct' way. You can make a new `define` form

Re: [racket-users] raise an exception in a generator

2019-02-20 Thread David Storrs
On Wed, Feb 20, 2019 at 11:48 AM Kees-Jochem Wehrmeijer wrote: > > Yeah, that works. I came up with a similar scheme where if the value that's > passed to the generator is an exception, it will raise it. Your scheme is a > little simpler, but for completeness I listed mine below too. One thing

Re: [racket-users] "table" data structure in Racket

2019-02-20 Thread travis . hinkelman
Hi All, I'm resurrecting this thread to ask if anyone in the Racket community has Apache Arrow on their radar. It seems like Apache Arrow might be gaining steam. Apache Arrow is a cross-language development platform for in-memory data. > It specifies a standardized language-independent

Re: [racket-users] Help with generators from python land!

2019-02-20 Thread Jon Zeppieri
On Wed, Feb 20, 2019 at 5:08 PM Jon Zeppieri wrote: > > (define (reverse-hash h) > (for*/fold ([result (hash)]) > ([(score letters) (in-hash h)] > [letter (in-list letters)]) > (hash-set result letter score))) > > As with Jens's answer, we can use `for*/hash`

Re: [racket-users] Help with generators from python land!

2019-02-20 Thread Jens Axel Søgaard
Den ons. 20. feb. 2019 kl. 22.25 skrev Dave McDaniel : > Hello, > > I have interest in picking up racket and have done some koans and also > have been doing the racket track on exercism. > > There is a fairly simple exercise called `etl` on exercism related to > taking a hash for scoring scrabble

Re: [racket-users] Help with generators from python land!

2019-02-20 Thread Jon Zeppieri
On Wed, Feb 20, 2019 at 4:25 PM Dave McDaniel wrote: > Hello, > > I have interest in picking up racket and have done some koans and also > have been doing the racket track on exercism. > > There is a fairly simple exercise called `etl` on exercism related to > taking a hash for scoring scrabble

[racket-users] Help with generators from python land!

2019-02-20 Thread Dave McDaniel
Hello, I have interest in picking up racket and have done some koans and also have been doing the racket track on exercism. There is a fairly simple exercise called `etl` on exercism related to taking a hash for scoring scrabble letters and unpacking it into a flatter, more efficient

Re: [racket-users] How do you make students submit programming assignments online for automatic tests?

2019-02-20 Thread 'John Clements' via Racket Users
Github Classroom is trying to do this, but they’re not doing it well. I’ve used it several times, and managed to make it work, but the experience has been very me-programming-heavy, and not so great for the students. I think gradescope may have just merged with a company that’s trying to

[racket-users] How do you make students submit programming assignments online for automatic tests?

2019-02-20 Thread Marc Kaufmann
Hi all, I will be teaching a course on data analysis in R next year (September), and may at some point add some Racketeering to my other courses (maybe), and I was wondering how those of you who teach programming classes deal with programming assignments. Are there somewhat

Re: [racket-users] raise an exception in a generator

2019-02-20 Thread Kees-Jochem Wehrmeijer
Yeah, that works. I came up with a similar scheme where if the value that's passed to the generator is an exception, it will raise it. Your scheme is a little simpler, but for completeness I listed mine below too. One thing I'm still a little unhappy with is that whoever uses it, needs to remember

Re: [racket-users] web-server/http documentation: "You are unlikely to need to construct a request struct." Why?

2019-02-20 Thread Marc Kaufmann
OK, so there is no reason for me to leave the racket world for that type of tests. Thanks. On Wed, Feb 20, 2019 at 4:25 PM Jay McCarthy wrote: > On Wed, Feb 20, 2019 at 10:23 AM Marc Kaufmann > wrote: > > I came across this statement regarding structure request in the > documentation: "You are

Re: [racket-users] web-server/http documentation: "You are unlikely to need to construct a request struct." Why?

2019-02-20 Thread Jay McCarthy
On Wed, Feb 20, 2019 at 10:23 AM Marc Kaufmann wrote: > I came across this statement regarding structure request in the > documentation: "You are unlikely to need to construct a request struct." (See > here.) > > Why does it say this? I want to generate requests (in one form or another) > for

[racket-users] web-server/http documentation: "You are unlikely to need to construct a request struct." Why?

2019-02-20 Thread Marc Kaufmann
Hi all, I came across this statement regarding structure request in the documentation: "You are unlikely to need to construct a request struct." (See here .) Why does it

Re: [racket-users] Transfer code from "intermediate student with lamnda" to "Pretty big"

2019-02-20 Thread Matthias Felleisen
See previous email exchanges and the require necessary to import the tests (test-engine/racket-tests) plus the call to the test function. > On Feb 19, 2019, at 2:26 PM, orenpa11 wrote: > > Hi > Is it possible to transfer code from "intermediate student with lamnda" to > "Pretty big" >

[racket-users] Scribble: How to change the text for index and table of contents

2019-02-20 Thread xh
Hi, all I want to change the output text for index and table of contents, which are "Index" and "Contents". I found the value was defined in https://github.com/racket/scribble/blob/master/scribble-lib/scribble/html-render.rkt#L937, but is there a way to modify the value in my document source