kokou.afidegnon
2019-7-14 10:56:32

@kokou.afidegnon has joined the channel


kokou.afidegnon
2019-7-14 11:01:15

hi all,


kokou.afidegnon
2019-7-14 11:02:45

how do i launch the custom html browser with this package ? https://docs.racket-lang.org/browser/index.html


kokou.afidegnon
2019-7-14 11:04:46

i can’t find a working example


kokou.afidegnon
2019-7-14 11:16:07

i was able to draw a GUI but how do i incorporate the browser library?


soegaard2
2019-7-14 12:37:37

@alexender Run this program in DrRacket: #lang racket (require browser) (open-url "<http://www.google.com>")


soegaard2
2019-7-14 12:38:55

Don’t expect too much. The browser library is very old. It doesn’t handle JavaScript.


kokou.afidegnon
2019-7-14 13:20:04

yes, i just noticed that now


kokou.afidegnon
2019-7-14 13:20:23

is there an alternative? or any way to render Js as well?


philip.mcgrath
2019-7-14 13:21:31

send-url will open the user’s web browser


kokou.afidegnon
2019-7-14 13:29:50

i am looking for a way to manipulate the DOm nodes


mflatt
2019-7-14 14:43:14

Day 2 starts in about 40 minutes: https://www.youtube.com/watch?v=dnz6y5U0tFs


mflatt
2019-7-14 14:43:54

No professional videographers today, though


samth
2019-7-14 14:54:33

@pocmatos @soegaard2 (or others watching online): please let us know about problems with the video/audio today, since it’s just us with Matthew’s laptop


soegaard2
2019-7-14 14:57:45

Will do.


samth
2019-7-14 15:24:24

@soegaard2 how is it currently?


soegaard2
2019-7-14 15:26:02

There is sound.


samth
2019-7-14 15:27:06

great


jeapostrophe
2019-7-14 15:31:40

This is the hackathon page I mentioned: https://github.com/racket/racket/wiki/Racket-Hackathon-2019


dnaeon
2019-7-14 16:10:50

Hey all. How would I remove multiple keys from an immutable hash table? I wasn’t able to find anything about it in the documentation, so I made my own procedure for it, but I still think there’s probably something in the stdlib, which does this, it’s just that I haven’t found it.


samth
2019-7-14 16:12:02

@dnaeon there’s not a std library function that does that


jeapostrophe
2019-7-14 16:15:48

we’d call it hash-remove* though :slightly_smiling_face:


notjack
2019-7-14 16:18:38

@jeapostrophe FYI I added a section to the hackathon wiki linking to a checklist of data-science related issues in the repo I’ll be working on


notjack
2019-7-14 16:18:46

also I think we should call that hash-remove-all :P


jeapostrophe
2019-7-14 16:19:24

remq vs remq*


jeapostrophe
2019-7-14 16:19:30

We use * more than -all as a suffix


jeapostrophe
2019-7-14 16:19:38

And my favorite color is Orange


notjack
2019-7-14 16:20:56

I think we shouldn’t do that in new APIs. It’s difficult to learn (especially for beginners) and not discoverable.


notjack
2019-7-14 16:21:08

and my favorite color is blue


notjack
2019-7-14 16:22:00

which, coincidentally, I’m pretty sure is chromatically opposite to orange


jaz
2019-7-14 16:22:58

at least * won’t conflict with our new, buttery infix syntax, since the multiplication operator will surely be ×


dnaeon
2019-7-14 16:23:24

@samth @jeapostrophe thanks, that means I didn’t overlook the documentation :slightly_smiling_face: do you think submitting a PR for such a function makes sense?


jeapostrophe
2019-7-14 16:23:37

Yes


soegaard2
2019-7-14 16:23:41

Thanks for streaming Flatt’s talk. It worked great.


pocmatos
2019-7-14 16:34:16

Indeed! Thanks to @mflatt for the shoutout to the newsletter!


notjack
2019-7-14 16:40:02

And thank you @pocmatos for writing the newsletter!


notjack
2019-7-14 16:51:23

Here’s the wiki page for the racketcon hackathon: https://github.com/racket/racket/wiki/Racket-Hackathon-2019


notjack
2019-7-14 18:15:03

Here’s something related to what I’ll be working on for the data science hackathon: &gt; (require rebellion/streaming/reducer) &gt; (reduce into-sum 1 2 3 4 5) 15 &gt; (reduce-all into-sum (in-range 1 100)) 4950 &gt; (define into-product (make-fold-reducer * 1)) &gt; (reduce-all into-product (in-range 1 20)) 121645100408832000 &gt; (for/reducer into-product ([n (in-range 1 20)] #:when (even? n)) n) 185794560 &gt; (define-syntaxes (for/product for*/product) (make-reducer-based-for-comprehensions #'into-product)) &gt; (for/product ([n (in-range 1 20)] #:when (even? n)) n) 185794560


notjack
2019-7-14 18:16:53

(If you want to ask me about it, I’m sitting at the leftmost table in the front row - come say hi!)


markus.pfeiffer
2019-7-14 19:14:10

:wave: from SLC Airport. Thanks all for this incredible week. Kind of a shame that I had to leave before the hacking started. Maybe I can make it to one of the european meetups.

(also, I really should find whether there’s appetite for racketeers to meet up in Scotland. I know there’s some meetups in Edinburgh)


markus.pfeiffer
2019-7-14 19:45:44

My first reaction to the “lets change the syntax” proposal was btw “I hate it” :wink:. If I have a more substantiated opinion I’ll post it on the github/mailinglist as appropriate


kokou.afidegnon
2019-7-14 20:11:08

hi, apart from the browser package in racket, what do you suggest? i m trying to create a sort of DOM node builder where clicking on a particular html element should give a hint of a specific source code, which can be manipulated via macros…. something a la dreamweaver


spdegabrielle
2019-7-14 21:02:46

Just made https://github.com/racket/racket/wiki/Data-Science - can anyone suggest relevant racket packages and other resources; example code, demos, blog posts, etc.?


drdeeglaze
2019-7-14 21:08:29

neilv’s csv pkg?


soegaard2
2019-7-14 21:14:19


spdegabrielle
2019-7-14 21:26:08

Awesome thank you


soegaard2
2019-7-14 21:27:58

soegaard2
2019-7-14 21:37:21

Also if you need an idea for a math-related Racket project: pick something from https://github.com/racket/racket/wiki/Math-Library-Features


drdeeglaze
2019-7-14 21:47:40

How do you test a change to a pkg that you’re modifying a clone of? I’m changing pict, but when I build the docs, it’s already downloaded and installed pict in /root/.racket/7.3/pkgs/pict-*


alexknauth
2019-7-14 22:07:16

Is there a way to make a template-metafunction act like a conditional?

Like an ~if metafunction that would act like this: {~if c t e} to produce t if c is true, and e if c is false.

And is there a way this can work if either t or e (whichever one wouldn’t be used) has an attribute value of false? (syntax-parse #'(1 2) [{~or {~and (a) {~parse c #true}} {~and (a b) {~parse c #false}}} #'{~if c a b}]) ;=&gt; 2 (syntax-parse #'(1) [{~or {~and (a) {~parse c #true}} {~and (a b) {~parse c #false}}} #'{~if c a b}]) ;=&gt; 1 I want it to “short circuit” in the same way that if short-circuits and only evaluates the branch it needs to


lexi.lambda
2019-7-14 22:14:07

@alexknauth Template metafunctions are metafunctions, not macros, so I think the answer is “no,” you can’t make it short-circuiting like that. I’d like to have “template transformers,” and to be honest those seem more useful than metafunctions to me, but I don’t believe anything like that exists.


alexknauth
2019-7-14 22:18:10

How would template transformers help with something like ~if?


lexi.lambda
2019-7-14 22:22:26

Oh, perhaps you’re right, maybe they wouldn’t help on their own. I was thinking they could expand into something with unsyntax. I don’t know if that is wise or not.


lexi.lambda
2019-7-14 22:25:34

I guess expanding into unsyntax wouldn’t work if you’re under ellipses. I’ve wanted an ~if before, so maybe baking it in would be a good idea. There’s probably a more general solution, but I don’t know if it’s worth it.


alexknauth
2019-7-14 22:28:50

Maybe it would be enough to have a ~delay built in somehow, with metafunctions able to force sub-syntax-objects


spdegabrielle
2019-7-14 23:29:02

done. Thank you.


spdegabrielle
2019-7-14 23:31:21

done. Thank you


spdegabrielle
2019-7-14 23:43:23

Not added to wiki. not quite sure how to put it in.


spdegabrielle
2019-7-14 23:46:29

@soegaard2 My suggestion would be to pop it in a repo on github with a little readme on contributing. Does that sound reasonable? I can do it for you but thought it should be your repo.


spdegabrielle
2019-7-14 23:50:45

I’d like to know the answer to this too.


samth
2019-7-15 00:54:48

You want to have the version of the package that you’re modifying be the one that’s installed


samth
2019-7-15 00:54:58

See raco pkg update —clone


ryanc
2019-7-15 01:07:47

@alexknauth no, you can’t do that with template metafunctions. It wouldn’t be hard to add something like ~if directly if there’s a good justification for it, but I don’t want to gradually slide into creating a general-purpose programming language within syntax templates. (eg, “you know, ~if would be a lot more useful if we also had ~let…”)


alexknauth
2019-7-15 01:19:18

Would something like ~delay be a reasonable addition?


rokitna
2019-7-15 02:40:13

It’s already felt like most of a general-purpose language. :) But then I was under the misconception that template metafunctions were transformers, so I suppose my feelings were miscalibrated. XD


notjack
2019-7-15 03:31:39

What does it mean when a module path index prints like #&lt;module-path-index='vector[7223]&gt;, and module-path-index-split returns (values #f #f), and module-path-index-submodule returns #f?


markus.pfeiffer
2019-7-15 06:48:43

used the flight to do some hacking on his GAP language implementation and made it more elegant


markus.pfeiffer
2019-7-15 06:48:50

well at least I think I made it more elegant


markus.pfeiffer
2019-7-15 06:49:19

I could even debug macros now and not just randomly poke at them until it seemed to work. go racket school!