[racket-users] Scribble abstraction to attach styles

2015-04-22 Thread Shriram Krishnamurthi
I'm having trouble with the type structure of Scribble and hoping someone can help me get this right. Let's say I want to write content like this: = @exercise{ @question{The expression @code{1 + 2} evaluates to} @answer{ @itemlist[ @item{@code{2}} @item{@code{3}} @item{@code{4}} ] } }

Re: [racket-users] Scribble abstraction to attach styles

2015-05-21 Thread Shriram Krishnamurthi
Thanks for these replies. Sorry I'm only now getting to them: Google failed to notify me of them. The problem with using (nested ...) is that it indents its content even when I don't use the 'inset style. Therefore, if I have (as I do) @exercise{@question{...}} everything in the exercise ends

Re: [racket-users] Scribble abstraction to attach styles

2015-05-21 Thread Shriram Krishnamurthi
a little bit at least -- Matthias On May 21, 2015, at 2:19 PM, Shriram Krishnamurthi shri...@gmail.com wrote: Understood. But my understanding of the docs is that it shouldn't do that in the first place. On Thu, May 21, 2015 at 2:15 PM, Ben Lerner bler...@ccs.neu.edu wrote: Probably a CSS

Re: [racket-users] Scribble abstraction to attach styles

2015-05-21 Thread Shriram Krishnamurthi
the indentation, then something like this will disable the nested one: div.exercise div.question { padding-left: 0em; } ~ben On 5/21/2015 2:12 PM, Shriram Krishnamurthi wrote: Thanks for these replies. Sorry I'm only now getting to them: Google failed to notify me of them. The problem

[racket-users] selective --html-tree in Scribble

2016-09-02 Thread Shriram Krishnamurthi
I want to unfold an HTML tree selectively. Suppose I have a site.scrbl that contains a Web site's information. I want all the top-level sections to be split into individual pages (corresponding to --htmls). But in one particular section (call it "Assignments"), I want each sub-section to have

Re: [racket-users] selective --html-tree in Scribble

2016-09-02 Thread Shriram Krishnamurthi
On Friday, September 2, 2016 at 2:19:58 PM UTC-4, Matthew Flatt wrote: > Use the 'toc style property for the "Assignments" section. It's not a > great name, but 'toc means "render subsections on separate HTML pages". This is terrific, thanks. Is there a "callee-determines" equivalent to this

[racket-users] Re: Whalesong instead of Clojurescript

2016-09-02 Thread Shriram Krishnamurthi
On Thursday, August 25, 2016 at 9:53:40 AM UTC-4, tbrooke wrote: > I briefly looked at Whalesong and I was wondering if anyone is using it and > if it is mature and ready to use. I use Clojurescript and it seems to me that > Whalesong should be equivalent with the advantage of allowing me to

Re: [racket-users] Re: Whalesong instead of Clojurescript

2016-09-03 Thread Shriram Krishnamurthi
There has indeed not been a lot of activity, but that doesn't mean it isn't functional. I've heard now and then of people using it. It's at least worth a try — a few minutes will let you know if it's suitable for your needs. -- You received this message because you are subscribed to the Google

Re: [racket-users] Scribble: unnumbered and unindexed sections

2016-09-05 Thread Shriram Krishnamurthi
Just as a note of warning to other readers. I like being able to use #:tag for sections to get human-readable file/directory names. Unfortunately, using the tag prefixes also affects these names. For instance, if you use #:tag "foo", you get a file named "foo.html". But if you use #:tag-prefixes

Re: [racket-users] Scribble: unnumbered and unindexed sections

2016-09-05 Thread Shriram Krishnamurthi
Thanks all for the help. To summarize for the benefit of those who find this thread later: A style of 'unnumbered does the trick. Thus @section[#:style 'unnumbered]{My Section} will list it without giving it a number. As for avoiding duplicate tags, this doesn't appear to be quite right:

[racket-users] Scribble: unnumbered and unindexed sections

2016-09-04 Thread Shriram Krishnamurthi
Is there a way to have unnumbered and unindexed section? (Yes, these are different issues.) It would be helpful to have unnumbered sections, à la \[sub]section* in LaTeX. It would be especially helpful to have unindexed sections. The real nuisance I'm trying to avoid is, say I have N sections

[racket-users] RaspberryPi IoT programming with Racket BSL

2017-04-10 Thread Shriram Krishnamurthi
For those who may not know about this: Matthias Felleisen recently heard about a really cool piece of work by Daniel Brunner and Stephan Brunner on using Racket BSL to program Raspberry Pi systems. Here is a brief blog post that has a link to the paper:

Re: [racket-users] Announcing Leibniz, a new language in the Racket universe

2017-04-12 Thread Shriram Krishnamurthi
The Lotka-Volterra example is very helpful, thanks. It is still a bit unclear from the formatting which part is the Leibniz code. Is it the two lines marked pp1 and pp2? Are they literal code? I guess I prefer to use a typewriter face to make verbatim code clear, though that may be at odds with

Re: [racket-users] Announcing Leibniz, a new language in the Racket universe

2017-04-09 Thread Shriram Krishnamurthi
Agreed w/ John. I tried reading the Scribble files in the examples directory but my eyes started to bug out a bit. -- 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

[racket-users] The 2nd Summit oN Advances in Programming Languages- SNAPL '17

2017-04-09 Thread Shriram Krishnamurthi
Conference Grounds on the Pacific Ocean just south of Monterey, CA. Ras Bodík and Shriram Krishnamurthi (co-chairs) -- 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, sen

Re: [racket-users] Announcing Leibniz, a new language in the Racket universe

2017-04-10 Thread Shriram Krishnamurthi
Let me ask a few questions that may nudge you a bit: What is an example of a system you want to model? For instance: Do you want to be able to model simple linear motion? Uniform acceleration? Do you want to be able to model predator-prey? Or epidemic growth? Are these even in the realm of

Re: [racket-users] Announcing Leibniz, a new language in the Racket universe

2017-04-13 Thread Shriram Krishnamurthi
Yes, this clarifies everything, thanks! Some more comments/thoughts. I would suggest adding a @(table-of-contents) to the top of every page: it helps the reader know what is coming ahead. For instance, it's good for me to know up front that I don't have to understand sec 1 all by myself, because

Re: [racket-users] Re: The case, and a proposal, for elegant syntax in #lang racket2

2019-08-21 Thread Shriram Krishnamurthi
> > > Pyret was a pain. Error messages were not clear and the whole change >> confused students. >> > > Can you elaborate more on this? My personal experience with Pyret is that > it has an exceptionally good error message, except when an internal > error occurs (which should not happen). > IMO,

Re: [racket-users] Re: The case, and a proposal, for elegant syntax in #lang racket2

2019-08-21 Thread Shriram Krishnamurthi
I agree that struct-copy is almost essential. That's why it's baked into the syntax of Pyret (where we're very sparing in what we provide syntactic surface to). It might be better to just import struct-copy and leave the language-level intact, in the future (if not create a language level that

Re: [racket-users] Re: The case, and a proposal, for elegant syntax in #lang racket2

2019-07-15 Thread Shriram Krishnamurthi
P4P is also very much "current", as far as I'm concerned. (In fact, I'm quite likely about to use it in a new setting.) Pyret is a parallel branch effort. Pyret is "let's just go all out and design a new syntax". Specifically, I was tired of dealing with people who wouldn't read *How to

Re: [racket-users] The case, and a proposal, for elegant syntax in #lang racket2

2019-07-15 Thread Shriram Krishnamurthi
Another Racketeer here who's been in the community since day 0. We have various views and people in the community. But our commitment to making tools and learning available to all, open to all, and catering to all — what many of us label diversity — is, I hope, demonstrated by our actions.

Re: [racket-users] Re: The case, and a proposal, for elegant syntax in #lang racket2

2019-07-24 Thread Shriram Krishnamurthi
To riff on Will's message: In the Bootstrap:Algebra materials, we use Racket syntax because it's a powerful pedagogic device. Recently, for various reasons, we've ported this over to another language called Pyret (while also maintaining the

[racket-users] embedding Google Forms/YouTube/… in Scribble

2020-03-22 Thread Shriram Krishnamurthi
It's sometimes useful to embed content like a Google Form (a survey, quiz, etc.) or a YouTube video in a Scribble document. I spent some time searching but couldn't find anything that would do this for me. I've therefore written a little library to help with this:

[racket-users] running Racket inside gradescope

2020-05-19 Thread Shriram Krishnamurthi
We expect to use Racket with Gradescope [https://www.gradescope.com/] in the fall. Gradescope will run an autograder for programming assignments, using this specification: https://gradescope-autograders.readthedocs.io/en/latest/ (It's manifest as a Docker container.) Has anyone already set up

[racket-users] Re: What does PLT stand for?

2020-05-19 Thread Shriram Krishnamurthi
Originally it was the Programming Languages Theory group at Rice University. Then, around the time of creation of Racket, the team branched out beyond Theory, so we decided the T might stand also for Technology, Tools, etc. Eventually we decided it just stood for Programming Languages Team.

Re: [racket-users] Re: rackunit and logging

2020-05-23 Thread Shriram Krishnamurthi
Thank you, Alex, this seems to have just the right set of information. I'm curious why you use `foldts-test-suite` instead of `fold-test-results`, whose documentation says "Hence it should be used in preference to foldts-test-suite

Re: [racket-users] rackunit and logging

2020-05-23 Thread Shriram Krishnamurthi
For those reading this later: there's a bunch of useful information in Alex Harsanyi's blog post and corresponding code: https://alex-hhh.github.io/2019/11/custom-rackunit-test-runner.html https://github.com/alex-hhh/ActivityLog2/blob/master/test/custom-test-runner.rkt Shriram -- You received

Re: [racket-users] Re: rackunit and logging

2020-05-23 Thread Shriram Krishnamurthi
Thank you all! *Alexis*, thanks for the explanation. *Alex*, thanks for that information. I'm going to go investigate that next. *Dave*, the documentation style is fine, it's sometimes easier to read the doc right next to the implementation. (-: However, I'm not quite sure how even your

Re: [racket-users] Re: rackunit and logging

2020-05-23 Thread Shriram Krishnamurthi
Sorry to be thinking out loud here… I thought the reason Alex might be using `foldts-test-suite` instead of `fold-test-results` is because the latter automatically runs each test but the former leaves that in programmatic control. I thought this would enable me to catch exceptions, thus (using

[racket-users] foldts-test-suite

2020-05-23 Thread Shriram Krishnamurthi
The documentation https://docs.racket-lang.org/rackunit/internals.html?q=run-test-case#%28def._%28%28lib._rackunit%2Fmain..rkt%29._foldts-test-suite%29%29 says that `folds-test-suite` can be implemented in terms of `fold-test-results` as follows: (define

Re: [racket-users] Re: rackunit and logging

2020-05-23 Thread Shriram Krishnamurthi
Thanks to a helpful reply from Matthias I came across this posting https://github.com/racket/rackunit/pull/107#issuecomment-480808330 which pointed out "The *test* forms are the things that wrap evaluation, catch errors and continue, etc." If I rewrite the above as (define-test-suite hw

[racket-users] Gradescope support

2020-05-23 Thread Shriram Krishnamurthi
If anyone else here is looking for it, the first release of my Gradescope autograding support for Racket is here: https://github.com/shriram/gradescope-racket It's still a work in progress but sufficient to get off the ground (e.g., if I fix nothing it'll still get me through my summer needs).

Re: [racket-users] provide-if-not-defined

2020-09-03 Thread Shriram Krishnamurthi
Thank you both. What I want is something closer to what Oak wrote, but that addresses only *checking*, whereas I also want the convenience of defining the module. So to use Oak's example, I want to be able to write #lang racket/base (provide-if-not-defined + - *) at the top of *all

Re: [racket-users] Re: provide-if-not-defined

2020-09-03 Thread Shriram Krishnamurthi
Ah, I see, that's a nice idea! One problem is have well over a dozen of these that I want to pass-through, but I suppose I could write a (rename-prefix ...) that turns into a bunch of define's. I'd have to be careful to not miss any. Another issue is that I have to redefine some of the

[racket-users] Re: consistent interfaces from multiple files

2020-09-02 Thread Shriram Krishnamurthi
I realize I could have used `define-language` and `define-extended-language` and friends from Redex, except … `redex-match` works over terms, not over syntax objects. Of course I also can't write (redex-match LANG NON-TERM (term (syntax->datum S))) because TERM is a special form, so it

[racket-users] provide-if-not-defined

2020-09-02 Thread Shriram Krishnamurthi
Related to my previous post [ https://groups.google.com/g/racket-users/c/OqyqDFxwhf0], I have several cases where I have this kind of pattern: V1: #lang racket (provide +) V2: #lang racket (provide [rename-out (my-+ +)]) (define my-+ …) Each variant provides some/all primitives directly from

[racket-users] consistent interfaces from multiple files

2020-09-02 Thread Shriram Krishnamurthi
This may be a somewhat niche request, but hopefully it's just a special case of a common need. I have multiple files, say V1 and V2, that each provide the same surface language constructs – e.g., #%app, some macros, some functions — but of course implemented in different ways. I also have

[racket-users] locally linked package name doesn't match info collection name

2020-09-09 Thread Shriram Krishnamurthi
This is almost certainly intended and/or I may have totally misunderstood the semantics of the info file, but this feels a bit confusing: I have a package on my filesystem in the directory mystery-languages-uploader. The "-uploader" part is a local name that's not intended for public

Re: [racket-users] package manager woes on Windows 10?

2020-09-10 Thread Shriram Krishnamurthi
It's not me doing this, it's a student. I agree this is always a possibility. But note that it also happened to a TA. I suppose they could all have been making the same mistake. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe

Re: [racket-users] package manager woes on Windows 10?

2020-09-10 Thread Shriram Krishnamurthi
I asked students to go to File | Install Package (not the DWIM box). From there, I too get this "inferred package name includes disallowed characters" message as Robby. But that isn't what my student got… So it seems a bit unlikely this is the issue? There is the possibility this is somehow

Re: [racket-users] package manager woes on Windows 10?

2020-09-09 Thread Shriram Krishnamurthi
Thank you. Can you imagine why the proxy would affect DrRacket but not the Web browser? -- 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

Re: [racket-users] locally linked package name doesn't match info collection name

2020-09-09 Thread Shriram Krishnamurthi
I'm curious why the Package Manager doesn't also show the collection name (or plural)? Wouldn't I need that to trace backwards? "This program in #lang foo is behaving oddly, I wonder what foo's source is" — find the collection in the PM, trace back to the package, locate the source…? -- You

Re: [racket-users] package manager woes on Windows 10?

2020-09-09 Thread Shriram Krishnamurthi
For what it's worth, one of my TAs now informs me he got the same error on macOS 11.0 Beta. He says he just has the standard macOS firewall. He whitelisted DrRacket and it persists. I asked him to try installing Racket 7.7 and installing the package through that; same issue. He was only able to

[racket-users] Incorporating Markdown documents into Scribble

2020-09-12 Thread Shriram Krishnamurthi
I need a little help with `decode` vs `decode-flow` in Scribble. (Also, this thread is about a question I wasn't able to find answered anywhere, so hopefully it will lead to a solution that others can also use.) Sometimes it's really useful to incorporate Markdown-formatted content into the

Re: [racket-users] Incorporating Markdown documents into Scribble

2020-09-13 Thread Shriram Krishnamurthi
(markdown-inline file) (pr (xexprs->scribble-pres (with-input-from-file file read-markdown Shriram Shriram > > Ryan > > > On Sun, Sep 13, 2020 at 1:50 PM Shriram Krishnamurthi > wrote: > >> It's useful to have this behave like a `#include`. T

Re: [racket-users] Incorporating Markdown documents into Scribble

2020-09-13 Thread Shriram Krishnamurthi
It's useful to have this behave like a `#include`. There are settings where you want to have a non-Scribble person author things that go "in the middle"; you want to think of this as just a more convenient way of writing what you'd have written in Scribble. I realize there's presumably a closure

Re: [racket-users] Incorporating Markdown documents into Scribble

2020-09-13 Thread Shriram Krishnamurthi
Apologies, I left in some debugging code. All we need is @(define (markdown-inline file) (xexprs->scribble-pres (with-input-from-file file read-markdown))) This will do you job, Jos Koot. For instance: @title{Hello} @(markdown-inline "new.md") combined with (as "new.md") This is a *

[racket-users] abstraction suggestion?

2020-08-31 Thread Shriram Krishnamurthi
I'm having some trouble abstracting over this code. Any suggestions? I have numerous files that follow this boilerplate: #lang racket (require ) (provide (rename-out [mod-begin #%module-begin] [ti#%top-interaction])) (define-values (namespaces lang-print-names)

Re: [racket-users] package manager woes on Windows 10?

2020-09-10 Thread Shriram Krishnamurthi
The original student (on Windows 10) has confirmed they were able to install with raco on the shell, which further lends credence to the likelihood that the PM and raco are doing something differently. (I have some other issues w/ the caching and how clearing out the trash doesn't seem to affect

Re: [racket-users] package manager woes on Windows 10?

2020-09-10 Thread Shriram Krishnamurthi
Please note that, per my message last night, this is also happening (my TA claims he saw the *identical* text: multiple red lines, etc.) on macOS 11. So it's not just for Windows any more. On Thu, Sep 10, 2020 at 9:20 AM George Neuner wrote: > > On 9/10/2020 7:37 AM, Hendrik Boom wrote: > > On

Re: [racket-users] printing errors

2020-08-29 Thread Shriram Krishnamurthi
Thank you! Is there a way of further suppressing info? Right now I get output like [image: image.png] ../../make-semantics.rkt:37:13: a: undefined which is a reference to the language implementation file rather than to the program in the language. The programs here are so small that

[racket-users] printing errors

2020-08-27 Thread Shriram Krishnamurthi
Given an exception, is there a way to print the error using Racket's conventional error printing machinery (e.g., in color in DrRacket, etc.), without halting execution? I would like to be able to integrate this with #%printing-module-begin and #%top-interaction. Unfortunately, those by

Re: [racket-users] printing errors

2020-08-27 Thread Shriram Krishnamurthi
This is perfect, thanks! Two follow-up questions: 1. The error printer seems to print an extra newline at the end relative to what the port-display-handler (for instance) shows. Is there a way to suppress that? 2. The stack trace seems to be extracted automatically. Is there a way to suppress

[racket-users] rackunit and logging

2020-05-22 Thread Shriram Krishnamurthi
I'm trying to understand the design of the logging portion of rackunit: https://docs.racket-lang.org/rackunit/Testing_Utilities.html#%28part._.Logging_.Test_.Results%29 1. The "log" seems to only be a *count*, not the actual rackunit output (as the term "log" would suggest). Since I want

Re: [racket-users] combining require, build-path, and namespaces

2020-07-21 Thread Shriram Krishnamurthi
Thank you! Would you know why I might get this error: ; require: unknown module ; module name: ; #> (This is from inside a module.) Trying the same at the REPL, I see the same thing: > (define n (make-base-namespace)) > (namespace-require `(file ,(path->string (build-path "wheats"

Re: [racket-users] combining require, build-path, and namespaces

2020-07-21 Thread Shriram Krishnamurthi
Ooh, thank you Oak and Jens Axel! I would never have figured that out. As Matthew's email from Jan 2020 says, having the documentation say something (and, in particular, suggesting the use of `parameterize` to get what many users might expect) would be quite lovely. (Thanks also, Greg.) Shriram

[racket-users] emoji in source code

2020-07-19 Thread Shriram Krishnamurthi
I wrote the following program: (define /: ') which at least on my screen looks like in Aquamacs and in my browser (modulo dark/light mode). However, no matter which mode I use in OS X AND which color mode I use in DrRacket, the emoji just isn't visible: Not the most pressing problem

[racket-users] suppressing scribble-common.js in Scribble output

2020-07-02 Thread Shriram Krishnamurthi
How does one suppress scribble-common.js? I really don't understand why the file loads for all Scribble langs — it contains things like search box support for documentation! In addition, it takes over the window.onload, overriding any previous content. About this, it has the following odd

[racket-users] suppressing parts of Scribble (HTML) output

2020-07-02 Thread Shriram Krishnamurthi
I am trying to use Scribble to generate HTML documents (blog-like, but not exactly, so Frog doesn't meet my needs) but would really like to eliminate the material in the left gutter (TOC). (Ideally I'd also like to suppress the author tag.) I've spent some time going through the source of Greg

Re: [racket-users] suppressing parts of Scribble (HTML) output

2020-07-02 Thread Shriram Krishnamurthi
Oh my gosh, this is *exactly* what I need! Thank you!!! -- 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. To view this

[racket-users] Gtk initialization failed for display ":0"

2020-07-11 Thread Shriram Krishnamurthi
I'm running headless Racket from a Docker container for auto-grading assignments in Gradescope. The students are writing BSL programs with 2htdp/image. This does not cause any problems for most of them. Two students, however, get an error in file loading with the error message in the subject

[racket-users] nested-flow and inset

2020-07-11 Thread Shriram Krishnamurthi
My reading of the documentation for `nested-flow` https://docs.racket-lang.org/scribble/core.html#%28def._%28%28lib._scribble%2Fcore..rkt%29._make-nested-flow%29%29 is that I can use 'inset as the first argument. However, when I try to do so, I get a contract error: make-nested-flow: contract

[racket-users] Scribble: customizing table borders

2020-07-19 Thread Shriram Krishnamurthi
It *appears* that in Scribble, the color of a table's borders (e.g., bottom-border) is fixed: e.g., 5 generated from a program such as @tabular[#:sep @hspace[2] #:row-properties '(() () bottom-border ()) #:style (style "LongMult" null) I haven't had any luck coming up with the right

Re: [racket-users] Re: Scribble: customizing table borders

2020-07-19 Thread Shriram Krishnamurthi
That did the trick well enough, thank you!!! (I wouldn't mind a cleaner solution, but it gets the job done for now.) -- 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

[racket-users] combining require, build-path, and namespaces

2020-07-21 Thread Shriram Krishnamurthi
How I can combine these three? I want to do something like this: (define n (make-base-namespace)) (define p (build-path f)) (eval `(require ,p) n) Racket doesn't like that: bad syntax for require sub-form because p is a path-typed value. Essentially, I want to inject the module at

[racket-users] namespaces + eval + reader

2020-07-30 Thread Shriram Krishnamurthi
want to create a namespace for (say) the BSL language in DrRacket. Critically, I need the *reader* to be aligned with this language. Otherwise, small semantic discrepancies creep in. Concrete example: > (define n (make-base-namespace)) > (eval `(require lang/htdp-beginner) n) > (eval

[racket-users] telling apart files ending with a newline

2020-07-29 Thread Shriram Krishnamurthi
Suppose I have two files that are identical, except one ends in a newline and the other does not. If I use `read-line` to read the successive lines of this file, because it swallows the line separators, there is no way to tell them apart. E.g., these two strings "a b" and "a b " read using

[racket-users] cross-module `error` changed?

2020-11-06 Thread Shriram Krishnamurthi
Has something changed in how `error` works across modules? This code that I used last year without trouble seems to run into trouble now. Here's the code all in one module: #lang racket (provide yield resume) (define resumer #f) (define (yield) (let/cc k (set! resumer k) (error

[racket-users] parts as the top-level unit in books

2021-04-21 Thread Shriram Krishnamurthi
The Scribble Book format https://docs.racket-lang.org/scribble/Book_Format.html?q=scribble%20book has the *chapter* as the highest-level unit. For a book with lots of chapters, it's useful to have a higher-level unit, like a *part*. (E.g., *How to Design Programs* is broken down by parts, and