
Two questions on using scribble/base. first question. how do I insert a newline in an @title{xx}. I want to do something like “Memo - some text here” “By - my initials” The following does not get me what I want: #lang scribble/base @title{text 1 text 2} @section{text1} xxx @section{text2} xxx —- It renders as “text 1 text 2” *** Second question I tried @title{text 1
text 2}
@section{text1} xxx @section{text2} xxx
->with an added line in the @title section <- And I got a LOT! of warnings and it didnt render.

Use @linebreak[]
to create a line break within a title. Or maybe you want to use @author
after @title
. I see what you mean about the Latex error when you include a blank line, and we should adjust Scribble to avoid that. (Latex is really uncooperative as a back end.)

let/defaults

where / is short for “with”

hello, I’ve been reading through Rash’s source code and found something of the following form: (let ()
<body>)
is there a purpose to a let
that doesn’t introduce any bindings? I can’t seem to figure this out from the documentation.
Thank you!

I think it’s mostly used to introduce the internal definition context.
If you have (if <e1> <e2> <e3>)
, and in <e2>
you want to use define
, you might attempt this:
(if #t
(begin
(define x 1)
x)
#t)
But this results in an error because define
doesn’t work in the expression context. However, you can do this:
(if #t
(let ()
(define x 1)
x)
#t)
Because the body of let
allows internal-definition, this works as expected

Would it be better if I simply make it completely compatible with let
and call it let+
? But otherwise I think I’m gonna stick with loop
, as it’s only 4 character long.

@ruyvalle I think @sorawee is right about why that code does that. Also, the Racket style guide suggests using cond
instead of if
. Various reasons why. Relevant one, here: You could just write: (cond [#t
(define x 1)
x]
[else #t])


Yup, I rarely use if
because of this reason.
In fact, I think that it’s generally a bad style to write (let () ...)
directly in your code. The only place I think it makes sense to use is in macros. For example, if you want to define your own cond
, here’s one possibility (though pretty crappy)
(define-syntax-parser cond*
#:literals (else)
[(_) #'(void)]
[(_ [else . body]) #'(let () . body)]
[(_ [test-expr . body] . rest)
#'(if test-expr (let () . body) (cond* . rest))])

I agree. Well. Sometimes that’s the least-worst choice I’ve found when writing certain rackunit
tests.

great! thank you so much @sorawee and @greg!