soegaard2
2018-11-8 19:27:09

The package server complains about undeclared dependencies on the Urlang package. I must be missing something in my “info.rkt” file - but what?


soegaard2
2018-11-8 19:27:33

The last lines of the build log contains a list of packages missing:



soegaard2
2018-11-8 19:27:52

However some of them are already listed in the info file.



soegaard2
2018-11-8 19:28:27

An example is “html-writing”.


lexi.lambda
2018-11-8 19:29:00

build-deps are not deps that can be zos, they’re deps that are only needed to compile urlang to zos but aren’t needed at runtime.


lexi.lambda
2018-11-8 19:29:14

If you need the dep at runtime, it still needs to go in deps.


lexi.lambda
2018-11-8 19:29:53

The package system dependency checker will tell you where it thinks you need to put the deps—if it says “mode: run”, it should go in deps, and if it says “mode: build” or “for build”, it should go in build-deps.


soegaard2
2018-11-8 19:30:52

Thanks! I wonder where I got the misconception of build-deps = zo-files.


bkovitz
2018-11-8 19:43:32

Is there a way to make a local macro for syntax-parse? That is, a macro that you could call within a template inside a syntax-parse. I thought I read somewhere how to do it, but right now I’m not finding a web page about it.


bkovitz
2018-11-8 19:45:17

I tried enclosing the define-syntax within begin-for-syntax, with no luck. Also tried it inside as well as outside the define-syntax that encloses the syntax-parse.


lexi.lambda
2018-11-8 19:46:14

I’m not entirely sure what you’re asking—do you mean a macro that you use in your expansion, or a macro that you use at phase 1 (that is, at compile-time) to produce the macro’s output?


bkovitz
2018-11-8 19:47:59

A macro that I call in the expansion. Essentially, a “subroutine” macro.


lexi.lambda
2018-11-8 19:48:26

If you just define the macro as usual, outside the define-syntax, it should just work.


bkovitz
2018-11-8 19:48:50

I thought I tried that, but I’ll double-check right now…


soegaard2
2018-11-8 19:48:52

Or if you really want a local macro, then perhaps use let-syntax.


soegaard2
2018-11-8 19:49:07

Btw - I figured out where the misconception stemmed.


soegaard2
2018-11-8 19:49:19

The manual has the following sentence on build-deps:


soegaard2
2018-11-8 19:49:25

“build-deps — like deps, but for dependencies that can be dropped in a binary package, which does not include sources;”


soegaard2
2018-11-8 19:49:44

I misinterpreted “dropped in a binary package”.


bkovitz
2018-11-8 19:50:03

@lexi.lambda Ecch! That worked. Thanks! I must not have actually run that attempt. :wink:


soegaard2
2018-11-8 19:50:14

I see now that it means “can be omitted from a binary package”.


lexi.lambda
2018-11-8 19:50:27

Yes, I think updating the wording to that would be a good change!


soegaard2
2018-11-8 19:55:38

I can’t find the scribble file corresponding to http://docs.racket-lang.org/pkg/index.html



soegaard2
2018-11-8 19:59:26

Thanks. Change committed.


lexi.lambda
2018-11-8 20:01:02

Thanks!


bkovitz
2018-11-8 20:20:37

How can you get the effect of #:auto-nested-attributes and still use #:attributes? Sample code here:


lexi.lambda
2018-11-8 20:29:53

You cannot use them together; the point of #:attributes is to specify the attributes explicitly. You can, however, specify nested attributes explicitly in #:attributes by writing something like #:attributes [foo.bar].


bkovitz
2018-11-8 20:30:46

OK, thanks. I didn’t see how #:attributes could address nesting.


bkovitz
2018-11-8 20:31:31

Do you know the reason why nested attributes aren’t simply propagated as normal behavior?


lexi.lambda
2018-11-8 20:32:35

I’m not totally sure (@ryanc would know), but I think it’s hard to compute them properly when syntax classes use other syntax classes defined later in the same module.


lexi.lambda
2018-11-8 20:32:51

(Or if syntax classes are mutually recursive, for example.)


bkovitz
2018-11-8 20:33:35

OK. Sometimes it clarifies a lot to know why some element of a language is defined the way it is. And sometimes not. :wink:


notjack
2018-11-8 20:40:21

neat syntax-parse trivia that I didn’t realize until years of using it: if you match something using :class instead of foo:class, then all of the attributes of class will be bound directly - e.g. instead of foo.some-attr you can just use some-attr


notjack
2018-11-8 20:41:15

I find this useful sometimes when making one base syntax class and multiple extra syntax classes that each have the same attributes as the base but also some extra stuff


bkovitz
2018-11-8 20:42:13

@notjack Whoa! That might enable me to simplify this now-large macro quite a bit.


notjack
2018-11-8 20:42:35

(because binding them directly means you don’t have to turn id.attr into attr with a bunch of #:with clauses to get the #:attributes parts to line up right)


samth
2018-11-8 20:42:40

@notjack I think you should almost never use that feature


samth
2018-11-8 20:42:44

but sometimes it is handy


notjack
2018-11-8 20:43:16

the syntax class definitions and #:attributes thing is the only use case I’ve come up with so far


lexi.lambda
2018-11-8 20:51:48

I use it semi-regularly. :)


notjack
2018-11-8 20:52:39

gasp!


lexi.lambda
2018-11-8 20:57:29

grep tells me 12 uses of that feature inside the Hackett codebase!


lexi.lambda
2018-11-8 21:43:27

@robby Is there a reason Check Syntax doesn’t use sub-range-binders information when drawing the ? arrows to identifiers inside syntax templates?


dan.ml.901
2018-11-8 21:58:47

is it possible to indent a racket file from a racket command-line?


lexi.lambda
2018-11-8 22:00:10

It’s possible… but I don’t know of an easy way to do it. :)


dan.ml.901
2018-11-8 22:03:29

I have a scenario where people who use Visual Studio Code are editing racket — the language plugin does syntax highlighting but basically nothing else. It’d be great to run Racket as a language server and get DrRacket features


greg
2018-11-8 22:05:14

Oh. I was going to suggest something like (system "emacs -eval '(progn _elisp_that_opens_the_.rkt_files_and_does_the_indent_command_)'" :stuck_out_tongue_winking_eye: Seriously, I think Jay has a Racket LSP project on GitHub.


dan.ml.901
2018-11-8 22:06:10

yeah that would be a great stopgap….


greg
2018-11-8 22:06:53

greg
2018-11-8 22:07:20

But also this: https://github.com/theia-ide/racket-language-server which specifically mentions indent


dan.ml.901
2018-11-8 22:07:24

ah, perfect…


greg
2018-11-8 22:07:40

And I see at least 3 other Racket LSP projects, so idk?


dan.ml.901
2018-11-8 23:43:03

for structs, is there an equivalent property to prop:procedure but that allows you to use it as syntax?


lexi.lambda
2018-11-8 23:44:13

If I understand your question correctly, it’s also prop:procedure. If you have a struct defined at phase 1 with a value for prop:procedure, and a define-syntax binding that is bound to an instance of that struct, then it will call it as a procedure when used as a syntax transformer.


lexi.lambda
2018-11-8 23:46:06

If you mean you want to be able to do (struct foo ()), then (define x (foo)) and have (x) behave like a macro invocation, the macro system just can’t do that—since macros are expanded at compile-time, it needs to know statically which identifiers are bound as macros.


mflatt
2018-11-9 00:04:47

You may know this already, but just building in a fresh directory with PLTCOMPILEDROOTS=compiled/@(version): didn’t trigger the problem for me.


robby
2018-11-9 00:09:05

Maybe a bug?


dan.ml.901
2018-11-9 00:54:35

right, yeah I’d like to be able to do the 2nd one… (struct foo () #:property prop:syntax (lambda (stx) (syntax-case stx ...)))


macocio
2018-11-9 00:57:41

lexi.lambda
2018-11-9 00:58:45

@dan.ml.901 No, you can’t do that. Macros are not (and cannot be) first-class values, but structure instances are.


lexi.lambda
2018-11-9 01:02:17

@macocio It should be fixed when pkg-build runs again tomorrow.


macocio
2018-11-9 01:06:48

Alright @lexi.lambda, have you ceased working on hackett? Last commit 3 oct


lexi.lambda
2018-11-9 01:08:35

I have not had the time.


samth
2018-11-9 01:54:56

@dan.ml.901 maybe (begin (struct foo () #:omit-define-syntaxes) (define-syntax foo (lambda (stx) (syntax-case stx ...))))


samth
2018-11-9 01:55:17

note that won’t let you use foo in match or other places that expect a struct name


samth
2018-11-9 01:56:46

but you can fix that by using prop:struct-info


lexi.lambda
2018-11-9 02:01:59

@samth I understood @dan.ml.901’s request as asking for instances of the struct to serve as transformers, not the struct type name.


dan.ml.901
2018-11-9 02:02:32

actually the type name could be enough… although I do currently use the structs in match cases as well :confused:


dan.ml.901
2018-11-9 02:02:48

I have a workaround, tho


lexi.lambda
2018-11-9 02:05:24

If just the name is okay, what @samth suggested is possible—you can use prop:struct-info to recover support with match.


dan.ml.901
2018-11-9 02:16:59

ah I see… that’s pretty cool