leafac
2017-3-27 14:41:52

@mflatt: Regarding find-relative-path: In macOS, the file system (HFS+) is case-insentive, the same as in Windows (NTFS). So wouldn’t your proposed change affect macOS as well?


mflatt
2017-3-27 15:02:12

@leafac No, the change is in terms of normal-case-path, which is a no-op on Unix and Mac OS. Windows is different, because case-insensitive paths are a property of the OS, and not (just) a property of some filesystems


leafac
2017-3-27 15:05:30

@mflatt: :+1: Got it. Thank you for the explanation.


lexi.lambda
2017-3-27 17:44:57

I can’t figure out how to properly set the 'inferred-name syntax property so that syntax-local-name will recognize it. I tried this simple program, but it produces #f: #lang racket (require syntax/parse/define) (define-syntax-parser with-inferred-name [(_ e:expr) (syntax-property #'e 'inferred-name 'custom-inferred)]) (define-syntax-parser inferred-name [(_) #`'#,(syntax-local-name)]) (with-inferred-name (inferred-name)) ; => #f Does anyone know how this is supposed to work? @mflatt?


mflatt
2017-3-27 17:46:17

@lexi.lambda syntax-local-name won’t recognize it; see syntax-local-infer-name


lexi.lambda
2017-3-27 17:47:14

@mflatt: Interesting. I was looking at that at first, but then I noticed the docs claim syntax-local-name will, too, and I thought maybe syntax-local-infer-name was an older mechanism. http://docs.racket-lang.org/reference/syntax-model.html#%28part._infernames%29


lexi.lambda
2017-3-27 17:48:26

That is, I thought the property-handling was added to syntax-local-name after syntax-local-infer-name was written. But it seems like maybe syntax-local-name doesn’t handle properties, or at least it doesn’t now?


mflatt
2017-3-27 17:50:50

Can you point me more specifically to the wrong docs? The job of syntax-local-name is to report a binding that surrounds the expression that a macro sees, while 'inferred-name is attached to an expression that a macro sees directly; the syntax-local-infer-name function combines syntax-local-name (from surrounding an expression) with 'inferred-name (on an expression).


lexi.lambda
2017-3-27 17:52:32

If you look at the docs for syntax-local-name, it links to the section named “Inferred Value Names”: http://docs.racket-lang.org/reference/stxtrans.html#%28def._%28%28quote._~23~25kernel%29._syntax-local-name%29%29 The bottom of the Inferred Value Names section discusses the inspection of 'inferred-name properties: http://docs.racket-lang.org/reference/syntax-model.html#%28part._infernames%29


mflatt
2017-3-27 17:53:23

Got it - thanks


lexi.lambda
2017-3-27 17:56:42

Peeking at the git blame, it seems like that comment has been in there for a rather long time—over 10 years. Is it safe to say the docs are just wrong, then?


lexi.lambda
2017-3-27 18:01:39

Looks like it’s been that way since it was written in 2007: https://github.com/racket/racket/commit/cbf1d0752ced90216b11d789da4cda05d86a2e7a


mflatt
2017-3-27 18:04:33

Yes, the end of that last sentence “Inferred and property-assigned names are also available to syntax transformers, via syntax-local-name.” is wrong


lexi.lambda
2017-3-27 18:18:36

Alright, thanks; I’ll switch to expanding to a let to set the inferred name.


mflatt
2017-3-27 18:33:47

@lexi.lambda I think I must misunderstand the issue; why not switch to syntax-local-infer-name?


lexi.lambda
2017-3-27 18:40:08

@mflatt: Because I’m not writing a macro that infers names, I’m writing a macro that sets the inferred name, and I want it to work with things like procedures.


mflatt
2017-3-27 18:41:52

The compiler effectively uses syntax-local-infer-name to name procedures; that part of the docs is right


mflatt
2017-3-27 18:41:56
#lang racket

(require syntax/parse/define)

(define-syntax-parser with-inferred-name
  [(_ e:expr)
   (syntax-property #'e 'inferred-name 'custom-inferred)])

(with-inferred-name (lambda (x) x)) ; => <procedure:custom-inferred>

lexi.lambda
2017-3-27 20:12:15

@mflatt: Gotcha. I might as well use a let, anyway, though, since I can, and that will support syntax-local-name as well as syntax-local-infer-name.


danl-ndi
2017-3-27 23:08:20

is there a “best practice” for operating racket with collects directories in source control? like where you could switch branches and therefore use a different collects directory, but hopefully avoid all the ‘raco pkg’ calls to switch to that different dirctory?


samth
2017-3-27 23:09:13

@danl-ndi I recommend setting the PLTADDONDIR environment variable


samth
2017-3-27 23:09:27

or maybe PLTCOLLECTS in your case


danl-ndi
2017-3-27 23:16:39

PLTADDONDIR doesn’t seem to work… and setting PLTCOLLECTS removes the standard distro directories


danl-ndi
2017-3-27 23:17:16

specifically… setting PLTADDONDIR doesn’t seem to change any behavior


danl-ndi
2017-3-27 23:17:46

how do you handle switching branches? raco pkg setup?


mflatt
2017-3-27 23:43:42

@danl-ndi Include an empty path in PLTCOLLECTS to splice the default path at that point


danl-ndi
2017-3-27 23:47:15

urg. my kingom for a single ";"


danl-ndi
2017-3-27 23:47:23

:sweat_smile:


danl-ndi
2017-3-27 23:50:30

but I’m still confused as to why -S <dir> doesn’t work?


danl-ndi
2017-3-27 23:51:10

oh,just saw the mailing list post


sbelknap
2017-3-28 00:43:28

Concept: conflicting demands for medical resources among patients will be resolved by single combat duels. Each patient will designate a POP-PL battlebot. A winner-take-all to-the-death battlebot tournament will determine the allocation of resources.