spdegabrielle
2020-6-4 10:49:11

Safari is complaining about the cert used for htdp - not sure where to report it?


soegaard2
2020-6-4 10:50:18

soegaard2
2020-6-4 10:50:30

My Safari doesn’t show a warning.


spdegabrielle
2020-6-4 10:51:24

https://www.htdp.org if that is an important distinction - as linked from the racket site


soegaard2
2020-6-4 10:52:00

On that address I see the warning too.


spdegabrielle
2020-6-4 10:52:47

cool. I’ll log it agains the website repo.


soegaard2
2020-6-4 10:53:45

Chrome has a similar warning.


spdegabrielle
2020-6-4 10:59:43

gknauth
2020-6-4 14:57:20

Slideshow. Every time I want to make a new slideshow (as I am for a talk tomorrow), I think, “What are the cool kids doing with it now?” The most obvious thing to do is to look at @mflatt’s talks, recent or not. Then I got to thinking, is there a repository of cool slideshow presentations or effects? Should there be? (E.g., such things exist for TeX Showcase, TikZ, etc.) What people do with slideshow is quite a bit more than what the documentation initially suggests. Maybe just an index or FAQ to start?


samth
2020-6-4 14:59:52

I suggest creating a repo with links to cool presentations, or a wiki page on the github wiki


spdegabrielle
2020-6-4 15:19:47

I think jay had some nice ones


spdegabrielle
2020-6-4 15:20:31

and i think i remember matthew did one that used pict3d


spdegabrielle
2020-6-4 15:22:26

leif
2020-6-4 16:00:02

@spdegabrielle I’d also email Matthias directly.


leif
2020-6-4 16:00:14

Or, if you’d like, I can tell him about it at my meeting with him this evening.


spdegabrielle
2020-6-4 16:01:04

you mean the htdp thing?


leif
2020-6-4 16:01:58

Yes


spdegabrielle
2020-6-4 16:03:59

the racket website now has the working link (sans www) and Matthew pinged https://github.com/shriram\|@shriram on github because http://www.htdp.org\|www.htdp.org points to http://shriram.github.io\|shriram.github.io.


spdegabrielle
2020-6-4 16:04:17

But say ‘Hi’ for me :slightly_smiling_face:


spdegabrielle
2020-6-4 16:04:50

And thank you (to you).


spdegabrielle
2020-6-4 16:06:19

leif
2020-6-4 16:07:01

Ummm….technically yes, somewhere or other.


leif
2020-6-4 16:07:09

But honestly that library is really old.


leif
2020-6-4 16:07:22

If you want though, I’ll go dig up some old talk I’ve given


leif
2020-6-4 16:07:47

spdegabrielle
2020-6-4 16:07:57

Thank you!


mflatt
2020-6-4 16:08:30

We originally tried to point both http://htp.org\|htp.org and http://www.htdp.org\|www.htdp.org at a GitHub page, and that doesn’t work. We’ve known about this for a few days, but plan A hasn’t panned out, so far. We’re probably moving on to plan B, which involves changing DNS providers (not just the DNS configuration).


spdegabrielle
2020-6-4 16:14:28

I’m just happy the broken links are gone from http://racket-lang.org\|racket-lang.org


samth
2020-6-4 16:14:52

@greg is it plausible to jump to definitions of functions defined in the expander (ie, where the binding is from #%kernel but if you looked at expander/main you could go to the definition from there)?


spdegabrielle
2020-6-4 16:21:07

spdegabrielle
2020-6-4 16:23:29

gknauth
2020-6-4 16:24:06

Thank you @spdegabrielle!


spdegabrielle
2020-6-4 16:24:27

please update it if you find anything else.


gknauth
2020-6-4 16:24:46

You bet.


greg
2020-6-4 17:23:18

@samth What is expander/main?


dcmicoltacespedes
2020-6-4 17:29:14

@dcmicoltacespedes has joined the channel


samth
2020-6-4 17:32:05

https://pkgs.racket-lang.org/package/expander but also it’s in racket/src/expander in a git checkout


badkins
2020-6-4 17:37:11

The documentation for 4.3 Strings states: “String constants generated by the default reader (see Reading Strings) are immutable, and they are interned in read-syntax mode.” I have a large hash which may have a number of missing values. Am I correct in assuming that using either "" or a symbol to represent the missing values is equally efficient?


jaz
2020-6-4 17:39:04

More or less, yes. But it would be more efficient not to map those keys in the hash at all.


jaz
2020-6-4 17:39:47

That’s basically the point of the third argument to hash-ref.


badkins
2020-6-4 17:40:12

Constructing such a hash seems wildly inconvenient though.


jaz
2020-6-4 17:40:29

Constructing what kind of hash?


badkins
2020-6-4 17:41:39

One in which you may, or may not, have certain keys. My constructor looks like: (hash 'key1 (foo ...) 'key2 (bar ...) ...) So it’s much easier to have the various functions return a value.


samth
2020-6-4 17:42:41

In that situation I usually write a function that adds things to the hash only when the value is there


badkins
2020-6-4 17:43:29

So functionally set the keys individually?


badkins
2020-6-4 17:44:33

I suppose I could functionally construct an a-list. I’ll have to think through the implications, but I think in my case, it would be much more convenient for the users of this hash to not have to always supply a default value to hash-ref


badkins
2020-6-4 17:49:04

I failed to mention that this hash will eventually be turned into a JSON object.


jaz
2020-6-4 17:52:46

Oh, well, if the JSON object is expected to have certain keys, then yeah, you should put them in.


dcmicoltacespedes
2020-6-4 17:53:14

Good afternoon, I have a question. ¿Can I use arrays in racket as in C? and ¿how?


jaz
2020-6-4 17:53:42

@dcmicoltacespedes 1-dimensional arrays are known as “vectors” in Racket.


jaz
2020-6-4 17:54:47

You can construct one with make-vector, get a value at an index with vector-ref and set a value at an index with vector-set!. It’s rather more verbose than C’s notation.



greg
2020-6-4 18:09:24

Thanks! (I did a raco fc expander and also a open require path “expander” but neither found that.)


dcmicoltacespedes
2020-6-4 18:30:14

Excuse me, ¿could you show me an example of how it works?, thanks


soegaard2
2020-6-4 18:32:32

> (define v (vector 10 'a "foo")) > (vector-ref v 0) 10 > (vector-ref v 1) 'a > (vector-length v) 3 > v (vector10 'a "foo") > (vector-set! v 1 'b) (vector 10 'b "foo")


jaz
2020-6-4 18:34:20

So, in the example above, (vector-ref v 0) corresponds to v[0] in C.


jaz
2020-6-4 18:36:12

And (vector-set! v 1 'b) corresponds to v[1] = make_symbol("b") (here I’m just imagining some make_symbol function).


jaz
2020-6-4 18:38:03

(vector 10 'a "foo") is like racket_value v[3] = { 10, make_symbol("a"), "foo" } — if we disregard memory allocation.


jaz
2020-6-4 18:38:18

And types


leif
2020-6-4 19:11:07

@soegaard2 & @dcmicoltacespedes The Racket Guide has a (slightly) more gentle intro to vectors: https://docs.racket-lang.org/guide/vectors.html


leif
2020-6-4 19:11:36

(As opposed to the Racket Reference, which is what @jaz linked too.)


leif
2020-6-4 19:11:38

to*


soegaard2
2020-6-4 19:12:54

@leif Good point. The guide is recommended. (Although I am not too fond of the use of literal #(…) syntax instead of `(vector …).


dcmicoltacespedes
2020-6-4 19:19:54

(…) and (vector..), are the same or there are differences?. and other question. Why in this example "(vector-ref #(“a” “b” “c”) 1)" return “b” and not “a”?


samth
2020-6-4 19:20:18

vector indexes start at 0


jaz
2020-6-4 19:27:09

There are differences between #(...) and (vector ...). The first is a literal datum. The second is a reducible expression. The #(...) form is immutable and its contents are also data. So #(a b c) is an immutable vector that contains three symbols. (vector 'a 'b 'c) is a mutable vector containing those same symbols in the same order.


soegaard2
2020-6-4 19:34:15

> (define x 42) > (define v #(1 x)) > (define w (vector 1 x)) > v (vector 1 'x) > w (vector 1 42)


leif
2020-6-4 19:37:02

I’m sure you know this, but:

> (define x 42) > `#(1 ,x) > (vector 1 42)


leif
2020-6-4 19:37:19

But now you’ve added more symbol soup to the mix.


spdegabrielle
2020-6-4 20:13:20

Just came through on Reddit..any suggestions?


dcmicoltacespedes
2020-6-4 22:31:16

hi, sorry to bother again :sweat_smile: but i am new in racket and i want to make a game i made in C, a domino, but in racket. So i have another question, ¿how do i use randomize? is that it gives me an error, it says that it is an independent function or something like that. Thank you.


jaz
2020-6-4 22:36:50

Can you post an example of what you mean?


dcmicoltacespedes
2020-6-4 22:51:01

for example I write this (randomize [(list 1 2 3 4)]) or this (randomize [1 2 3 4]). And this message appears to me “randomize: unbound identifier in: randomize”. The other thing, I don’t know if I’m using that function well


dcmicoltacespedes
2020-6-4 22:52:01

I was thinking of using that function in a list of structures


jaz
2020-6-4 22:53:01

The only randomize function I see in the documentation comes from a language called “heresy.” You should probably instead use the shuffle function.


jaz
2020-6-4 22:53:42

#lang racket (shuffle (list 1 2 3 4))


dcmicoltacespedes
2020-6-4 22:58:32

Oh thanks. So ¿what is randomize for?


jaz
2020-6-4 23:02:01

randomize (if it’s the one I think) is for creating a random number generator that will be used by the heresy language runtime. You would only use it if you want to write heresy programs, not racket programs.


jaz
2020-6-4 23:02:34

It doesn’t look like it has anything to do with your use case at all.