Re: [racket-users] multi line scribble text body in web-server template

2020-11-01 Thread krs...@gmail.com
This is so cool, thank you both!

So my quick fix is:
@when[#t]{
@list{
line1
line2
line3
}
}

And I have been using that Iteration Gotchas code, but I was using it 
blindly.
Now I can reason thru it better.  


On Sunday, November 1, 2020 at 12:41:22 PM UTC-5 jay.mc...@gmail.com wrote:

> This section of the documentation discusses a similar issue that may help 
> you:
>
>
> https://docs.racket-lang.org/web-server/templates.html?q=web%20server#%28part._.Gotchas__.Iteration%29
>
> --
> Jay McCarthy
> Associate Professor @ CS @ UMass Lowell
> http://jeapostrophe.github.io
> Vincit qui se vincit.
>
>
> On Sun, Nov 1, 2020 at 12:22 PM Ben Greenman  
> wrote:
>
>> Thats the nor
>>
>> On 11/1/20, krs...@gmail.com  wrote:
>> >
>> > Hi!,
>> >
>> > I am using web-server/templates
>> > > >.
>> > I am confused why this just displays the last line?:
>> >
>> > @when[#t]{
>> > first
>> > second
>> > }
>>
>> That's normal "when" behavior
>>
>> ```
>> Welcome to Racket v7.8.0.5 [cs].
>> > (when #t "first" "second")
>> "second"
>> ```
>>
>> One fix is to put a list of text in the `when` body. He's how I'd write 
>> it:
>>
>> ```
>> #lang at-exp racket
>>
>> @(define (when-logged-in . pc*)
>>(when #t
>>  pc*))
>>
>> @when-logged-in{
>>   first
>>   second
>> }
>> ```
>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/CAFUu9R5y6%2B6dCeEYEYRTmKVcHr%3DgZQ9UbztXyy82hKD6AxjPNA%40mail.gmail.com
>> .
>>
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/614a71f9-dc41-4c8a-80c3-a4c144c8600en%40googlegroups.com.


Re: [racket-users] multi line scribble text body in web-server template

2020-11-01 Thread Jay McCarthy
This section of the documentation discusses a similar issue that may help
you:

https://docs.racket-lang.org/web-server/templates.html?q=web%20server#%28part._.Gotchas__.Iteration%29

--
Jay McCarthy
Associate Professor @ CS @ UMass Lowell
http://jeapostrophe.github.io
Vincit qui se vincit.


On Sun, Nov 1, 2020 at 12:22 PM Ben Greenman 
wrote:

> Thats the nor
>
> On 11/1/20, krs...@gmail.com  wrote:
> >
> > Hi!,
> >
> > I am using web-server/templates
> > .
> > I am confused why this just displays the last line?:
> >
> > @when[#t]{
> > first
> > second
> > }
>
> That's normal "when" behavior
>
> ```
> Welcome to Racket v7.8.0.5 [cs].
> > (when #t "first" "second")
> "second"
> ```
>
> One fix is to put a list of text in the `when` body. He's how I'd write it:
>
> ```
> #lang at-exp racket
>
> @(define (when-logged-in . pc*)
>(when #t
>  pc*))
>
> @when-logged-in{
>   first
>   second
> }
> ```
>
> --
> 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 discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAFUu9R5y6%2B6dCeEYEYRTmKVcHr%3DgZQ9UbztXyy82hKD6AxjPNA%40mail.gmail.com
> .
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAJYbDanKtsLhNXG8T2jo5MGsk9n8hZv5nHd0DbhVS%3DXR46ZLdw%40mail.gmail.com.


Re: [racket-users] multi line scribble text body in web-server template

2020-11-01 Thread Ben Greenman
Thats the nor

On 11/1/20, krs...@gmail.com  wrote:
>
> Hi!,
>
> I am using web-server/templates
> .
> I am confused why this just displays the last line?:
>
> @when[#t]{
> first
> second
> }

That's normal "when" behavior

```
Welcome to Racket v7.8.0.5 [cs].
> (when #t "first" "second")
"second"
```

One fix is to put a list of text in the `when` body. He's how I'd write it:

```
#lang at-exp racket

@(define (when-logged-in . pc*)
   (when #t
 pc*))

@when-logged-in{
  first
  second
}
```

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAFUu9R5y6%2B6dCeEYEYRTmKVcHr%3DgZQ9UbztXyy82hKD6AxjPNA%40mail.gmail.com.


[racket-users] multi line scribble text body in web-server template

2020-11-01 Thread krs...@gmail.com

Hi!,

I am using web-server/templates 
.
I am confused why this just displays the last line?:

@when[#t]{
first
second
}

I including html only when a user is logged in, and my issue can be 
distilled to the above template syntax.

Happy to elaborate, thank!

--
Paul

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/0061e4f9-cef1-4d8f-8542-b875c3973159n%40googlegroups.com.