[racket-users] Verification, Dependent Types, Theorem Proving interest group

2015-04-23 Thread Jay McCarthy
Please take a look at this Wiki page:

https://github.com/plt/racket/wiki/Verification-and-Advanced-Types-in-Racket

Thanks

3

Jay

-- 
Jay McCarthy
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.
  - DC 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.


Re: [racket-users] web server: database result paging

2015-04-23 Thread David Vanderson



What I want to do is:

create a hash representing the return object
- data to return
- URL for next page function (if applicable)
- URL for prev page function (if applicable)
convert the hash to a jsexpr
send/suspend/dispatch  the jsexpr


#lang web-server/insta

(require json)

(define (response/json jsexpr)
  (response/full 200 #Okay (current-seconds) #application/json
(list)
(list # (jsexpr-bytes jsexpr

(define (start request)
  (define idx 0) ; state stored in continuation

  (define (show-prev-page request)
(set! idx (sub1 idx))
(show-page))

  (define (show-next-page request)
(set! idx (add1 idx))
(show-page))

  (define (show-page)
(send/suspend/dispatch
 (lambda (embed/url)
   ; make hash representing the return object
   (define js-hash (hasheq 'data idx
   'url-next-page (embed/url show-next-page)
   'url-prev-page (embed/url show-prev-page)))

   ; send the response, a hasheq is already a jsexpr
   (response/json js-hash

  (show-page))


Does this do what you want?


My understanding is that when you do send/suspend*, the continuation 
is saved, and the thread finishes.  The continuation and thread are 
not bound together.  So when a request comes in to continue that 
continuation, it will be a different (new?) thread that runs it.


That's fine:  the term thread is overloaded.  I understand that 
Racket threads are user-land scheduler activations [I think that's the 
term] ... i.e. just multiplexed continuations.   My point was that 
there is some execution context hanging around when the thread is 
suspended and it wasn't clear that it would be GC'd if/when  all the 
thread's send/suspend continuations expire.
I don't think any context hangs around apart from the continuation. This 
is close to my knowledge limit though.


Jay - is there any connection between a saved continuation and the 
thread that created it?




There's nothing that says definitively that the servlet continuation 
manager is holding the *only* references to the thread context  [or 
the only strong references if that's more applicable] - somewhere I 
recall Jay explaining the structure being something like:

server-custodian-custodian(s)-thread(s)-user-stuff ???
and it is not clear where the continuation manager lives in the 
hierarchy [ though I can guess ].



Can you give an example of the processing that you want to know has 
been finished?  Do you want the thread serving the request to do some 
processing after sending the response?


The thread can be suspended after sending a response.  What I'd like, 
though, is for it to wake up again and log some exit data when all 
continuations expire.
I'm not sure I understand the motivation here.  Can you give an example 
of the kind of exit data you want to log?


That could - with difficulty - be done from an exception handler if 
the thread is terminated by exception as opposed to simply 
evaporating, and also provided that I know what exception(s) to catch 
or events to wait on.   One of the issues I've had with real-world 
Racket programming is determining what exactly happens when things go 
wrong.  A catch-all  exn or exn:fail  handler doesn't cut it when you 
need more detail, and, of course, the hierarchy is extensible so 
things may be thrown that aren't documented.  read the code is fine 
for research, but it isn't a realistic real-world answer - there's too 
much code and not enough time.  As I said to Jay recently, I wouldn't 
know where to look even if I had the source.




Thanks,
Dave

--
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] web server: database result paging

2015-04-23 Thread Jay McCarthy
On Thu, Apr 23, 2015 at 1:35 PM, David Vanderson
david.vander...@gmail.com wrote:

 What I want to do is:

 create a hash representing the return object
 - data to return
 - URL for next page function (if applicable)
 - URL for prev page function (if applicable)
 convert the hash to a jsexpr
 send/suspend/dispatch  the jsexpr

 #lang web-server/insta

 (require json)

 (define (response/json jsexpr)
   (response/full 200 #Okay (current-seconds) #application/json
 (list)
 (list # (jsexpr-bytes jsexpr

 (define (start request)
   (define idx 0) ; state stored in continuation

   (define (show-prev-page request)
 (set! idx (sub1 idx))
 (show-page))

   (define (show-next-page request)
 (set! idx (add1 idx))
 (show-page))

   (define (show-page)
 (send/suspend/dispatch
  (lambda (embed/url)
; make hash representing the return object
(define js-hash (hasheq 'data idx
'url-next-page (embed/url show-next-page)
'url-prev-page (embed/url show-prev-page)))

; send the response, a hasheq is already a jsexpr
(response/json js-hash

   (show-page))


 Does this do what you want?


 My understanding is that when you do send/suspend*, the continuation is
 saved, and the thread finishes.  The continuation and thread are not bound
 together.  So when a request comes in to continue that continuation, it will
 be a different (new?) thread that runs it.


 That's fine:  the term thread is overloaded.  I understand that Racket
 threads are user-land scheduler activations [I think that's the term] ...
 i.e. just multiplexed continuations.   My point was that there is some
 execution context hanging around when the thread is suspended and it
 wasn't clear that it would be GC'd if/when  all the thread's send/suspend
 continuations expire.

 I don't think any context hangs around apart from the continuation. This is
 close to my knowledge limit though.

 Jay - is there any connection between a saved continuation and the thread
 that created it?

The values of the parameters are saved in the continuation and
inherited from the thread.

Jay


 There's nothing that says definitively that the servlet continuation
 manager is holding the *only* references to the thread context  [or the only
 strong references if that's more applicable] - somewhere I recall Jay
 explaining the structure being something like:
 server-custodian-custodian(s)-thread(s)-user-stuff ???
 and it is not clear where the continuation manager lives in the hierarchy
 [ though I can guess ].


 Can you give an example of the processing that you want to know has been
 finished?  Do you want the thread serving the request to do some processing
 after sending the response?


 The thread can be suspended after sending a response.  What I'd like,
 though, is for it to wake up again and log some exit data when all
 continuations expire.

 I'm not sure I understand the motivation here.  Can you give an example of
 the kind of exit data you want to log?


 That could - with difficulty - be done from an exception handler if the
 thread is terminated by exception as opposed to simply evaporating, and also
 provided that I know what exception(s) to catch or events to wait on.   One
 of the issues I've had with real-world Racket programming is determining
 what exactly happens when things go wrong.  A catch-all  exn or exn:fail
 handler doesn't cut it when you need more detail, and, of course, the
 hierarchy is extensible so things may be thrown that aren't documented.
 read the code is fine for research, but it isn't a realistic real-world
 answer - there's too much code and not enough time.  As I said to Jay
 recently, I wouldn't know where to look even if I had the source.


 Thanks,
 Dave

 --
 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
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.
  - DC 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] infix notation embedded in Racket

2015-04-23 Thread Jos Koot
Long ago I made various parsers (most of them in Fortran or assembler) for
expressions with infix notation. I always used push-down automata with two
or more stacks. Now I am playing with macros in Racket that allow infix
notation embedded in Racket without explicitly using push-down automata.
However, I encounter a contradiction in my desires as explained below. I
have looked at 'Infix expressions for PLT Scheme' available in planet and
made by Jens Axel Søgaard. In his approach a+b is evaluated as though
written as (+ a b). However:
 
#lang at-exp scheme
(require (planet soegaard/infix))
(define a+b 4)
(define a 1) (define b 2)
@${a+b}  ; evaluates to 3
 
A Racket variable can contain characters such as +, -, * etc.
This makes @${a+b} confusing
(not necessarily ambiguous, though, depending on syntax and semantics.
 
In my own toy I require variables and operators to be separated by spaces.
So I write (infix b ^ 2 - 4 * a * c), not (infix b^2-4*a*c).
In my toy b^2-4*a*c is read as a single variable.
Of course notation b^2-4*a*c is attractive.
b ^ 2 - 4 * a * c looks rather ugly,
but allows unambiguous discrimination between operators and variables.
Furthermore my infix can be required within #lang racket.
It does not need at-exp.
 
I allow:
 
(require (rename-in racket (+ plus)))
(infix 1 plus 2) ; expanded to (+ 1 2)
 
My infix accepts procedure and macro calls of the form:
(infix list('a, 'b ,'c)) and
(infix if(test, then-case, else-case))
 
Even more attractive than b^2-4*a*c would be b^2-4ac,
but this would delimit variables to consist of one character only.
 
One one hand I want an attractive notation. On the other hand I want easy
embedding in Racket allowing the use of Racket variables in my infix
expressions
and allowing renames of operators. The two hands contradict each other.
 
I am not sure how to proceed.
Opinions and suggestions are very welcome.
 
Thanks, Jos Koot
 
 
 
 
 
 
 
 

-- 
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] Inheritance problem with private methods

2015-04-23 Thread Aidan Gauland
Ah, yes, I even knew this because I have another private method that I
call like this.  In the same class even, staring me right in the face.
Ah, well.  Thanks for your help!

On 23/04/15 22:40, Alexander D. Knauth wrote:
 If you do this, it works:
 (define/override (a-method)
   (displayln Hello from sub class)
   (another-method))
 Because `another-method` is a private method, send doesn’t know about it (I 
 think; I haven’t used private methods much).  
 
 On Apr 23, 2015, at 5:41 AM, Aidan Gauland aidal...@slingshot.co.nz wrote:
 
 I get a method-lookup failure when I try to call, from a method
 override, a method defined in the overriding class.  (See attached
 program source.)  What do I need to be doing differently for this to work?

 Thanks,
 Aidan


-- 
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] Fwd: Us congress hearing of maan alsaan Money laundry قضية الكونغجرس لغسيل الأموال للمليادير معن الصانع

2015-04-23 Thread mona billy
US Congressional Hearing of

 Saudi billionaire maan  Al Sanea 

 and Money Laundering

with bank of America



With Arabic Subtitles





http://www.youtube.com/watch?v=mIBNnQvhU8s






*موقع اليوتيوب الذي عرض فيديوهات جلسة استماع الكونجرس الأمريكي *

* لمتابعة نشاطات غسل الأموال ونشاطات*



*السعودي معن عبدالواحد الصانع*

*مالك مستشفى  وشركة سعد  ومدارس سعد بالمنطقة الشرقية** بالسعودية * * ورئيس
مجلس ادارة بنك اوال البحريني*



 *وتعليق محطة سي ان بي سي التلفزيونية*



*مترجم باللغة العربية*


http://www.youtube.com/watch?v=mIBNnQvhU8s

-- 
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] Scribble: para without indentation for LaTeX/PDF output

2015-04-23 Thread Alexey Cherkaev
Hi,

I am trying to create something similar to LaTeX's \newtheorem command. Very 
simple implementation (still incomplete) for an Exercise block:

#lang racket
(require scribble/manual)

(provide exercise)

(define exercise-counter 0)

(define (exercise cont)
  (set! exercise-counter (add1 exercise-counter))
  (para
   (bold Exercise )
   (bold (number-string exercise-counter))
   (bold . )
   cont))

The problem I have when I generate PDF is that the paragraph with Exercise is 
indented as a normal paragraph. Is it possible to suppress it directly from 
Scribble or do I need to go and define a paragraph style for LaTeX backend?

Some extra questions:

- Maybe I am doing something that someone has already done. Are there, by any 
chance, implementations of extended set of LaTeX commands?
- Is there a better way to implement a counter? Ideally, I would want to reset 
the counter when section number changes. I would also like to prepend this 
counter with the section counter.

Cheers, Alexey

-- 
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] Environment Diagrams

2015-04-23 Thread s . jiang
Hi,

Is there an environment diagram drawer of any kind for Racket, similar to 
envdraw for Scheme?


Best,

Tony

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