spdegabrielle
2019-9-17 11:40:55

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


soegaard2
2019-9-17 11:48:34

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


spdegabrielle
2019-9-17 11:50:42

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


soegaard2
2019-9-17 12:25:24

@spdegabrielle A recreation using MetaPict.


soegaard2
2019-9-17 12:27:55

spdegabrielle
2019-9-17 12:31:28

You are the best @soegaard2 :grinning:


soegaard2
2019-9-17 12:31:47

Fun little puzzle.


andre
2019-9-17 18:45:15

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.


soegaard2
2019-9-17 18:47:24

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


andre
2019-9-17 18:48:19

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


soegaard2
2019-9-17 18:48:42

Maybe object_setInstanceVariable ?


andre
2019-9-17 18:49:27

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


andre
2019-9-17 19:37:30

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


soegaard2
2019-9-17 19:39:35

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


andre
2019-9-17 19:39:59

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


soegaard2
2019-9-17 19:41:43

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


andre
2019-9-17 19:42:21

I have an example with it not working…


andre
2019-9-17 19:42:38

I’m finishing some touches before uploading to GH


andre
2019-9-17 19:42:49

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


samth
2019-9-17 19:42:56

:slightly_smiling_face:


soegaard2
2019-9-17 19:44:41

:eyes:


andre
2019-9-17 20:14:29

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.


mflatt
2019-9-17 20:47:46

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


andre
2019-9-17 20:48:28

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


andre
2019-9-17 21:46:00

omg @mflatt it worked.


andre
2019-9-17 21:46:02

thanks


soegaard2
2019-9-17 22:04:50

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)


soegaard2
2019-9-17 22:05:32

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


soegaard2
2019-9-17 22:43:31

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


soegaard2
2019-9-17 22:45:16

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


soegaard2
2019-9-17 22:58:00

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


soegaard2
2019-9-17 22:58:25

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


andre
2019-9-17 23:43:34

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.


samdphillips
2019-9-18 00:56:20

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


notjack
2019-9-18 01:01:47

@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


samdphillips
2019-9-18 01:05:14

I figured it was something like that.


notjack
2019-9-18 01:06:34

@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


notjack
2019-9-18 01:11:19

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


samdphillips
2019-9-18 01:13:52

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.


notjack
2019-9-18 01:21:57

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


notjack
2019-9-18 01:23:08

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