Re: [racket-users] Can scribble/lp2 typeset comments within chunks?

2015-12-23 Thread Jay McCarthy
They aren't actually converted to whitespace, instead, the layout
algorithm looks at the source location information and renders things
where they were in the original file, the presence of the comments
basically makes a jump in the line numbers.

I do think it would be nice to just convert them to comments, but I
wanted to point out that currently the body of the chunk is basically
`read`.

Jay

On Tue, Dec 22, 2015 at 9:00 PM, Matthew Butterick  wrote:
> I'm a scribble/lp2 noob for sure, but why not eliminate the need for 
> `code:comment` within a `chunk`?
>
> Because I find this curious: when the `chunk` is typeset in documentation 
> mode, scribble/lp2 is apparently parsing the comments, because they get 
> converted to whitespace. So ... instead of converting them to whitespace, why 
> not just typeset them literally?
>
> Noob question complete
>
>
> On Dec 22, 2015, at 2:45 PM, Asumu Takikawa  wrote:
>
>> On 2015-12-18 12:20:13 -0800, Matthew Butterick wrote:
>>> Third try: also tried scribble/comment-reader [2] but this doesn't work
>>> (apparently because `racketblock` knows about `code:comment` but `chunk` 
>>> does
>>> not:
>>
>> I think things like `code:comment` are intended to work, but don't because 
>> they're
>> not bound to anything within chunk blocks. For example, this works:
>>
>>  #lang scribble/lp2
>>
>>  @chunk[prologue
>> (define code:comment 3)]
>>
>>  @CHUNK[<*>
>> prologue
>> (define (f x) ; not g
>>   (code:comment "foo")
>>   (* x x))]
>>
>> But this typesets the silly definition of `code:comment` too. Maybe the
>> scribble/lp2 language should bind these forms in chunk blocks. (UNSYNTAX
>> doesn't work for the same reason)
>>
>> Cheers,
>> Asumu
>
> --
> 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.



-- 
Jay McCarthy
Associate Professor
PLT @ CS @ UMass Lowell
http://jeapostrophe.github.io

   "Wherefore, be not weary in well-doing,
  for ye are laying the foundation of a great work.
And out of small things proceedeth that which is great."
  - D 64:33

-- 
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.


[racket-users] Problems with 'provide'

2015-12-23 Thread David Storrs
Hi folks,

I have a file, "util.rkt", the complete text of which is:

== QUOTE
#lang racket

(require racket/pretty)

(define (print-prettier s)
  (parameterize ([pretty-print-columns 1])
(pretty-print s)))

(define (hash-key-is? h k v)
  (and (hash-has-key? h k)
   (equal? (hash-ref h k) v)))

(provide (all-defined-out))
 /QUOTE

(Without the ===QUOTE stuff, obviously)

>From the same directory, I do this:

[dstorrs@localhost:~/scheme:<>]$ racket
racket
Welcome to Racket v6.3.
-> (require "./util.rkt")
(require "./util.rkt")
-> hash-key-is?
hash-key-is?
; hash-key-is?: undefined;
;  cannot reference undefined identifier
; [,bt for context]
-> (require "util.rkt")
(require "util.rkt")
-> hash-key-is?
hash-key-is?
; hash-key-is?: undefined;
;  cannot reference undefined identifier
; [,bt for context]


I've also tried changing the provide like to:  (provide print-prettier
hash-key-is?) but that changed nothing.

I've got another module which ends with a (provide (all-defined-out)) and
that one makes its functions available just fine.

What's going on?

-- 
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.


Re: [racket-users] Abridged summary of racket-users@googlegroups.com - 17 updates in 5 topics

2015-12-23 Thread sagar tripathy
I am trying to make a gui for htdp/image packet with interactive windows
but the documentation for windows is bit fuzzy. I do not know where to
start.

On Wed, Dec 23, 2015 at 1:06 PM,  wrote:

> racket-users@googlegroups.com
> 
>  Google
> Groups
> 
> 
> Today's topic summary
> View all topics
> 
>
>- listing the identifiers from "all-defined-out" and "all-from-out"
><#151cdc509fdab055_group_thread_0> - 2 Updates
>- Can scribble/lp2 typeset comments within chunks?
><#151cdc509fdab055_group_thread_1> - 2 Updates
>- Confused about the difference between the REPL and the toplevel.
><#151cdc509fdab055_group_thread_2> - 5 Updates
>- backwards incompatible change to redex: does it break your models?
><#151cdc509fdab055_group_thread_3> - 1 Update
>- DrRacket crashes on simple pict3d script
><#151cdc509fdab055_group_thread_4> - 7 Updates
>
> listing the identifiers from "all-defined-out" and "all-from-out"
> 
> Asumu Takikawa : Dec 22 05:21PM -0500
>
> On 2015-12-18 17:27:54 -0800, Sanjeev Sharma wrote:
>
> > all-defined-out
> > all-from-out
>
> > I can't yet make sense of regprov.rkt
>
> Do you mean how can you tell what's exported given a particular ...more
> 
> Benjamin Greenman : Dec 22 09:03PM -0500
>
> You might also like `filtered-out` from `racket/provide` [1]. The code
> sample below prints two identifiers (at compile-time):
>
> a:x
>
> y
>
>
> [1] ...more
> 
> Back to top <#151cdc509fdab055_digest_top>
> Can scribble/lp2 typeset comments within chunks?
> 
> Asumu Takikawa : Dec 22 05:45PM -0500
>
> On 2015-12-18 12:20:13 -0800, Matthew Butterick wrote:
> > Third try: also tried scribble/comment-reader [2] but this doesn't work
> > (apparently because `racketblock` knows about `code:comment` but ...more
> 
> Matthew Butterick : Dec 22 06:00PM -0800
>
> I'm a scribble/lp2 noob for sure, but why not eliminate the need for
> `code:comment` within a `chunk`?
>
> Because I find this curious: when the `chunk` is typeset in documentation
> mode, scribble/lp2 is ...more
> 
> Back to top <#151cdc509fdab055_digest_top>
> Confused about the difference between the REPL and the toplevel.
> 
> Matthew Flatt : Dec 22 06:37AM -0700
>
> Expanding a form triggers compile-time evaluation in the sense of
> running macros. Currently, though, compilation treats changing the set
> of bindings at the top level as a kind of run-time effect (to ...more
> 
> Matthew Flatt : Dec 22 06:38AM -0700
>
> At Mon, 21 Dec 2015 21:30:45 -0700, Leif Andersen wrote:
> > #'5)
> > foo))
>
> > I get back the compiled object.
>
> The compiled object ends with a reference to a ...more
> 
> Matthew Flatt : Dec 22 06:46AM -0700
>
> I think Robby was confused by your example (which is understandable).
>
> The `expand` function does not splice any differently than `compile`,
> so `compile` behaves the same as `expand` in your ...more
> 
> Robby Findler : Dec 22 07:54AM -0600
>
> Oh right. Sorry for the confusion!
>
> Robby
>
> ...more
> 
> Leif Andersen : Dec 22 06:57PM -0700
>
> Okay, thank you for the explanation.
>
> I totally see what you mean now by the top level being hopeless. (Or
> at least I think I do.) It seems there is no way to get a meaning that
> ...more
> 
> Back to top <#151cdc509fdab055_digest_top>
> backwards incompatible change to 

[racket-users] Racket server for production use

2015-12-23 Thread Marc Kaufmann
Hi all,

I am hopefully going to implement a minor website for gathering survey data for 
some research I am doing. Due to data privacy and so on, I want to be extra 
careful about security. First, I didn't understand the security concerns about 
URLS at http://docs.racket-lang.org/web-server/faq.html, nor its solution (see 
end of email for the full question which confuses me).

Secondly, do I understand correctly that for a production-ready website, I 
would use the Racket serve/servlet - or are there other/better servers I would 
use? I've only used the serve/servlet on my local machine and wouldn't 
understand the security concerns until I was hacked (and even then...). 

The question that left me more confused than reassured (primarily because I 
don't understand what HTTP traffic in the clear is - as opposed to HTTPS?):

"10.7. What special considerations are there for security with the Web Server?

The biggest problem is that a naive usage of continuations will allow 
continuations to subvert authentication mechanisms. Typically, all that is 
necessary to execute a continuation is its URL. Thus, URLs must be as protected 
as the information in the continuation.

Consider if you link to a public site from a private continuation URL: the 
Referrer field in the new HTTP request will contain the private URL. 
Furthermore, if your HTTP traffic is in the clear, then these URLs can be 
easily poached.

One solution to this is to use a special cookie as an authenticator. This way, 
if a URL escapes, it will not be able to be used, unless the cookie is present. 
For advice about how to do this well, see Dos and Don’ts of Client 
Authentication on the Web from the MIT Cookie Eaters.

Note: It may be considered a great feature that URLs can be shared this way, 
because delegation is easily built into an application via URLs."

Cheers,

Marc

-- 
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.


[racket-users] Re: Problems with 'provide'

2015-12-23 Thread JCG
looking at your output, it seems clear that the first (require "./util.rkt") 
was subjected to (read) but not evaluated.  Otherwise, the second line would be 
a prompt instead of the echoed s-expression.

Check your .racketrc file.   

-- 
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.


Re: [racket-users] Problems with 'provide'

2015-12-23 Thread Robby Findler
Is it possible you have two util.rkt files and you are in the wrong
directory?

Robby

On Wednesday, December 23, 2015, David Storrs 
wrote:

> Hi folks,
>
> I have a file, "util.rkt", the complete text of which is:
>
> == QUOTE
> #lang racket
>
> (require racket/pretty)
>
> (define (print-prettier s)
>   (parameterize ([pretty-print-columns 1])
> (pretty-print s)))
>
> (define (hash-key-is? h k v)
>   (and (hash-has-key? h k)
>(equal? (hash-ref h k) v)))
>
> (provide (all-defined-out))
>  /QUOTE
>
> (Without the ===QUOTE stuff, obviously)
>
> From the same directory, I do this:
>
> [dstorrs@localhost:~/scheme:<>]$ racket
> racket
> Welcome to Racket v6.3.
> -> (require "./util.rkt")
> (require "./util.rkt")
> -> hash-key-is?
> hash-key-is?
> ; hash-key-is?: undefined;
> ;  cannot reference undefined identifier
> ; [,bt for context]
> -> (require "util.rkt")
> (require "util.rkt")
> -> hash-key-is?
> hash-key-is?
> ; hash-key-is?: undefined;
> ;  cannot reference undefined identifier
> ; [,bt for context]
>
>
> I've also tried changing the provide like to:  (provide print-prettier
> hash-key-is?) but that changed nothing.
>
> I've got another module which ends with a (provide (all-defined-out)) and
> that one makes its functions available just fine.
>
> What's going on?
>
>
>
>
>
> --
> 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.
>

-- 
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.


[racket-users] Re: Problems with 'provide'

2015-12-23 Thread David Storrs
Nope, only one. And I checked to make sure I was in the right directory.

On Wednesday, December 23, 2015, Robby Findler 
wrote:

> Is it possible you have two util.rkt files and you are in the wrong
> directory?
>
> Robby
>
> On Wednesday, December 23, 2015, David Storrs  > wrote:
>
>> Hi folks,
>>
>> I have a file, "util.rkt", the complete text of which is:
>>
>> == QUOTE
>> #lang racket
>>
>> (require racket/pretty)
>>
>> (define (print-prettier s)
>>   (parameterize ([pretty-print-columns 1])
>> (pretty-print s)))
>>
>> (define (hash-key-is? h k v)
>>   (and (hash-has-key? h k)
>>(equal? (hash-ref h k) v)))
>>
>> (provide (all-defined-out))
>>  /QUOTE
>>
>> (Without the ===QUOTE stuff, obviously)
>>
>> From the same directory, I do this:
>>
>> [dstorrs@localhost:~/scheme:<>]$ racket
>> racket
>> Welcome to Racket v6.3.
>> -> (require "./util.rkt")
>> (require "./util.rkt")
>> -> hash-key-is?
>> hash-key-is?
>> ; hash-key-is?: undefined;
>> ;  cannot reference undefined identifier
>> ; [,bt for context]
>> -> (require "util.rkt")
>> (require "util.rkt")
>> -> hash-key-is?
>> hash-key-is?
>> ; hash-key-is?: undefined;
>> ;  cannot reference undefined identifier
>> ; [,bt for context]
>>
>>
>> I've also tried changing the provide like to:  (provide print-prettier
>> hash-key-is?) but that changed nothing.
>>
>> I've got another module which ends with a (provide (all-defined-out)) and
>> that one makes its functions available just fine.
>>
>> What's going on?
>>
>>
>>
>>
>>
>> --
>> 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.
>>
>

-- 
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.