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

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

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.)

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

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

but what to replace it with?

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)

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

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

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)

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

@samth I don’t have the amazon credentials

Otherwise I would

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

Did you build the site and check that it works?

Yes

On my local machine.

I can re-open the PR fwiw.

But I was going off of @stamourv LGTM

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

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

That’s fair.

Do you know who does have the credentials?

ditto for https://github.com/racket/racket-lang-org/commit/c8794749aede40166ec6a1d4eab263521e190a60 (the link isn’t on the website)

At a minimum, @mflatt @stamourv and I do

would be best to have an automated system

maybe someone wants to build that :slightly_smiling_face:

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

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

(Since that build and deploy is automated)

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

@samth: Thanks for doing it!

@samth okay cool.

And yeah, should have thought about that.

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

Thanks though @samth :slightly_smiling_face:

@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

That seems safe enough given the right credentials

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

I would start by setting up Travis for that repo

Oh

nvm, I see what ben is saying

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


there’s a way to not do that

with travis

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


Oh cool, thanks.

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

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

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

First, get travis working without uploading

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

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

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

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

okay

I will do that when I have some cycles then.

@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.

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

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

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

Yes, that, and having pygments installed.

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

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

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

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]

which suggests that something is missing a version dependency