robbert.gurdeepsingh
2021-4-28 14:38:32

I’m trying to create a fresh variable in the conclusion of a judgement form, I tried (where c (varaible-not-in T_0 'mappername)) but that does not work for some reason


robbert.gurdeepsingh
2021-4-28 14:39:17

Does anyone here have another suggestion?


camoy
2021-4-28 15:27:53

I think it should be (where c ,(variable-not-in (term T_0) 'mappername))


camoy
2021-4-28 15:28:38

The RHS of where is at the “term” level, but variable-not-in is at the Racket level so you need unquote.


robbert.gurdeepsingh
2021-4-28 15:36:25

Aaah


robbert.gurdeepsingh
2021-4-28 15:39:25

It works, thank you


joel
2021-4-28 17:09:24

The issue count on the main racket GitHub repo just dropped below 400 for the first time in …a long time! @mflatt is on a tear


mflatt
2021-4-28 17:10:37

I’ve found a new way to procrastinate for all the other things I’m supposed to be doing.


markus.pfeiffer
2021-4-28 17:20:07

structured procrastination


notjack
2021-4-28 20:45:55

immutable collections I think should iterate in insertion order by default anyway


tgbugs
2021-4-28 23:30:50

Is there a straight forward way to prepend a newline as the first byte of a port? I’m trying to replicate what the input-prefix argument to regexp-match does with parser-tools so that I don’t have to special case handling for the beginning of files, but looking at the source for how it is implemented in regexp leaves me a bit concerned. Is there maybe a way that it can be done using the special result from the port or some other simpler way?


jaz
2021-4-28 23:34:51

You could use input-port-append


jaz
2021-4-28 23:38:10

Erm, except my test of it doesn’t seem to be working… and I don’t know why


jaz
2021-4-28 23:41:46

#lang racket/base (require racket/port) (define main-port (open-input-bytes #"hello world")) (define prefix-port (open-input-bytes #"\n")) (define the-port (input-port-append prefix-port main-port)) It seems to me that the-port should be a port containing #"\nhello world", but the bytes from prefix-port seem to be lost.


tgbugs
2021-4-28 23:42:53

hrm, from the description that should work at least for testing, but I’ll have to find a way to reset the offset after the first read, I think I know how I can do it, I’ll see whether I encounter the same issues you describe here


tgbugs
2021-4-28 23:46:16

I’m seeing the same issue with the first port’s input being discarded (on a string port)


tgbugs
2021-4-28 23:47:54

a workaround seems to be to just include an empty first port?


tgbugs
2021-4-28 23:48:19

oh right


tgbugs
2021-4-28 23:48:28

pesky close-at-eof?


tgbugs
2021-4-28 23:49:06

#lang racket/base (require racket/port) (define main-port (open-input-bytes #"hello world")) (define prefix-port (open-input-bytes #"\n")) (define the-port (input-port-append #f prefix-port main-port))


tgbugs
2021-4-28 23:50:19

@jaz, solution is perfect, thanks!


jaz
2021-4-28 23:50:35

oh — that’s a required argument :face_palm:


jaz
2021-4-28 23:50:50

I was clearly not paying close enough attention


tgbugs
2021-4-28 23:56:43

those darned legacy function signatures that don’t use keywords