
Hi all. Thank you for the details. I think my play here should be to go heads down on it again, then come up for air for another review.

@popa.bogdanp interesting app :smile: i have litternally today just been investigating racket ffi objc stuff :smile:

the UI looks remarkably similar to spotlight. are you piggy backing of spotlight at all ?

Nope! You’re right that it’s basically a carbon copy of Spotlight UI-wise, but I’m just composing a couple APIs to imitate Spotlight’s UI.
The relevant code is:
• https://github.com/Bogdanp/remember/blob/master/cocoa/remember/remember/ContentView.swift#L25 and • https://github.com/Bogdanp/remember/blob/master/cocoa/remember/remember/VisualEffectBackground.swift#L12

cool :slightly_smiling_face: before i go digging, do you do any ffi -> native SDK stuff ??

I had initially started out using objc ffi to build the UI but realized that I’d end up having to write Objective-C-but-in-Racket so I figured going with a Swift shell that talks to a Racket core would be easier.

If the UI weren’t so out of the ordinary and if I didn’t need stuff like the ability to bind a custom global hotkey or launch the app at login then building the UI in Racket might’ve made more sense.

Possibly a lot less frustrating, too, because I find apple’s documentation to be lackluster.

Here’s my initial proof-of-concept where I did do some objc ffi:
https://gist.github.com/Bogdanp/3fa6dec42a9bd7fa4422e0e0cd1cd23b#file-remember-poc-rkt-L54

Thanks! :smile:

today I learned that you can’t make a variable-like match expander, like you can make variable-like macros

@notjack that seems like it would be weird since identifiers are binders in match

example: (define-match-expander empty-sequence
(syntax-parser [_:id #'(? sequence? (app sequence-length 0))]))
> (match (list 1 2 3)
[empty-sequence 'empty!]
[_ 'not-empty!])
'empty! ; oh dear :(

@samth for context, this is what I wanted to make work: (define-enum-type direction (up down left right))
(define-tuple-type point (x y))
(define (point-move pt dir amount)
(match-define (point x y) pt)
(match dir
[up (point x (+ y amount))]
[down (point x (- y amount))]
[left (point (- x amount) y)]
[right (point (+ x amount) y)]))
I can do it with ==
patterns instead of bare identifiers, but sadly that means custom enum types are second class citizens to built-in types, since they don’t get a “literal” match pattern the way numbers, characters, strings, and symbols do

I think it’s accurate that self-quoting data is special in match, but I feel like that’s one of many places that’s it’s special in Racket in general. Maybe this is a bad thing, but it’s pretty pervasive.

True

==
patterns it is then