[racket-users] NEED || WebSphere Commerce Architect || San Francisco, CA

2015-06-23 Thread Aanchal Arora
Hi Partners,

This is Aanchal from Technology resource Group. Below is the job
description and requirements for your perusal and please contact me if
having any questions or concerns.

*Role: WebSphere Commerce Architect*

*Location: San Francisco, CA*

*Duration:  6 Months (Extension possible) and 2 Week trip to china (Paid)
during the assignment*

*Interview Mode: Telephonic Interview followed by Skype*

*Job Description:*



*We need a contractor with Websphere Commerce platform experience for 6
month assignment. 2 weeks trip to China (paid) during this assignment.*



*It is a Web sphere Commerce platform, like Hybris, or ATG. *



*And it has to be an Architect, a person who understand how this platform
works together.*



Thanks and Regards,

Aanchal Arora | Technical Recruiter

Technology Resource Group Inc.
3736 Hillsdale Court Santa Clara, CA 95051

Office:408-709-1760 Ext : 812 | Direct: 408-826-8378

Gtalk/YM: http://www.tresourceinc.com/ aanchalarora825 | Fax: 408-884-2409

aanc...@tresourceinc.com | www.tresourceinc.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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-23 Thread Thomas Dickerson
On Tuesday, June 23, 2015 at 8:30:32 AM UTC-4, Matthew Flatt wrote:
 Providing #f as the third argument to `local-expand` means that
 
  (+ i j)
 
 is expanded only as far as exposing the primitive function-call form, also 
 known as `#%plain-app`:
 
  (#%plain-app + i j)
 
 When `i` is encountered later, there's no binding in the compile-time
 environment, because the internal-definition context has been
 discarded as the `my-def-stx` macro returned.
 
 Probably you want to replace the `#f` with `null` (which means expand
 without stopping).
Got it - this makes sense, thanks.

 Another possibility is to expand to a
 `letrec-syntaxes+values` form to bind `i` and `j`.

This is actually what I'm trying to avoid - see the earlier note on why I need 
a solution that won't leave behind empty (let-values () ...) forms (or any 
other Racket-specific forms) in the output syntax.
 
 At Tue, 23 Jun 2015 02:13:19 -0400, Thomas Dickerson wrote:
  I seem to be missing some key ingredient here. The following really simply
  test-case, using let-syntaxes, works as expected:
  
   (define-syntax my-def-stx
 (lambda (stx)
   (syntax-case stx (my-def-stx)
 [(my-def-stx (id ...) rhs expr)
  #'(let-syntaxes ([(id ...) rhs]) expr)])))
  
   (my-def-stx
(i j) (values (lambda (stx) #'3) (lambda (stx) #'4))
(+ i j))
  
  Trying the same thing, but with this:
  
   (require (for-syntax syntax/context))
   (define-syntax my-def-stx
 (lambda (stx)
   (syntax-case stx (my-def-stx)
 [(my-def-stx (id ...) rhs expr)
  (let* ([intdef (syntax-local-make-definition-context)]
[ctx (generate-expand-context)])
  (syntax-local-bind-syntaxes (syntax-list #'(id ...))
   (local-transformer-expand #'rhs 'expression null) intdef)
  (internal-definition-context-seal intdef)
  (local-expand #'expr ctx #f intdef))])))
  
   (my-def-stx
(i j) (values (lambda (stx) #'3) (lambda (stx) #'4))
(+ i j))
  
  instead, gives me i: undefined; cannot reference an identifier before its
  definition.
  
  Thomas Dickerson
  
  Brown University
  Department of Computer Science
  115 Waterman St, 4th Floor
  Providence, RI 02912
  
  802-458-0637
  
  On Mon, Jun 22, 2015 at 11:39 PM, Matthew Flatt mfl...@cs.utah.edu wrote:
  
   Probably you don't want to work with namespaces, which are intended more
   for run-time reflection.
  
   For an example of turning internal definitions into
   'letrec-syntaxes+values', try the implementation of 'racket/block'.
  
On Jun 23, 2015, at 10:06 AM, Thomas Dickerson 
   thomas_dicker...@brown.edu wrote:
   
Update / addendum: I was also able to fairly trivially extend Alex's
   code using let-syntax to have the more hygienic behavior for where Accum
   is/is-not visible, but let-syntax ends up leaving an additional layer of
   empty (let-values() ...) behind.
   
The documentation for let-syntax makes the following claim - The
   evaluation of each trans-expr is parameterized to set current-namespace to
   a namespace that shares bindings and variables with the namespace being
   used to expand the let-syntax form, except that its base phase is one
   greater. which seems very much related to what I'd like to accomplish 
   (and
   Shriram's suggestion that I mentioned in the original post); however, I 
   see
   no evidence of this actually taking place in the Racket source-code, it
   just appears to desugar, with very few bells and whistles, to
   letrec-syntaxes+values which evidently is implemented in the C code.
   Digging into syntax-parameterize shows that, unsurprisingly, this is also
   how syntax-parameterize gets desugared, with a few more bells and 
   whistles.
   
So I guess at this point the remainder of my question boils down to
   this: can someone offer any insight into the process of turning macros
   which are introduced by let-syntax or equivalent into macros which are
   introduced implicitly by an internal-definition-context argument to
   local-expand, or by explicit namespace manipulation as hinted at in the
   let-syntax documentation (but which I can't turn up anywhere).
   
On Monday, June 22, 2015 at 5:35:50 PM UTC-4, Thomas Dickerson wrote:
Thanks for the effort that went into figuring that out! A couple first
   thoughts on the implementation:
To first order, this is exactly what I want to be able to do (and it
   elegantly avoids local-expand by reasoning about expansion order); 
   however,
   as a general pattern, it's a bit unhygienic in that Accum is now in the
   global namespace, which precludes using it as a child macro for other
   constructs, and prevents specific instantiations of Loop from requesting a
   different name for Accum to cooperate in nested loops.
   
I also noticed that (syntax-parameterize) isn't totally transparent in
   the expanded syntax - it leaves a bunch of empty (let-values () ...)
   behind, which is fine for 

Re: [racket-users] Closing big-bang windows

2015-06-23 Thread Alexis King
I, for one, thought the idea of “OS” reads and writes from Get Bonus was a neat 
abstraction, even if it is more or less just functional reads and writes to a 
giant hash table. Obviously that’s more complicated than would be appropriate 
for big-bang, but I thought I’d bring it up anyway.

 On Jun 23, 2015, at 8:30 AM, Matthias Felleisen matth...@ccs.neu.edu wrote:
 
 
 I have for years hoped to find time to think about 'distributing state' over 
 handlers in big-bang because I am perfectly aware of the scaling up 
 limitations. Your hashtable idea might be worth exploring. Tony and I are 
 also considering his actor system as a source of ideas. This may also give us 
 a handle at a special-purpose gc as Tony noted yesterday. But now I am way 
 off stuff I have done, and I don't like to discuss things that I might do so 
 forgive me for this much and I'll stop now -- Matthias
 

-- 
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] try a new macro expander

2015-06-23 Thread Neil Toronto

On 06/22/2015 08:25 AM, Matthew Flatt wrote:

At Thu, 21 May 2015 07:15:14 -0600, Matthew Flatt wrote:

Otherwise, be prepared for me to come back in a few
weeks and lobby for moving to a new macro expander.


Here's the proposal: let's switch on July 16. Switch means that I'd
merge the new macro expander to the master branch of the development
repository.


Perhaps a mixture of excitement and trepidation is stifling replies. :)

+10. I'm really looking forward to it.

Neil ⊥

--
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] Closing big-bang windows

2015-06-23 Thread Matthias Felleisen

I have for years hoped to find time to think about 'distributing state' over 
handlers in big-bang because I am perfectly aware of the scaling up 
limitations. Your hashtable idea might be worth exploring. Tony and I are also 
considering his actor system as a source of ideas. This may also give us a 
handle at a special-purpose gc as Tony noted yesterday. But now I am way off 
stuff I have done, and I don't like to discuss things that I might do so 
forgive me for this much and I'll stop now -- Matthias

-- 
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] Macro-introducing macros with inter-macro communication channel

2015-06-23 Thread Matthew Flatt
Providing #f as the third argument to `local-expand` means that

 (+ i j)

is expanded only as far as exposing the primitive function-call form, also 
known as `#%plain-app`:

 (#%plain-app + i j)

When `i` is encountered later, there's no binding in the compile-time
environment, because the internal-definition context has been
discarded as the `my-def-stx` macro returned.

Probably you want to replace the `#f` with `null` (which means expand
without stopping). Another possibility is to expand to a
`letrec-syntaxes+values` form to bind `i` and `j`.

At Tue, 23 Jun 2015 02:13:19 -0400, Thomas Dickerson wrote:
 I seem to be missing some key ingredient here. The following really simply
 test-case, using let-syntaxes, works as expected:
 
  (define-syntax my-def-stx
(lambda (stx)
  (syntax-case stx (my-def-stx)
[(my-def-stx (id ...) rhs expr)
 #'(let-syntaxes ([(id ...) rhs]) expr)])))
 
  (my-def-stx
   (i j) (values (lambda (stx) #'3) (lambda (stx) #'4))
   (+ i j))
 
 Trying the same thing, but with this:
 
  (require (for-syntax syntax/context))
  (define-syntax my-def-stx
(lambda (stx)
  (syntax-case stx (my-def-stx)
[(my-def-stx (id ...) rhs expr)
 (let* ([intdef (syntax-local-make-definition-context)]
   [ctx (generate-expand-context)])
 (syntax-local-bind-syntaxes (syntax-list #'(id ...))
  (local-transformer-expand #'rhs 'expression null) intdef)
 (internal-definition-context-seal intdef)
 (local-expand #'expr ctx #f intdef))])))
 
  (my-def-stx
   (i j) (values (lambda (stx) #'3) (lambda (stx) #'4))
   (+ i j))
 
 instead, gives me i: undefined; cannot reference an identifier before its
 definition.
 
 Thomas Dickerson
 
 Brown University
 Department of Computer Science
 115 Waterman St, 4th Floor
 Providence, RI 02912
 
 802-458-0637
 
 On Mon, Jun 22, 2015 at 11:39 PM, Matthew Flatt mfl...@cs.utah.edu wrote:
 
  Probably you don't want to work with namespaces, which are intended more
  for run-time reflection.
 
  For an example of turning internal definitions into
  'letrec-syntaxes+values', try the implementation of 'racket/block'.
 
   On Jun 23, 2015, at 10:06 AM, Thomas Dickerson 
  thomas_dicker...@brown.edu wrote:
  
   Update / addendum: I was also able to fairly trivially extend Alex's
  code using let-syntax to have the more hygienic behavior for where Accum
  is/is-not visible, but let-syntax ends up leaving an additional layer of
  empty (let-values() ...) behind.
  
   The documentation for let-syntax makes the following claim - The
  evaluation of each trans-expr is parameterized to set current-namespace to
  a namespace that shares bindings and variables with the namespace being
  used to expand the let-syntax form, except that its base phase is one
  greater. which seems very much related to what I'd like to accomplish (and
  Shriram's suggestion that I mentioned in the original post); however, I see
  no evidence of this actually taking place in the Racket source-code, it
  just appears to desugar, with very few bells and whistles, to
  letrec-syntaxes+values which evidently is implemented in the C code.
  Digging into syntax-parameterize shows that, unsurprisingly, this is also
  how syntax-parameterize gets desugared, with a few more bells and whistles.
  
   So I guess at this point the remainder of my question boils down to
  this: can someone offer any insight into the process of turning macros
  which are introduced by let-syntax or equivalent into macros which are
  introduced implicitly by an internal-definition-context argument to
  local-expand, or by explicit namespace manipulation as hinted at in the
  let-syntax documentation (but which I can't turn up anywhere).
  
   On Monday, June 22, 2015 at 5:35:50 PM UTC-4, Thomas Dickerson wrote:
   Thanks for the effort that went into figuring that out! A couple first
  thoughts on the implementation:
   To first order, this is exactly what I want to be able to do (and it
  elegantly avoids local-expand by reasoning about expansion order); however,
  as a general pattern, it's a bit unhygienic in that Accum is now in the
  global namespace, which precludes using it as a child macro for other
  constructs, and prevents specific instantiations of Loop from requesting a
  different name for Accum to cooperate in nested loops.
  
   I also noticed that (syntax-parameterize) isn't totally transparent in
  the expanded syntax - it leaves a bunch of empty (let-values () ...)
  behind, which is fine for Racket, but problematic in my target use-case of
  emitting something which ultimately needs to be an entirely different
  language. This is why my experiments have all involved local-expand - I
  want to introduce expand-time names without introducing wrapping
  let-syntaxes (or similar) forms around my body code.
  
  
   On Saturday, June 20, 2015 at 2:24:40 PM UTC-4, Alex Knauth wrote:
   On Jun 19, 2015, at 7:44 PM, Thomas Dickerson 
  

[racket-users] Re: HTTP Cookies

2015-06-23 Thread Bahman Movaqar
It solved itself:  I had forgotten to set the `Content-Type` of the POST 
request.

Here's a working example of cookies in action:
http://www.bahmanm.com/blogs/grab-packt-racket-scheme

-- 
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] try a new macro expander

2015-06-23 Thread Robby Findler
Excited!

On Tue, Jun 23, 2015 at 10:30 AM, Neil Toronto neil.toro...@gmail.com wrote:
 On 06/22/2015 08:25 AM, Matthew Flatt wrote:

 At Thu, 21 May 2015 07:15:14 -0600, Matthew Flatt wrote:

 Otherwise, be prepared for me to come back in a few
 weeks and lobby for moving to a new macro expander.


 Here's the proposal: let's switch on July 16. Switch means that I'd
 merge the new macro expander to the master branch of the development
 repository.


 Perhaps a mixture of excitement and trepidation is stifling replies. :)

 +10. I'm really looking forward to it.

 Neil ⊥


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


Re: [racket-users] Closing big-bang windows

2015-06-23 Thread Jens Axel Søgaard
John Carmack:

 My son's game has a level editor as well as a game loop, and we switch
 between them.  However, each new big-bang call creates a new window,
 leaving the previous ones inert on the screen.  How can we close the
 windows?



Matthias Felleisen:

 But people wanted it to stay
 open so that they could see the final score of their games etc.

 I guess I could add a close-on-stop clauses for programmers
 such as your son but it sounds almost like he's ready to move
 on to racket proper, as in use the Windowing API directly.


If I understand correctly, a manual

   (close-all-big-bang-windows)

callable from the REPL would be enough in this case?

/Jens Axel

-- 
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] db: nested transactions

2015-06-23 Thread Ryan Culpepper
Yes, that should be fine. One note about your sample code: the isolation 
mode of inner transactions must be #f (the default); you can't change 
isolation levels once you've started an outer transaction. Also keep in 
mind that nested transactions are not supported for ODBC connections.


Ryan


On 06/22/2015 05:05 AM, George Neuner wrote:

Hi all,

I have what I hope is a quick question.  WIth appropriate care to pair
start and commit/rollback, is it safe to use call-with-transaction  and
start-transaction  together?

e.g.,

   (call-with-transaction dbc
 (lambda ()
   :

   (start-transaction dbc #:isolation 'serializable)
  :
   (if (needs-rollback? dbc)
   (rollback-transaction dbc)
   (commit-transaction dbc))

   :
 ) #:isolation 'read-committed )

or the reverse:

   (start-transaction dbc #:isolation 'repeatable-read)
  :

 (call-with-transaction dbc
   (lambda ()
 :
   ) #:isolation 'serializable)

  :
   (if (needs-rollback? dbc)
   (rollback-transaction dbc)
   (commit-transaction dbc))



I am adding functionality involving sub-transactions to an existing code
base that uses call-with-transaction pretty much exclusively and I'm
hoping not to have to change the existing framework.

Thanks,
George

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


Re: [racket-users] try a new macro expander

2015-06-23 Thread Anthony Carrico
. Awesome that Racket keeps pushing the envelope on
meta-programming. It /is/ exciting. I'm somewhat quiet because I'm still
absorbing it as I get the time. There has been chatter on IRC too. Also,
very cool that mflatt is being so open with the community during the dev
cycle. Bring it on.

-- 
Anthony Carrico


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


signature.asc
Description: OpenPGP digital signature


[racket-users] NEED || QA Automation Analyst || San Francisco, CA || Locals

2015-06-23 Thread Aanchal Arora
Hi,

This is Aanchal from Technology resource Group. Below is the job
description and requirements for your perusal and please contact me if
having any questions or concerns.

*If you are available and meet the requirements please respond with
your updated resume in a Microsoft Word formatted document along with
your desired pay rate.*

*If you are not interested, would appreciate if you refer someone for this
position.*

*Role: QA  Automation Analyst*

*Location: San Francisco, CA*

*Duration:  12 Months (Extension possible) *

*Job Description:*



*I have a position in San Francisco, CA that will be a 1-year engagement.
They need a Strong QA Automation Analyst that has experience Selenium,
WebDriver and Good Java programming.  Description is below, please let me
know if you're interested .*



*1. Strong knowledge/skills on QA disciplines and tools*

*2. Experience using Selenium and WebDriver for test automation*

*3. Experiences on using and testing  c apis*

*4. Good Java programming skills for test automation*

*5. Understands how code debugging works.*

*Need to know Java and Selenium*



*NEED TO KNOW JAVA*



Thanks and Regards,

Aanchal Arora | Technical Recruiter

Technology Resource Group Inc.
3736 Hillsdale Court Santa Clara, CA 95051

Office:408-709-1760 Ext : 812 | Direct: 408-826-8378

Gtalk/YM: http://www.tresourceinc.com/ aanchalarora825 | Fax: 408-884-2409

aanc...@tresourceinc.com | www.tresourceinc.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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-23 Thread Thomas Dickerson
Okay - for posterity's sake, here's an updated version of Alex's code that
supports nested Loop/Accum, and doesn't leave any syntactic residue after
expansion. This is now what I set out to accomplish with my original set of
questions:

 #lang racket/base

 (require racket/stxparam
  (for-syntax racket/base
  racket/set
  racket/syntax
  syntax/parse
  syntax/stx
  syntax/context))

 (define-syntax Loop
   (lambda (stx)
 (syntax-parse stx
   [(Loop accum-id:id up-to-expr:expr body:expr ...+)
(let* ([defs (syntax-local-make-definition-context)]
   [ctx (generate-expand-context)])
  (syntax-local-bind-syntaxes
   (list #'accum-id)
   (local-transformer-expand
#'(let ([vars (mutable-set)])
(lambda ([stx #f])
  (if (syntax? stx)
  (syntax-parse stx
[(accum-id x:id dx:expr)
 (set-add! vars (syntax-local-introduce #'x))
 #'(set! x (+ x dx))])
  vars))) 'expression null) defs)
  (internal-definition-context-seal defs)
  (with-syntax* ([(body ...)
  (stx-map
   (lambda (body)
 (with-syntax ([body body])
   (local-expand #'body ctx null defs)))
   #'(body ...))]
 [(init ...)
  (map
   (lambda (var)
 (with-syntax ([var (syntax-local-introduce
 var)]) #'(set! var 0)))
   (set-list
((syntax-local-value
  (internal-definition-context-apply defs
 #'accum-id)
  #f defs])
#'(let ([up-to up-to-expr])
(letrec
([loop
  (lambda (n)
body ...
(let ([n (add1 n)])
  (if ( n up-to)
  (loop n)
  (void])
  init ...
  (loop 0)]
   [(Loop up-to-expr:expr body:expr ...+)
(with-syntax
([Accum (datum-syntax stx 'Accum)])
  #'(Loop Accum up-to-expr body ...))])))

 (let ([x (void)] [y (void)] [z (void)])
   (Loop 2
 (let ([dx 1] [dy 2] [dz 3])
   (Accum x dx)
   (Loop AccumInner 2
 (printf x = ~v, y = ~v, z = ~v\n x y z)
 (Accum y dy)
 (AccumInner z dz)


One last question - the change to using local-expand meant that the loop
body was no longer happy accepting define-values forms and raised Not in a
definition context errors. I can use let to accomplish the same thing
without any problems, but if someone could explain what changes would need
to be made to the local-expand call for that to work, I'd be grateful (for
my own understanding).


Thomas Dickerson

Brown University
Department of Computer Science
115 Waterman St, 4th Floor
Providence, RI 02912

802-458-0637

On Tue, Jun 23, 2015 at 11:17 AM, Thomas Dickerson 
thomas_dicker...@brown.edu wrote:

 On Tuesday, June 23, 2015 at 8:30:32 AM UTC-4, Matthew Flatt wrote:
  Providing #f as the third argument to `local-expand` means that
 
   (+ i j)
 
  is expanded only as far as exposing the primitive function-call form,
 also known as `#%plain-app`:
 
   (#%plain-app + i j)
 
  When `i` is encountered later, there's no binding in the compile-time
  environment, because the internal-definition context has been
  discarded as the `my-def-stx` macro returned.
 
  Probably you want to replace the `#f` with `null` (which means expand
  without stopping).
 Got it - this makes sense, thanks.

  Another possibility is to expand to a
  `letrec-syntaxes+values` form to bind `i` and `j`.

 This is actually what I'm trying to avoid - see the earlier note on why I
 need a solution that won't leave behind empty (let-values () ...) forms (or
 any other Racket-specific forms) in the output syntax.

  At Tue, 23 Jun 2015 02:13:19 -0400, Thomas Dickerson wrote:
   I seem to be missing some key ingredient here. The following really
 simply
   test-case, using let-syntaxes, works as expected:
  
(define-syntax my-def-stx
  (lambda (stx)
(syntax-case stx (my-def-stx)
  [(my-def-stx (id ...) rhs expr)
   #'(let-syntaxes ([(id ...) rhs]) expr)])))
   
(my-def-stx
 (i j) (values (lambda (stx) #'3) (lambda (stx) #'4))
 (+ i j))
   
   Trying the same thing, but with this:
  
(require (for-syntax syntax/context))
(define-syntax my-def-stx
  (lambda (stx)
(syntax-case stx (my-def-stx)
  [(my-def-stx (id ...) rhs expr)
   (let* ([intdef 

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-23 Thread Scott Moore
I ran into this issue recently. The right answer for me was to write a
trampolining macro. define-values is treated specially by the macro
expander and thus can't be handled easily in a local expand. The pattern I
ended up using (adapted from an old mailing list post by Ryan and a
discussion with Matthew and Robby) is the following:

1) expand in whatever the current syntax context is and add define-values
to the stop list (to prevent attempting to expand it outside of a
definition context)

(local-expand my-stx (syntax-local-context) (list #'define-values))

2) Use syntax-case on the resulting syntax to find any occurrences of
define-values, then replace the body of each define-values with a new call
to your macro:

(define-syntax (my-syntax stx)
  (syntax-case stx ()
[(my-syntax expr)
 (syntax-case (local-expand stx (syntax-local-context) (list
#'define-values)) ()
   [(define-values (id) expr) (define-values (id) (my-syntax expr))]
   [other other])]))

Note this code might not work verbatim... I abstracted it from my example
as I pasted it in...

This pattern seems fairly robust for getting your macro to run on all of
the expanded code in a local context. The downside is that your macro will
need to work correctly in this staged fashion where things run as the
expander gets to them.

Hope this helps.

Cheers,
Scott

On Tue, Jun 23, 2015 at 2:23 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu
wrote:

 Based on the documentation, I thought that the right answer would be
 `(list (gensym))` but that didn't work -- hopefully someone else
 knows.

 Sam

 On Tue, Jun 23, 2015 at 4:43 PM, Thomas Dickerson
 thomas_dicker...@brown.edu wrote:
  I thought that might be the case, but the documentation is pretty dense
 (and
  self-referential), so it's not clear what the correct value for that
  argument is.
 
  Thomas Dickerson
 
  Brown University
  Department of Computer Science
  115 Waterman St, 4th Floor
  Providence, RI 02912
 
  802-458-0637
 
  On Tue, Jun 23, 2015 at 3:57 PM, Sam Tobin-Hochstadt 
 sa...@cs.indiana.edu
  wrote:
 
  To fix your last issue, you probably want to provide a different value
 as
  the `context-v` argument (the 2nd one) to `local-expand`.
 
  Sam
 
  On Tue, Jun 23, 2015 at 3:46 PM Thomas Dickerson
  thomas_dicker...@brown.edu wrote:
 
  Okay - for posterity's sake, here's an updated version of Alex's code
  that supports nested Loop/Accum, and doesn't leave any syntactic
 residue
  after expansion. This is now what I set out to accomplish with my
 original
  set of questions:
 
  #lang racket/base
 
  (require racket/stxparam
   (for-syntax racket/base
 
   racket/set
   racket/syntax
   syntax/parse
   syntax/stx
   syntax/context))
 
  (define-syntax Loop
(lambda (stx)
  (syntax-parse stx
[(Loop accum-id:id up-to-expr:expr body:expr ...+)
 (let* ([defs (syntax-local-make-definition-context)]
[ctx (generate-expand-context)])
   (syntax-local-bind-syntaxes
(list #'accum-id)
(local-transformer-expand
 #'(let ([vars (mutable-set)])
 (lambda ([stx #f])
   (if (syntax? stx)
   (syntax-parse stx
 [(accum-id x:id dx:expr)
  (set-add! vars (syntax-local-introduce #'x))
 
 
  #'(set! x (+ x dx))])
 
   vars))) 'expression null) defs)
   (internal-definition-context-seal defs)
   (with-syntax* ([(body ...)
   (stx-map
(lambda (body)
  (with-syntax ([body body])
(local-expand #'body ctx null defs)))
#'(body ...))]
  [(init ...)
   (map
(lambda (var)
  (with-syntax ([var (syntax-local-introduce
  var)]) #'(set! var 0)))
(set-list
 ((syntax-local-value
   (internal-definition-context-apply defs
  #'accum-id)
   #f defs])
 #'(let ([up-to up-to-expr])
 
 
 (letrec
 ([loop
   (lambda (n)
 body ...
 
 (let ([n (add1 n)])
   (if ( n up-to)
   (loop n)
   (void])
   init ...
   (loop 0)]
 
 
[(Loop up-to-expr:expr body:expr ...+)
 
 (with-syntax
 ([Accum (datum-syntax stx 'Accum)])
   #'(Loop Accum up-to-expr body ...))])))
 
  (let ([x (void)] [y (void)] [z (void)])
(Loop 2
  (let ([dx 1] [dy 2] [dz 3])

Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-23 Thread Thomas Dickerson
I thought that might be the case, but the documentation is pretty dense
(and self-referential), so it's not clear what the correct value for that
argument is.

Thomas Dickerson

Brown University
Department of Computer Science
115 Waterman St, 4th Floor
Providence, RI 02912

802-458-0637

On Tue, Jun 23, 2015 at 3:57 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu
wrote:

 To fix your last issue, you probably want to provide a different value as
 the `context-v` argument (the 2nd one) to `local-expand`.

 Sam

 On Tue, Jun 23, 2015 at 3:46 PM Thomas Dickerson 
 thomas_dicker...@brown.edu wrote:

 Okay - for posterity's sake, here's an updated version of Alex's code
 that supports nested Loop/Accum, and doesn't leave any syntactic residue
 after expansion. This is now what I set out to accomplish with my original
 set of questions:

 #lang racket/base

 (require racket/stxparam
  (for-syntax racket/base

  racket/set
  racket/syntax
  syntax/parse
  syntax/stx
  syntax/context))

 (define-syntax Loop
   (lambda (stx)
 (syntax-parse stx
   [(Loop accum-id:id up-to-expr:expr body:expr ...+)
(let* ([defs (syntax-local-make-definition-context)]
   [ctx (generate-expand-context)])
  (syntax-local-bind-syntaxes
   (list #'accum-id)
   (local-transformer-expand
#'(let ([vars (mutable-set)])
(lambda ([stx #f])
  (if (syntax? stx)
  (syntax-parse stx
[(accum-id x:id dx:expr)
 (set-add! vars (syntax-local-introduce #'x))


 #'(set! x (+ x dx))])

  vars))) 'expression null) defs)
  (internal-definition-context-seal defs)
  (with-syntax* ([(body ...)
  (stx-map
   (lambda (body)
 (with-syntax ([body body])
   (local-expand #'body ctx null defs)))
   #'(body ...))]
 [(init ...)
  (map
   (lambda (var)
 (with-syntax ([var (syntax-local-introduce
 var)]) #'(set! var 0)))
   (set-list
((syntax-local-value
  (internal-definition-context-apply defs
 #'accum-id)
  #f defs])
#'(let ([up-to up-to-expr])


(letrec
([loop
  (lambda (n)
body ...

(let ([n (add1 n)])
  (if ( n up-to)
  (loop n)
  (void])
  init ...
  (loop 0)]


   [(Loop up-to-expr:expr body:expr ...+)

(with-syntax
([Accum (datum-syntax stx 'Accum)])
  #'(Loop Accum up-to-expr body ...))])))

 (let ([x (void)] [y (void)] [z (void)])
   (Loop 2
 (let ([dx 1] [dy 2] [dz 3])
   (Accum x dx)
   (Loop AccumInner 2


 (printf x = ~v, y = ~v, z = ~v\n x y z)

 (Accum y dy)
 (AccumInner z dz)


 One last question - the change to using local-expand meant that the loop
 body was no longer happy accepting define-values forms and raised Not in a
 definition context errors. I can use let to accomplish the same thing
 without any problems, but if someone could explain what changes would need
 to be made to the local-expand call for that to work, I'd be grateful (for
 my own understanding).


 Thomas Dickerson

 Brown University
 Department of Computer Science
 115 Waterman St, 4th Floor
 Providence, RI 02912

 802-458-0637

 On Tue, Jun 23, 2015 at 11:17 AM, Thomas Dickerson 
 thomas_dicker...@brown.edu wrote:

 On Tuesday, June 23, 2015 at 8:30:32 AM UTC-4, Matthew Flatt wrote:
  Providing #f as the third argument to `local-expand` means that
 
   (+ i j)
 
  is expanded only as far as exposing the primitive function-call form,
 also known as `#%plain-app`:
 
   (#%plain-app + i j)
 
  When `i` is encountered later, there's no binding in the compile-time
  environment, because the internal-definition context has been
  discarded as the `my-def-stx` macro returned.
 
  Probably you want to replace the `#f` with `null` (which means expand
  without stopping).
 Got it - this makes sense, thanks.

  Another possibility is to expand to a
  `letrec-syntaxes+values` form to bind `i` and `j`.

 This is actually what I'm trying to avoid - see the earlier note on why
 I need a solution that won't leave behind empty (let-values () ...) forms
 (or any other Racket-specific forms) in the output syntax.

  At Tue, 23 Jun 2015 02:13:19 -0400, Thomas Dickerson wrote:
   I seem to be missing some 

Re: [racket-users] Racket v6.2

2015-06-23 Thread Anthony Carrico
On 06/19/2015 11:19 PM, Ryan Culpepper wrote:
 With this release we are taking a major step forward to get our user
 community even more involved than in the past...

It looks like I'm running currently running a snapshot. I've ran from
github before, but I'll admit I'm not sure where I'd go to understand
how to build from the multiple github repos. If instructions exist, it
might be time to link to them under the http://racket-lang.org/ contrib.
Hopefully that would include:

* how to check-out Racket and whatever other repos,
* build out-of-tree,
* run racket,
* sync,
* build again.

-- 
Anthony Carrico


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


signature.asc
Description: OpenPGP digital signature


Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-23 Thread Sam Tobin-Hochstadt
Based on the documentation, I thought that the right answer would be
`(list (gensym))` but that didn't work -- hopefully someone else
knows.

Sam

On Tue, Jun 23, 2015 at 4:43 PM, Thomas Dickerson
thomas_dicker...@brown.edu wrote:
 I thought that might be the case, but the documentation is pretty dense (and
 self-referential), so it's not clear what the correct value for that
 argument is.

 Thomas Dickerson

 Brown University
 Department of Computer Science
 115 Waterman St, 4th Floor
 Providence, RI 02912

 802-458-0637

 On Tue, Jun 23, 2015 at 3:57 PM, Sam Tobin-Hochstadt sa...@cs.indiana.edu
 wrote:

 To fix your last issue, you probably want to provide a different value as
 the `context-v` argument (the 2nd one) to `local-expand`.

 Sam

 On Tue, Jun 23, 2015 at 3:46 PM Thomas Dickerson
 thomas_dicker...@brown.edu wrote:

 Okay - for posterity's sake, here's an updated version of Alex's code
 that supports nested Loop/Accum, and doesn't leave any syntactic residue
 after expansion. This is now what I set out to accomplish with my original
 set of questions:

 #lang racket/base

 (require racket/stxparam
  (for-syntax racket/base

  racket/set
  racket/syntax
  syntax/parse
  syntax/stx
  syntax/context))

 (define-syntax Loop
   (lambda (stx)
 (syntax-parse stx
   [(Loop accum-id:id up-to-expr:expr body:expr ...+)
(let* ([defs (syntax-local-make-definition-context)]
   [ctx (generate-expand-context)])
  (syntax-local-bind-syntaxes
   (list #'accum-id)
   (local-transformer-expand
#'(let ([vars (mutable-set)])
(lambda ([stx #f])
  (if (syntax? stx)
  (syntax-parse stx
[(accum-id x:id dx:expr)
 (set-add! vars (syntax-local-introduce #'x))


 #'(set! x (+ x dx))])

  vars))) 'expression null) defs)
  (internal-definition-context-seal defs)
  (with-syntax* ([(body ...)
  (stx-map
   (lambda (body)
 (with-syntax ([body body])
   (local-expand #'body ctx null defs)))
   #'(body ...))]
 [(init ...)
  (map
   (lambda (var)
 (with-syntax ([var (syntax-local-introduce
 var)]) #'(set! var 0)))
   (set-list
((syntax-local-value
  (internal-definition-context-apply defs
 #'accum-id)
  #f defs])
#'(let ([up-to up-to-expr])


(letrec
([loop
  (lambda (n)
body ...

(let ([n (add1 n)])
  (if ( n up-to)
  (loop n)
  (void])
  init ...
  (loop 0)]


   [(Loop up-to-expr:expr body:expr ...+)

(with-syntax
([Accum (datum-syntax stx 'Accum)])
  #'(Loop Accum up-to-expr body ...))])))

 (let ([x (void)] [y (void)] [z (void)])
   (Loop 2
 (let ([dx 1] [dy 2] [dz 3])
   (Accum x dx)
   (Loop AccumInner 2


 (printf x = ~v, y = ~v, z = ~v\n x y z)

 (Accum y dy)
 (AccumInner z dz)


 One last question - the change to using local-expand meant that the loop
 body was no longer happy accepting define-values forms and raised Not in a
 definition context errors. I can use let to accomplish the same thing
 without any problems, but if someone could explain what changes would need
 to be made to the local-expand call for that to work, I'd be grateful (for
 my own understanding).


 Thomas Dickerson

 Brown University
 Department of Computer Science
 115 Waterman St, 4th Floor
 Providence, RI 02912

 802-458-0637

 On Tue, Jun 23, 2015 at 11:17 AM, Thomas Dickerson
 thomas_dicker...@brown.edu wrote:

 On Tuesday, June 23, 2015 at 8:30:32 AM UTC-4, Matthew Flatt wrote:
  Providing #f as the third argument to `local-expand` means that
 
   (+ i j)
 
  is expanded only as far as exposing the primitive function-call form,
  also known as `#%plain-app`:
 
   (#%plain-app + i j)
 
  When `i` is encountered later, there's no binding in the compile-time
  environment, because the internal-definition context has been
  discarded as the `my-def-stx` macro returned.
 
  Probably you want to replace the `#f` with `null` (which means expand
  without stopping).
 Got it - this makes sense, thanks.

  Another possibility is to expand to a
  `letrec-syntaxes+values` form to bind `i` and `j`.

 This is actually what I'm trying to avoid - see the earlier 

Re: [racket-users] Racket v6.2

2015-06-23 Thread Matthew Butterick
PS The 'extra-pkgs' directory is a tiny bit special:

http://docs.racket-lang.org/pkg/git-workflow.html?q=git#%28part._clone-link%29

On Tue, Jun 23, 2015 at 5:39 PM, Jay McCarthy jay.mccar...@gmail.com
wrote:

 On Tue, Jun 23, 2015 at 4:26 PM, Anthony Carrico acarr...@memebeam.org
 wrote:
  On 06/19/2015 11:19 PM, Ryan Culpepper wrote:
  With this release we are taking a major step forward to get our user
  community even more involved than in the past...
 
  It looks like I'm running currently running a snapshot. I've ran from
  github before, but I'll admit I'm not sure where I'd go to understand
  how to build from the multiple github repos. If instructions exist, it
  might be time to link to them under the http://racket-lang.org/ contrib.
  Hopefully that would include:
 
  * how to check-out Racket and whatever other repos,
  * build out-of-tree,
  * run racket,
  * sync,
  * build again.

 Here's what I do for building from git, and I think it's the simplest
 thing:

 $ git clone https://github.com/plt/racket
 $ cd racket
 $ make

 This clones a single (small) repository and then builds everything. It
 will automatically install the latest version of whatever other
 packages you need without actually cloning any of the other
 repositories. This means that you have a pretty minimal connection to
 git.

 When you need to update again, you can just update racket and then do
 another make and it will download the updates for the packages too.

 Now, sometimes you will actually want to have the git repos of other
 packages. That's easy too. Since I work on the Web server, here's what
 I did:

 # Create a helpful directory. There's nothing special about this name,
 but I like it
 $ mkdir extra-pkgs
 $ cd extra-pkgs
 # Tell racket to switch the web-server package from being a tar-ball
 install to being a git clone
 $ raco pkg update --clone web-server

 Now I'm good to go to

 $ cd web-server
 $ ed web-server-lib/web-server/main.rkt

 and so forth.

 Something that is neat about the new world is that it is easy to have
 a released version of Racket downloaded from the site, but have a git
 clone of some small set of other package repos that you are doing
 development on. The only difference will be the first three steps.

 I hope this helps,

 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.


-- 
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] Racket v6.2

2015-06-23 Thread Jay McCarthy
Yes, it is already included in the .gitignore file. I guess I meant
it's not special to _Racket_, but it is useful to have a convention
for stuff like git and helping others. :)

Jay

On Tue, Jun 23, 2015 at 11:30 PM, Matthew Butterick m...@mbtype.com wrote:
 PS The 'extra-pkgs' directory is a tiny bit special:

 http://docs.racket-lang.org/pkg/git-workflow.html?q=git#%28part._clone-link%29

 On Tue, Jun 23, 2015 at 5:39 PM, Jay McCarthy jay.mccar...@gmail.com
 wrote:

 On Tue, Jun 23, 2015 at 4:26 PM, Anthony Carrico acarr...@memebeam.org
 wrote:
  On 06/19/2015 11:19 PM, Ryan Culpepper wrote:
  With this release we are taking a major step forward to get our user
  community even more involved than in the past...
 
  It looks like I'm running currently running a snapshot. I've ran from
  github before, but I'll admit I'm not sure where I'd go to understand
  how to build from the multiple github repos. If instructions exist, it
  might be time to link to them under the http://racket-lang.org/ contrib.
  Hopefully that would include:
 
  * how to check-out Racket and whatever other repos,
  * build out-of-tree,
  * run racket,
  * sync,
  * build again.

 Here's what I do for building from git, and I think it's the simplest
 thing:

 $ git clone https://github.com/plt/racket
 $ cd racket
 $ make

 This clones a single (small) repository and then builds everything. It
 will automatically install the latest version of whatever other
 packages you need without actually cloning any of the other
 repositories. This means that you have a pretty minimal connection to
 git.

 When you need to update again, you can just update racket and then do
 another make and it will download the updates for the packages too.

 Now, sometimes you will actually want to have the git repos of other
 packages. That's easy too. Since I work on the Web server, here's what
 I did:

 # Create a helpful directory. There's nothing special about this name,
 but I like it
 $ mkdir extra-pkgs
 $ cd extra-pkgs
 # Tell racket to switch the web-server package from being a tar-ball
 install to being a git clone
 $ raco pkg update --clone web-server

 Now I'm good to go to

 $ cd web-server
 $ ed web-server-lib/web-server/main.rkt

 and so forth.

 Something that is neat about the new world is that it is easy to have
 a released version of Racket downloaded from the site, but have a git
 clone of some small set of other package repos that you are doing
 development on. The only difference will be the first three steps.

 I hope this helps,

 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.


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


Re: [racket-users] Macro-introducing macros with inter-macro communication channel

2015-06-23 Thread Thomas Dickerson
I seem to be missing some key ingredient here. The following really simply
test-case, using let-syntaxes, works as expected:

 (define-syntax my-def-stx
   (lambda (stx)
 (syntax-case stx (my-def-stx)
   [(my-def-stx (id ...) rhs expr)
#'(let-syntaxes ([(id ...) rhs]) expr)])))

 (my-def-stx
  (i j) (values (lambda (stx) #'3) (lambda (stx) #'4))
  (+ i j))

Trying the same thing, but with this:

 (require (for-syntax syntax/context))
 (define-syntax my-def-stx
   (lambda (stx)
 (syntax-case stx (my-def-stx)
   [(my-def-stx (id ...) rhs expr)
(let* ([intdef (syntax-local-make-definition-context)]
  [ctx (generate-expand-context)])
(syntax-local-bind-syntaxes (syntax-list #'(id ...))
 (local-transformer-expand #'rhs 'expression null) intdef)
(internal-definition-context-seal intdef)
(local-expand #'expr ctx #f intdef))])))

 (my-def-stx
  (i j) (values (lambda (stx) #'3) (lambda (stx) #'4))
  (+ i j))

instead, gives me i: undefined; cannot reference an identifier before its
definition.

Thomas Dickerson

Brown University
Department of Computer Science
115 Waterman St, 4th Floor
Providence, RI 02912

802-458-0637

On Mon, Jun 22, 2015 at 11:39 PM, Matthew Flatt mfl...@cs.utah.edu wrote:

 Probably you don't want to work with namespaces, which are intended more
 for run-time reflection.

 For an example of turning internal definitions into
 'letrec-syntaxes+values', try the implementation of 'racket/block'.

  On Jun 23, 2015, at 10:06 AM, Thomas Dickerson 
 thomas_dicker...@brown.edu wrote:
 
  Update / addendum: I was also able to fairly trivially extend Alex's
 code using let-syntax to have the more hygienic behavior for where Accum
 is/is-not visible, but let-syntax ends up leaving an additional layer of
 empty (let-values() ...) behind.
 
  The documentation for let-syntax makes the following claim - The
 evaluation of each trans-expr is parameterized to set current-namespace to
 a namespace that shares bindings and variables with the namespace being
 used to expand the let-syntax form, except that its base phase is one
 greater. which seems very much related to what I'd like to accomplish (and
 Shriram's suggestion that I mentioned in the original post); however, I see
 no evidence of this actually taking place in the Racket source-code, it
 just appears to desugar, with very few bells and whistles, to
 letrec-syntaxes+values which evidently is implemented in the C code.
 Digging into syntax-parameterize shows that, unsurprisingly, this is also
 how syntax-parameterize gets desugared, with a few more bells and whistles.
 
  So I guess at this point the remainder of my question boils down to
 this: can someone offer any insight into the process of turning macros
 which are introduced by let-syntax or equivalent into macros which are
 introduced implicitly by an internal-definition-context argument to
 local-expand, or by explicit namespace manipulation as hinted at in the
 let-syntax documentation (but which I can't turn up anywhere).
 
  On Monday, June 22, 2015 at 5:35:50 PM UTC-4, Thomas Dickerson wrote:
  Thanks for the effort that went into figuring that out! A couple first
 thoughts on the implementation:
  To first order, this is exactly what I want to be able to do (and it
 elegantly avoids local-expand by reasoning about expansion order); however,
 as a general pattern, it's a bit unhygienic in that Accum is now in the
 global namespace, which precludes using it as a child macro for other
 constructs, and prevents specific instantiations of Loop from requesting a
 different name for Accum to cooperate in nested loops.
 
  I also noticed that (syntax-parameterize) isn't totally transparent in
 the expanded syntax - it leaves a bunch of empty (let-values () ...)
 behind, which is fine for Racket, but problematic in my target use-case of
 emitting something which ultimately needs to be an entirely different
 language. This is why my experiments have all involved local-expand - I
 want to introduce expand-time names without introducing wrapping
 let-syntaxes (or similar) forms around my body code.
 
 
  On Saturday, June 20, 2015 at 2:24:40 PM UTC-4, Alex Knauth wrote:
  On Jun 19, 2015, at 7:44 PM, Thomas Dickerson 
 thomas_dicker...@brown.edu wrote:
 
  I was intending for that example to have the variables be defined
 outside the macro, but being able to create the (set! ...) forms outside
 should mean I could also hypothetically create let/define-values forms.
 This is why I originally specified being able to effect generation of both
 prologue + epilogue code.
 
  I figured this out for code that will be expanded after the body:
 
  #lang racket/base
 
  (require racket/stxparam
  (for-syntax racket/base
  syntax/parse
  racket/set
  ))
 
  ;; (syntax-parameter-value vars) : (U #f (MutableSetof Identifier))
  (define-syntax-parameter vars #f)
 
  

Re: [racket-users] Gear VR

2015-06-23 Thread Matthias Felleisen

We welcome all posts connected to Racket. Post away. -- Matthias

p.s. The question is whether you get suitable feedback. My life is so abstract, 
I sometimes wonder what reality is :-) 




On Jun 23, 2015, at 7:36 PM, John Carmack wrote:

 The intersection of Gear VR owners and Racket users may consist of just me at 
 the moment, but if anyone else here is interested in discussing the work I am 
 doing with driving VR by Racket/Scheme, I would welcome the input.  Would 
 that be an appropriate topic on the list?
  
 
 -- 
 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.


Re: [racket-users] Racket v6.2

2015-06-23 Thread Jay McCarthy
On Tue, Jun 23, 2015 at 4:26 PM, Anthony Carrico acarr...@memebeam.org wrote:
 On 06/19/2015 11:19 PM, Ryan Culpepper wrote:
 With this release we are taking a major step forward to get our user
 community even more involved than in the past...

 It looks like I'm running currently running a snapshot. I've ran from
 github before, but I'll admit I'm not sure where I'd go to understand
 how to build from the multiple github repos. If instructions exist, it
 might be time to link to them under the http://racket-lang.org/ contrib.
 Hopefully that would include:

 * how to check-out Racket and whatever other repos,
 * build out-of-tree,
 * run racket,
 * sync,
 * build again.

Here's what I do for building from git, and I think it's the simplest thing:

$ git clone https://github.com/plt/racket
$ cd racket
$ make

This clones a single (small) repository and then builds everything. It
will automatically install the latest version of whatever other
packages you need without actually cloning any of the other
repositories. This means that you have a pretty minimal connection to
git.

When you need to update again, you can just update racket and then do
another make and it will download the updates for the packages too.

Now, sometimes you will actually want to have the git repos of other
packages. That's easy too. Since I work on the Web server, here's what
I did:

# Create a helpful directory. There's nothing special about this name,
but I like it
$ mkdir extra-pkgs
$ cd extra-pkgs
# Tell racket to switch the web-server package from being a tar-ball
install to being a git clone
$ raco pkg update --clone web-server

Now I'm good to go to

$ cd web-server
$ ed web-server-lib/web-server/main.rkt

and so forth.

Something that is neat about the new world is that it is easy to have
a released version of Racket downloaded from the site, but have a git
clone of some small set of other package repos that you are doing
development on. The only difference will be the first three steps.

I hope this helps,

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] Racket v6.2

2015-06-23 Thread Anthony Carrico
On 06/23/2015 04:26 PM, Anthony Carrico wrote:
 On 06/19/2015 11:19 PM, Ryan Culpepper wrote:
 With this release we are taking a major step forward to get our user
 community even more involved than in the past...
 
 It looks like I'm running currently running a snapshot. I've ran from
 github before, but I'll admit I'm not sure where I'd go to understand
 how to build from the multiple github repos. If instructions exist, it
 might be time to link to them under the http://racket-lang.org/

I guess that would be:
  https://github.com/plt/racket/blob/master/INSTALL.txt

The 550 lines of which start with:

For Unix platforms, instead of using this source repository, consider
getting source for the current Racket release from

  http://download.racket-lang.org/

or get a source snapshot (updated daily) from

  http://pre.racket-lang.org/installers/;

which is how I probably ended up with my random snapshot rather than git :).

-- 
Anthony Carrico


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


signature.asc
Description: OpenPGP digital signature


[racket-users] Gear VR

2015-06-23 Thread John Carmack
The intersection of Gear VR owners and Racket users may consist of just me at 
the moment, but if anyone else here is interested in discussing the work I am 
doing with driving VR by Racket/Scheme, I would welcome the input.  Would that 
be an appropriate topic on the list?

-- 
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] Gear VR

2015-06-23 Thread Neil Toronto

On 06/23/2015 07:36 PM, John Carmack wrote:

The intersection of Gear VR owners and Racket users may consist of just
me at the moment, but if anyone else here is interested in discussing
the work I am doing with driving VR by Racket/Scheme, I would welcome
the input.  Would that be an appropriate topic on the list?


Very yes. Also, I'm definitely in the intersection: I've just changed 
research topics to functional 3D, and I've written a rendering engine 
and modeling API in Racket for it.


What part do you have Racket playing in driving VR?

Neil ⊥

--
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] Gear VR

2015-06-23 Thread John Carmack
Here is the overview of the work that I recently sent out internally.

I started out with a pure-functional scripting interface, but it very rapidly 
became imperative, and it is in heavy flux.  The sample scripts do capture the 
general flavor that I want this to have -- I think it will be easy enough to 
get interesting things happening that it will still tempt people who might be a 
little hostile to working in a Lisp.

--

Here is the first preview of the general purpose VR scripting environment I 
have been working on.  There isn’t anything exciting to look at, but if you 
squint real hard you can see where it might be going.  After I get a bit 
farther along, we can build a PC version as well for cross platform support.

Motivation:

Doing VR GUI development in the native apps is unpleasant – you can gut it out 
in C++ with our current interfaces, but the iteration times and code structure 
don’t make it a lot of fun.

In-editor prototyping is nice in Unity, but actual on-device testing cycle 
times are terrible, and you wind up with all the bulk of Unity and poor access 
to the native VR features like TimeWarp layers.

With app signing, we have no way for developers to casually share work with 
each other or limited communities.

My solution is to support development of VR applications in a scripting 
language with several modes:

“Web like”, where the script is downloaded from the net for each execution and 
run by a single signed app that we provide (NetHMD).  Fully specified by an 
app-scheme URI, this allows VR experiences to be launched directly from web 
pages or app-links on Facebook, which I think is VERY powerful – read about how 
great something is while browsing on your phone, then just click the link and 
get the “insert into HMD” dialog and jump right there.  VR scripts can link to 
other VR scripts without leaving VR.  There is no direct monetization here, but 
IAP can eventually be supported.

“App like”, where the script is bundled into a conventional apk to be 
distributed through the store, and the scripting is simply used as a more 
effective development environment for some classes of applications.

“Remote development”, where the script is actually executed in an IDE on a PC, 
communicating with NetHMD over a TCP connection.  This allows sub-second 
code-change to VR change iteration cycles, and the use of a debugger.  There 
might also be a use for a related mode where a central server directly drives 
one or more clients.

Where it will win first:

My “reference application” is the linking of multiple panoramic photos with 
text and audio annotations.  This is a completely obvious application that is 
not performance sensitive, and even a non-programmer could copy-paste-modify 
the simple script for this to make a high quality experience.

Once I hook up an ExoPlayer interface, this will completely subsume what I 
wanted to accomplish with “experience files” – the addition of static prop 
models to panoramic video, linking between different videos, merging of models 
or panoramas with videos that aren’t fully panoramic (GoPro, etc), and so on.

Once I hook up the Social interfaces, this will make it much easier to build 
trivial “activities” for multi-user experiences – board games, card games, etc.

It is already a big help for basic graphics development work – being able to 
just position a few quads with a custom shader and iterate on the shader 
programming remotely without rebuilding is a huge win.

Implementation:

This will be controversial, and I will have a longer discussion about it, but I 
chose Scheme (a Lisp) for the scripting language.  If this all works out, we 
can eventually make C# and Javascript versions, but I have a bunch of reasons 
for going this way first.  I am using Racket http://racket-lang.org/ for the PC 
development environment, and Chibi Scheme for the embedded interpreter on 
Android.  Download Racket and walk through their quick-intro-with-pictures to 
get a feel for the language and you should be able to hack on the sample 
scripts I have been writing pretty quickly.  Note that Racket is a very 
extended Scheme targeted at desktop apps, the embedded version is just the 
basic standard.

All texture / model / sound resources are loaded and cached from network URI.  
For testing, you can just paste in any URI from a Google image search, which is 
convenient.  For an actual project development, dropbox should work fine.

I am favoring ease of development over performance, and it definitely won’t be 
suitable for a lot of tasks, but everything we have done with first party apps 
so far should be at least a candidate for development in this style once it is 
mature.

Everything is super-rough right now, and I keep thinking “one more day of work 
will clean it up better for people to look at”, but it is past time I at least 
get this on everyone’s radar.

actual Android apk redacted -- it is too