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


My Safari doesn’t show a warning.

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

On that address I see the warning too.

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

Chrome has a similar warning.

Thanks I’ve added that to the issue https://github.com/racket/racket-lang-org/issues/125 temporary fix Pr at https://github.com/racket/racket-lang-org/pull/126

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?

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

I think jay had some nice ones

and i think i remember matthew did one that used pict3d


@spdegabrielle I’d also email Matthias directly.

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

you mean the htdp thing?

Yes

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.

But say ‘Hi’ for me :slightly_smiling_face:

And thank you (to you).

@leif do you have any examples of https://github.com/LeifAndersen/slideshow-pretty\|slideshow-pretty?

Ummm….technically yes, somewhere or other.

But honestly that library is really old.

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


Thank you!

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).

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

@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)?



Thank you @spdegabrielle!

please update it if you find anything else.

You bet.

@samth What is expander/main
?

@dcmicoltacespedes has joined the channel

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

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?

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

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

Constructing such a hash
seems wildly inconvenient though.

Constructing what kind of hash?

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.

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

So functionally set the keys individually?

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

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

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

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

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

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.

But here’s the API documentation: https://docs.racket-lang.org/reference/vectors.html?q=vector#%28def._%28%28quote._~23~25kernel%29._vector%29%29

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

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

> (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")

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

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

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

And types

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

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

to*

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

(…) 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”?

vector indexes start at 0

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.

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

I’m sure you know this, but:
> (define x 42)
> `#(1 ,x)
> (vector 1 42)

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

Just came through on Reddit..any suggestions?

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.

Can you post an example of what you mean?

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

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

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

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

Oh thanks. So ¿what is randomize for?

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.

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