
At the same time, it could well be implemented this way when you use vector-copy
and friends, i.e., copy-on-write. I don’t know how it’s implemented though

Someone mentioned Richard Gabriel’s “The Why of Y” in another thread. I’d be curious to see what the following looks like in Rhombus: #lang racket
(define ((fac q) n)
(if (< n 2)
1
(* n (q (- n 1)))))
(define Y (λ (f)
(let ([ g (λ (h)
(λ (x)
((f (h h)) x))) ])
(g g))))
((Y fac) 10)

#lang rhombus
let factMaker:
fun (fact):
fun (n):
if n < 2:
\| 1
\| n * fact(n - 1)
let Y:
fun (f):
let g:
fun (h):
fun (x): f(h(h))(x)
g(g)
let fact: Y(factMaker)
fact(10)
My indentation on if
branches is probably “wrong” according to the current proposal, but I like it this way.
Note that I used let
everywhere. Using define
is kinda “cheating”, because you can accidentally use recursion.

Awesome - thanks!

Oh I was wondering why you didn’t use fun
more often. That makes sense.

More often for the top level forms that is

Fun fact: fact benchmarks now contain fun fact.

@ben.knoble brought up on Discord that places don’t inherit (current-directory)
and I wrote up a feature request (https://github.com/racket/racket/issues/3965) if anyone wants to chime in on this.

@gamburg.m has joined the channel

If anybody is kind enough with their time could you give me some feedback on my GitHub? One question I’m trying to answer is if These projects are good enough to get software engineering interviews. There are some projects in racket and Common Lisp and Python. thanks. Here’s my GitHub: http://github.com/jobhdez\|github.com/jobhdez

it doesn’t need to be copy-on-write, there just needs to be two subtypes of vector?
- one for real vectors and one for subvector views