

Wow, never thought it is so complicated. Thanks for your pointing.

Guys, i process custom language and generate unbound identifiers that should bind in runtime, but racket spits “unbound identifier error”… What should i do to fix it?

I am assuming your language works like this: your language -> (your compilation) racket + macros -> (normal Racket expansion) expanded Racket The unbounded identifier error is must come from the last step.
One way to find such an error: • write an example in your language • hand compile it into racket+macros • run you hand compiled example If your hand compiled example doesn’t run, you can debug it “normally” (that is with out worrying about the language implementation details).
If it does run, then you need to check, where your compilation step results in some other than the expected.

If you can find a minimal example, where you get the error, then ask about the minimal example here.

Yep, I understand this May I rephrase myself, generalizing what i want to do?
I want to read at compilation time some external file, process it to S-expressions and use definitions from it. What is the right way to do this?


I think define-inline
doesn’t work as intended. It’s trying to avoid inlnining recursive calls, but it ends up disabling inlining within arguments to an inlined call. You can see that via raco expand
of #lang racket/base
(require racket/performance-hint)
(define-inline (f x) (list x))
(f (f 0))
Someone could try swapping the order of syntax-parameterize
and let*
on lines 102–104 of collects/racket/performance-hint.rkt
to see whether that’s better.

Would begin-encourage-inline work differently?

@ben.knoble has joined the channel

@laurent.orseau 4.3s - no different from the original version.

@mflatt This really surprised me. IIUC, applying the same function repeatedly is not recursive calls.

I think the author of define-inline
(not me) didn’t intend to treat arguments the same as recursive calls, but that’s what the implementation currently does.

Anyone know a decent scribble syntax plugin for vim ? The Vimscripts one linked from the racket/vim page is not working as well as I would like.

Not an answer (and I also don’t mean to be a downer), but most people here are using Emacs (from what I understand), which has much better support for Racket and Scribble. I switched over to Emacs from Vim myself just for the better lisp/Racket support.
Even the vim-racket plugin had many indentation issues, and seems like it is not being currently maintained
It is unfortunate that the racket/vim page is out of date though, that should be fixed indeed :slightly_smiling_face:

You can write your own syntax highligther in vim https://learnvimscriptthehardway.stevelosh.com/chapters/46.html

Oh trust me @lupino8211 I’m aware; syntax is just one of the harder parts of vim customization (and not something I’ve dived deeply into). It probably will come down to doing so, though. When it happens, I’ll release it and let people know.

Is there a built-in function to filter a hash table? I’m not finding it, but thought I’d check before I write one.

Is your hash mutable or immutable?

If immutable, you can use for/hash
along with in-hash
and #:when
clause

I expect I’ll want to filter both, but the one at present is immutable. I think I’d prefer (hash-filter hsh fun)
over using for/hash
aesthetically.

I think a part of the problem is that hash-map
exists, but it returns a list instead of a hash.

So if you add hash-filter
, it would be awkward to return a hash.

I learned that the Racket compiler uses partial type reconstruction to eliminate redundant runtime type tests. Does it also do something like that for contract checks?
