[racket-users] Questions about module encapsulation guarantees

2018-09-09 Thread Jack Firth
If I make a symbol with `gensym` (or do anything else that creates a new 
value that's not `eq?` to any other value) in some module, what are the 
absolute upper limits on my ability to use that symbol within the module 
without allowing any other modules to get ahold of the symbol? What do code 
inspectors, namespaces, sandboxes, eval, `unsafe` APIs, the FFI, etc. make 
possible for malicious code in external modules?

Context: I'm exploring a "contract witness" idea whose implementation 
currently relies on the eq?-ness of opaque struct instances for security. 
But I vaguely recall hearing once that the The Only Way To Be Sure when it 
comes to struct encapsulation is to put the definition of a struct inside a 
lambda, otherwise some sort of nebulous "bad things" are possible in 
external code that wants to break the invariants of  a struct type.

-- 
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: dynamically creating and traversing slides

2018-09-09 Thread Vincent Nys
Went for a walk and had an idea. I think this sample illustrates the answer 
to my own question:

#lang slideshow
(define (retract-up-to s retracted)
  (let ([newly-retracted (retract-most-recent-slide)])
(if (eq? newly-retracted s)
(cons newly-retracted retracted)
(retract-up-to s (cons newly-retracted retracted)

(slide
 #:title "Slide 1")
(slide
 #:title "Slide 2")
(slide
 #:title "Slide 3")

(slide
 #:title "Branching slide"
 (clickback
  (t "1")
  (λ ()
(let* ([remainder (retract-up-to remainder-start (list))]
   [branch-start #f]
   [_ (begin
(slide #:title "1"
   (clickback
(t "a")
(λ ()
  (slide #:title "a"
 (clickback
  (t "resume remainder")
  (λ ()
(retract-up-to branch-start '())
(re-slide (car remainder))
(start-at-recent-slide)
(for ([rem-sl (cdr remainder)])
  (re-slide rem-sl)
  (start-at-recent-slide
(set! branch-start (most-recent-slide)))])
  (start-at-recent-slide)
(define branching-slide (most-recent-slide))

(slide
 #:title "Remainder 1")
(define remainder-start (most-recent-slide))
(slide
 #:title "Remainder 2")
(slide
 #:title "Remainder 3")

-- 
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] dynamically creating and traversing slides

2018-09-09 Thread Vincent Nys
Hi,

I'm working on some lecture slides and I'd like my students to list some 
examples. My idea was to have a few question marks on my slides that I 
would click to reveal the example whenever someone calls it out. But I'm 
stuck, because while I can add a slide at the end of the presentation and 
go there with start-at-recent-slide, I don't know how to get back to the 
slide after the one with the question marks once all the examples have been 
listed. Is there a general way to dynamically generate new slides and then 
get back to the original structure? Is this sort of thing intended to be a 
part of slideshow or is this more related to the viewer?

Regards,

Vincent

-- 
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: Build racket failure if I translate the text in racket/share/pkgs/scribble-lib/scribble/private/manual-bind.rkt

2018-09-09 Thread Oling Cat
OK, I should make this 

 
change together.

On Friday, September 7, 2018 at 9:26:45 PM UTC+8, Oling Cat wrote:
>
> I'm translating the racket docs into Chinese and made some change in 
> scribble like this 
> 
> ,
> and it will cause follow errors:
>
> raco setup: rendering: /racket-index/scribblings/main/search.scrbl
>> make-script: internal error: unexpected tooltip
>>   context...:
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/pkgs/racket-index/scribblings/main/private/make-search.rkt:116:4:
>>  
>> for-loop
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/pkgs/racket-index/scribblings/main/private/make-search.rkt:64:0:
>>  
>> make-script
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/base-render.rkt:971:4:
>>  
>> render-content method in render%
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1528:4:
>>  
>> render-plain-content method in render-mixin
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/base-render.rkt:971:4:
>>  
>> render-content method in render%
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1188:4:
>>  
>> do-render-paragraph method in render-mixin
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1216:4:
>>  
>> render-intrapara-block method in render-mixin
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/base-render.rkt:917:4:
>>  
>> render-compound-paragraph method in render%
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1768:4:
>>  
>> render-compound-paragraph method in render-mixin
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1175:6:
>>  
>> loop
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1172:4:
>>  
>> render-flow* method in render-mixin
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:1099:4:
>>  
>> render-part-content method in render-mixin
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/html-render.rkt:820:4:
>>  
>> render-one-part method in render-mixin
>>loop
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/racket/share/pkgs/scribble-lib/scribble/contract-render.rkt:14:4:
>>  
>> render method in override-render-mixin
>>   
>>  
>> /home/cat/Source/Racket-zh/racket/pkgs/racket-index/setup/scribble.rkt:1431:3
>>... 
>
>
> I'm confusing that why the building will fail if I just replace some ASCII 
> strings with Unicode string? How to resolve it?
>
> Thanks!
>

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