
I just realised it is also here https://racket-lang.org/logo-and-text-1-2.png sadly low-res

@spdegabrielle Is the font “Cooper Hewitt”? https://www.fontsquirrel.com/fonts/cooper-hewitt

Maybe - looking at the racket website repo might be a good way to determine the source and font. In the meantime I have https://racket.slack.com/files/U3QF0EM0E/FNDNA6TJ8/racket-logo.tar.gz

@spdegabrielle A recreation using MetaPict.

If you need to fine-tune the spacing, see https://github.com/soegaard/metapict/blob/master/metapict/examples/racket-logo.rkt#L176

You are the best @soegaard2 :grinning:

Fun little puzzle.

Friends, can someone help me with a Objective-C FFI question? I have an object allocated and initialized like:
(define obj (tell (tell MyObject alloc) init))
And I need to do the equivalent of the following Objective-C:
obj.delegate = self
I haven’t found a way in ffi/unsafe/objc
to set a property in something you’ve allocated.

@andre Is set-ivar!
what you are looking for?

I thought so but this is not a something built with define-objc-class

Maybe object_setInstanceVariable
?

oh thats is new… I haven’t seen that before, let me try. Thanks @soegaard2

@soegaard2 didn’t work. I’m new to Racket and FFI but I think people will get excited by this: I’m building a WebView, like it was suggested to me at the mailing list. I got as far as displaying web pages. This shot is from Racket. The code to use a web view is quite simple:
(define web-view
(new web-view%
[parent panel]))
(send web-view set-url "<https://racket-lang.com>")
I can’t get the delegate to work or access the properties though, but we can display and interact with pages.

@andre That looks very interesting. Hopefully someone knows the solution.

(at the moment it is macOS only. It is wrapping around WKWebView. I’m going to do Windows and Linux at some point as well)

Is it possible to write a minimal example that shows whether “obj.delegate = self” works or not?

I have an example with it not working…

I’m finishing some touches before uploading to GH

then I’ll post a message to the list inviting more eyes into it

:slightly_smiling_face:

:eyes:

uploaded to https://github.com/soapdog/racket-web-view and posted a longer mail to the mailing list. This is my first racket project, also my first FFI project, and I haven’t programmed in Objective-C in 16 years. The fact that it displays pages is surprising me.

@andre I don’t think properties like title
and navigationDelegate
are instance variables. Try getting the title with (tell #:type _NSString webview title)
. Try setting the delegate with (tellv webview setNavigationDelegate: delegate)
.

thanks a ton @mflatt I’ll try that. (I’m new to this stuff)

omg @mflatt it worked.

thanks

I too need some eyes on a problem. Consider this file structure: /listit/server.rkt
/listit/favicons/favicon-32x32.png
When the server runs the url <http://localhost:8000/favicons/favicon-32x32.png>
should serve the file.
However I can’t figure out to get the server to serve the file.
This is how I start the server: (define-runtime-path favicons "favicons")
(define (start)
(serve/servlet dispatch
#:servlet-path "" ; initial to show in browser
#:servlet-regexp #rx"^((?!favicons).)*$"
#:extra-files-paths (list favicons)))
(start)

The regular expression #rx"^((?!favicons).)*$"
ought to match strings that doesn’t contain “favicons”.

Sigh. It must have worked at some point. I have a few browser tabs with the correct logo on. It seems broke again now. If anyone wants to try it out, it is in the listit4
folder: https://github.com/soegaard/web-tutorial/tree/master/listit4

The server is started from server.rkt
and the dispatch rules are here: https://github.com/soegaard/web-tutorial/blob/master/listit4/control.rkt#L143

Ah! This #:extra-files-paths (list favicons)
means that the url /favicon-32x32.png
corresponds to /favicons/favicon-32x32.png
on the disk.

I thought I needed the /favicons/
prefix in urls too.

I’m bookmarking that web tutorial. Between that and Racket Web book I should learn how to do simple web services. :slightly_smiling_face: for those curious about the web-view%
it has a minimal set of features working and documentation available at https://soapdog.github.io/racket-web-view/ I think it might soon be publishable to the catalog.

@notjack is there a facility for Rebellion records to cooperate with generics?

@samdphillips No :( And they can’t, until it’s possible to implement a generic interface when calling make-struct-type
. See https://github.com/racket/racket/issues/1647 and https://github.com/racket/racket/issues/2142

I figured it was something like that.

@samdphillips On the bright side, you encouraged me to write down this sad state of affairs in an issue https://github.com/jackfirth/rebellion/issues/231

@samdphillips were there particular generic interfaces you had in mind? Some of them have both a generic interface and a struct property that can be used to implement them, like how gen:equal+hash
has prop:equal+hash
. Those can be implemented with Rebellion.

I’m starting work on something new and just feeling around the space for record types. So nothing specific. Mostly I was curious if I had my own generic interfaces how they could interact. There is always some other way though.

They’re also missing a lot of other quality-of-life features, including pattern matching, easy contracts, and provide transformers (there’s no record-out
equivalent to struct-out
).

I have issues filed for most of those and know how to implement them, so it’s a matter of effort and time, not impossibility