lexi.lambda
2018-7-19 15:40:54

@zenspider Rather than trying to implement gen:graph on your own data, could you not just convert your data to one of the graph library’s built-in graphs for the purpose of calling graphviz?


soegaard2
2018-7-19 15:44:56

Is struct->vector helpful here?


samth
2018-7-19 18:14:39

@lexi.lambda to avoid the letter-boxing, I think you need some combination of -a, -n, -z, and -r


lexi.lambda
2018-7-19 18:19:28

@samth thanks, slideshow -anzrx seems to have done the trick


samth
2018-7-19 18:19:50

maybe there should be an option for that


samth
2018-7-19 18:20:08

also it should be the default because i never want the other way


soegaard2
2018-7-19 18:28:53

This program works: #lang racket/base (for/vector ([x (in-list ’(a b c))]) x)


soegaard2
2018-7-19 18:29:09

But (define base-ns (module->namespace ‘racket/base)) (eval ’(for/vector ([x (in-list ’(a b c))]) x) base-ns)


soegaard2
2018-7-19 18:29:34

../../Applications/Racket v6.12/collects/racket/private/kw.rkt:979:25: for/vector: undefined; cannot reference an identifier before its definition


lexi.lambda
2018-7-19 18:39:43

@soegaard2 I can’t reproduce that behavior. Your second program works for me on both Racket 6.12 and Racket 7.


soegaard2
2018-7-19 18:44:55

Also in the repl? (6.12)


minond.marcos
2018-7-19 18:48:25

@soegaard2 in the repl:

~ > racket
Welcome to Racket v6.12.
> (define base-ns (module->namespace 'racket/base))
> (eval '(for/vector ([x (in-list '(a b c))]) x) base-ns)
'#(a b c)
>

soegaard2
2018-7-19 18:51:59

@lexi.lambda @minond.marcos thanks - I am playing around with (namespace-set-variable-value! ’for/vector hint-for/vector #f base-ns) i.e. replacing the value for for/vector. So I must have succeeded … I guess I’ll have to restart DrRacket to find out.


soegaard2
2018-7-19 18:55:39

Yep. Works fine after a restart. Can’t remember the last time where doing something in one tab in DrRacket affected something in another tab.


mflatt
2018-7-19 19:03:08

DrRacket really shouldn’t let you do that, but we never took the plunge on having DrRacket set the code inspector (which would have prevented it).


githree
2018-7-19 19:03:29

@soegaard2 did you by any chance install files-viewer in DrRacket


githree
2018-7-19 19:04:03

I am asking because it happened to me once after running this plugin - still trying to replicate though


githree
2018-7-19 19:04:10

might have been just a fluke


soegaard2
2018-7-19 19:04:18

@githree not yet


githree
2018-7-19 19:04:52

ok, never mind then


soegaard2
2018-7-19 19:05:06

on my todo


greg
2018-7-19 19:12:20

I have a commit (not yet merged) for racket-mode: https://github.com/greghendershott/racket-mode/commit/8a74c8e06d6da8ca37626361ab7061c2af7f4c25 Does anyone have any opinions/ideas/suggestions? (I mean about the commit message, the packaging pros and cons. Although if you have Elisp comments that’s fine, too :smile:.)


lexi.lambda
2018-7-19 21:01:31

@mflatt I’ve been discussing with @florence about trying to get a better understanding for why/when syntax-shift-phase-level is relevant. One area I’ve realized I don’t really understand is how scopes and phases interact across modules, especially since the sets-of-scopes paper does not deal with modules.

I think understand that, within a module, there is both a phase-spanning module scope and a “multi-scope” that represents an infinite set of scopes, with one for each phase. I also believe I understand how this interacts with binding lookup and syntax-shift-phase-level. What I definitely do not understand is what happens to the binding table when a module is imported at multiple phases.

If I write (module a racket/base (define x #f)), then (require 'a (for-syntax 'a)), then is the binding for x added to the binding table twice, once for each instantiation? If so, how are these distinguished? Alternatively, is there only one binding, with the same phase-spanning scope and the same multi-scope, simply distinguished by some notion of a “current phase level” used at binding lookup time?


mflatt
2018-7-19 21:05:25

In that case, bindings are added twice: once using the phase–0 scope in the enclosing module’s multi-scope, and once using the phase–1 scope in the enclosing module’s multi-scope


mflatt
2018-7-19 21:07:51

Using syntax-shift-phase-level is rare, but it happens internally when a module form appears under a begin-for-syntax, since the module body is always handled at phase level 0


lexi.lambda
2018-7-19 21:20:08

So, in general, when a binding is added to the binding table, are multi-scopes “simplified” to the normal scopes associated with the “current phase”, for some meaning of current phase?


mflatt
2018-7-19 22:06:22

Yes: a set of multi-scopes plus a set of scopes is turned into just a set of scopes by extracting the phase-specific scope from each multi-scope; scope-set-at-fallback does that


eeide
2018-7-19 22:08:55

This seems fine. The risk of version skew is high, so the default should be to keep things in sync. It’s not clear to me that not doing that is worth it at all, even as a user option.


lexi.lambda
2018-7-19 23:03:44

Okay, thanks! I think that clears up my confusion, then.


plragde
2018-7-19 23:26:01

Where is the source for core Racket documentation? Specifically I am looking for the Scribble files for “Syntax: Meta-Programming Helpers”.


mflatt
2018-7-19 23:30:15

You can click the title to get an idea: '(lib "syntax/scribblings/syntax.scrbl"). That leaves you with more search steps, though, to find https://github.com/racket/racket/blob/master/pkgs/racket-doc/syntax/scribblings/syntax.scrbl


plragde
2018-7-19 23:45:44

@mflatt Thanks!


cadr
2018-7-20 01:23:56

I’m trying to write and read back a path value, but getting a bad syntax because of #<, is there a certain reader parameter that I need to set to read back that path value?


cadr
2018-7-20 01:24:24

Like for instance : (let ((d (open-output-bytes))) (begin (write (build-path "/home/racket") d) (read (open-input-bytes (get-output-bytes d)))))


lexi.lambda
2018-7-20 01:30:52

@cadr Paths are not readable. More generally, write and read are not a good choice for general-purpose serialization. They can, however, be used in combination with racket/serialize to serialize other kinds of values, including paths.


samth
2018-7-20 02:18:23

@cadr in this case, you’re serializing something that’s not an arbitrary racket value, so you’ll have to come up with your own serialization


cadr
2018-7-20 02:23:45

Thanks @lexi.lambda! I asked about the read/write because I’m making Pycket to create and use its own .zo files and I’m basically using Racket’s compile-file to do that (Pycket bootstraps Racket through the expander linklet, so it’s really Racket’s compile-file). The problem is when I run that on qq-and-or.rkt for instance, it generates a bunch of srclocs which has paths in it and Pycket is having hard time reading them back to path objects using (again Racket’s) read.


cadr
2018-7-20 02:24:15

@samth That’s what I figured, doing exactly that now :slightly_smiling_face:


samth
2018-7-20 02:29:06

@cadr are those struct values with a custom-write?


cadr
2018-7-20 02:43:03

@samth that’s a good point, though I’m not sure yet if they are