thinkmoore
2017-3-7 17:13:38

is there a way to control what scopes are added by read-syntax?


thinkmoore
2017-3-7 17:14:58

I’m trying to use syntax I read from a file in a template that defines a module, (i.e. #’(module somename somelang body …), where body I read from a file), but I can’t seem to find a way to attach the right scopes to body … to use the bindings from somelang but not from the file that defines my macro


mflatt
2017-3-7 17:16:58

read-syntax doesn’t add scopes; the scopes would come from the way that the result is used (eval, as a result of a macro, etc.)


thinkmoore
2017-3-7 17:19:50

maybe a better question is how to I make body … use the new scope that is create for the module somename? right now I end up with my macro’s scope. syntax-local-introduce doesn’t seem to do the right thing


mflatt
2017-3-7 17:21:23

You could use replace-context (from syntax/strip-context) on the result of read-syntax; is that what you mean?


thinkmoore
2017-3-7 17:22:08

but what to replace it with?


thinkmoore
2017-3-7 17:22:50

module, somename, and somelang all either have the scope of the macro or the use-site, it seems like I want the scope of the resulting module? (that will be lifted using syntax-local-lift-module)


mflatt
2017-3-7 17:27:04

Normally, the body should start with the same context as somelang; when the module declaration is expander, then somelang and the body will get the same additional scopes


thinkmoore
2017-3-7 17:35:22

this sort of works: (with-syntax ([module-name (format-id #'path "~a" (syntax->datum #'path))] [(body ...) (map (lambda (s) (replace-context #'module-name s)) (load (syntax->datum #'path)))]) (syntax-local-lift-module #'(module module-name shill/lang/main body ...)) (syntax-local-introduce #’'module-name)) but if body uses an identifier that is not provided by shill/lang/main, but is visible to the macro, you get that binding instead of an error


mflatt
2017-3-7 18:09:34

Maybe instead of adding scopes to the read-syntax result you want to remove scopes from shill/lang/main – that is, use (datum->syntax #f 'shill/lang/main)


samth
2017-3-7 21:13:14

@leif are you going to push that post to the web?


leif
2017-3-7 21:19:40

@samth I don’t have the amazon credentials


leif
2017-3-7 21:19:45

Otherwise I would


samth
2017-3-7 21:19:55

I would encourage you not to merge/close PRs for that then


samth
2017-3-7 21:20:16

Did you build the site and check that it works?


leif
2017-3-7 21:20:29

Yes


leif
2017-3-7 21:20:33

On my local machine.


leif
2017-3-7 21:20:47

I can re-open the PR fwiw.


leif
2017-3-7 21:20:56

But I was going off of @stamourv LGTM


leif
2017-3-7 21:21:21

BUt yes, I have built it on my local machine, just can’t push.


samth
2017-3-7 21:21:53

It just leaves it unclear what the status is if it’s closed but not actually on the web site


leif
2017-3-7 21:22:11

That’s fair.


leif
2017-3-7 21:22:22

Do you know who does have the credentials?


ben
2017-3-7 21:22:46

samth
2017-3-7 21:23:18

At a minimum, @mflatt @stamourv and I do


samth
2017-3-7 21:23:41

would be best to have an automated system


samth
2017-3-7 21:23:48

maybe someone wants to build that :slightly_smiling_face:


leif
2017-3-7 21:23:56

Okay then, will one of you either give us a copy of the credentials, or push it?


leif
2017-3-7 21:24:31

In principle I agree. @ben Do you know how it was done for the PRL website?


leif
2017-3-7 21:24:41

(Since that build and deploy is automated)


samth
2017-3-7 21:24:59

The credentials require full access to the AWS account, I believe, so I’ll let @mflatt be in charge of that, but I’m building to push now


stamourv
2017-3-7 21:25:19

@samth: Thanks for doing it!


leif
2017-3-7 21:25:28

@samth okay cool.


stamourv
2017-3-7 21:25:29

And yeah, should have thought about that.


leif
2017-3-7 21:25:56

And ya, that makes sense to let @mflatt handle credentials.


leif
2017-3-7 21:26:09

Thanks though @samth :slightly_smiling_face:


ben
2017-3-7 21:26:24

@leif the PRL website isn’t safe. One repo just has a travis script to push to another repo. https://github.com/nuprl/website/issues/53#issuecomment-283107419


samth
2017-3-7 21:27:30

That seems safe enough given the right credentials


leif
2017-3-7 21:28:39

Ya, I agree with @samth. Although @ben what is to stop someone from pretending to be travis?


samth
2017-3-7 21:29:11

I would start by setting up Travis for that repo


leif
2017-3-7 21:31:46

Oh


leif
2017-3-7 21:31:52

nvm, I see what ben is saying


leif
2017-3-7 21:32:19

The travis yml file just displays the secure token in plaintext. We should absolutely not do that.



samth
2017-3-7 21:32:42

there’s a way to not do that


samth
2017-3-7 21:32:44

with travis


leif
2017-3-7 21:33:45

That makes sense. If you know that would be great, if not google around for it when I get a few cycles.



leif
2017-3-7 21:36:21

Oh cool, thanks.


leif
2017-3-7 21:36:37

So it looks like what the PRL blog does is secure.


leif
2017-3-7 21:36:52

So, in that case, we should just talk to @mflatt about setting it up.


leif
2017-3-7 21:37:05

(I’d be happy to do it, but obviously can’t on account of not having the creds. :wink: )


samth
2017-3-7 21:37:08

First, get travis working without uploading


leif
2017-3-7 21:39:34

@samth That still requires someone who is not me, as I am not an admin to the Racket group.


leif
2017-3-7 21:39:44

As such, I cannot activate and deactivate travis on racket repos.


samth
2017-3-7 21:39:58

commit a travis.yml file and I’ll activate it


leif
2017-3-7 21:40:00

I can push an empty .travis.yml file if you like though


leif
2017-3-7 21:40:02

okay


leif
2017-3-7 21:40:14

I will do that when I have some cycles then.


leif
2017-3-7 21:44:31

@samth Actually, eh, come to think of it, unless the only thing you need to do to build+deploy is (1) have a ~/.aws-keys file and (2) run racket sync.rkt, I should let someone else who knows the process do it.


leif
2017-3-7 21:44:54

If it really is just that simple though, then I can absolutely make a .travis.yml file that does that.


leif
2017-3-7 21:45:02

Oh, and I guess also (1.5) installing the s3 package.


samth
2017-3-7 21:45:11

first, you should make sure that things build on every commit


stamourv
2017-3-7 21:45:13

Yes, that, and having pygments installed.


leif
2017-3-7 21:45:57

@samth Doesn’t the sync.rkt script do that?


leif
2017-3-7 22:17:14

Darn it, running the travis build on a trusty image trying replicate a travisci build environment doesn’t cause a segfault. :disappointed:


samth
2017-3-8 04:10:57

@leif @stamourv I get this error when pushing the web pages:


samth
2017-3-8 04:11:02
application: procedure does not expect an argument with given keyword
  procedure: redirect-prefix-routing-rule
  given keyword: #:redirect-code
  arguments...:
   #:new-host "<http://mirror.racket-lang.org\|mirror.racket-lang.org>"
   #:new-prefix "installers"
   #:old-prefix "installers"
   #:redirect-code "302"
  context...:
   /home/samth/sw/plt/racket/collects/racket/private/kw.rkt:1350:14
   /home/samth/sw/plt/extra-pkgs/racket-lang-org/sync.rkt: [running body]

samth
2017-3-8 04:11:11

which suggests that something is missing a version dependency