Le mardi 13 juin 2017 23:49:23 UTC+2, Alex Knauth a écrit : > I'm imagining the existing DrRacket indentation rules would be expressed as: > > […]
This seems like a nice concise notation, although it is a bit cryptic at first sight :) . I'm not quite sure if if covers the following case (where y should be aligned with x). (f #:kw x y #:more …) As a side remark, I have been pleasantly impressed by JetBrain's Meta Programmin System [1]'s ability to nicely lay out uses of "macros" (or rather, graphical language elements), and more generally the fact that in principle, when using a "macro", one can make use of contextual features (auto-complete being the main one, but more should be possible). Achieving this with Racket (without putting snip% graphical objects in the code) seems more difficult, because in order to know which macro an identifier is bound to, the whole file must be macro-expanded until that point. Conversely, I think that with JetBrains MPS the binding is known statically from the moment it is inserted into the code. I wonder if, in a hypothetical future, the best route for Racket to support contextual enhancements which can be customised by a macro or function (syntax highlighting, indentation, tooltips/blueboxes, auto-completion, macro-specific tools), would be to: * go towards structured editing (which is what MPS relies on), as a lot of the infrastructure is already there with snip%, and something like lexi-lambda's idea of a syntax/parse/gui could make this relatively painless; * or to define "lightweight" front-ends to macros, which only perform enough expansion that the desired information can be extracted (similarly to how the syntax highlighter returned by a language's get-info is a dumbed down / optimised version of the parser), * or if we should follow the approach taken for blueboxes, and cache the desired information. * or something else. This is ostensibly just a thought experiment, as going towards structured editing would be a non-trivial change for Racket. Cheers, Georges [1] : https://www.jetbrains.com/mps/ -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.