Christopher Lemmer Webber is a user on octodon.social. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.

Probably the thing I think Racket does most right which is actionable in Guile: hashmaps.

- Immutable hashmaps included by default
- Immutable hashmaps are included in the read/write syntax, so there's no temptation to use an alist when it isn't appropriate
- No hash-ref vs hashq-ref vs hashv-ref! The hashmap knows what "type" it is. This is the source of many subtle errors in Guile, IME.

The way to do it:

- add a immutable hashmaps to Guile
- have them do the right thing with hash-set/hash-ref (they should know what type they are)
- Add hashes to the *default* read syntax in Guile.

@cwebber how does the current syntax looks like? (how can it look if it's Lisp and not Clojure?)

@charlag It's pretty nice syntax, and no less lispy than the vector read syntax:

'((foo . bar) (baz . basil))

@charlag Also I'd consider the syntax above to be *considerably* lispier than Clojure's

@cwebber yeah, I meant that Clojure introduced a lot of syntax (which is not really Lispy but is easier to read probably).
I didn't understand that syntax you posted, unfortunately, but I guess it's me not having enough experience.

Christopher Lemmer Webber @cwebber

@charlag so an alist looks like this, right?

;; a list of cons cells where the
;; car is the key and cdr is the value
'((foo . bar) (baz . basil))

A Racket hashmap is just like this but with or or prepended (depending on the equality check of equal, eq, eqv)

'((foo . bar) (baz . basil))

So I say this is pretty lispy since in Guile vectors look like:

'#(foo bar baz)

· Web · 0 · 0

@charlag maybe it would be clearer if I showed:

'((key1 . val1) (key2 . val2))

@cwebber oh, you didn't have to, but thanks, it is clear now!