Prithvi Prabhu | 23 May 07:45 2015
Picon

Minimal steps to get macro-expansion working with #lang s-exp?

I'm trying to build a toy language. Below, "sample.rkt" uses #lang s-exp "toy.rkt", where "toy.rkt"
provides #%top and #%app. What's the right way to get macro expansion to work in "sample.rkt"? 

The following example, as-is, prints:

(ast 'def (list (ast 'fun (list (ast 'a '(b)) (ast 'foo '(a b))))))

However, commenting out the first (provide...) and uncommenting the second (provide ...) causes a
failure with 

defun: use does not match pattern: (defun name args body0 body ...) in: (defun add (a b) (foo a b))

What's the bare-minimum I should be providing from "toy.rkt"?

--- toy.rkt ---

#lang racket

;; This works.
(provide (except-out (all-from-out racket)
                     #%top #%app)
         (rename-out [top #%top] 
                     [app #%app]))

;; This fails.
;(provide #%module-begin
;         #%top-interaction
;         (rename-out [top #%top] 
;                     [app #%app]))

(Continue reading)

Alexander D. Knauth | 23 May 00:17 2015

Is there a way for a function to tell how many values it's caller expects? (the continuation expects?)

Is there a way for a function to tell how many values it’s caller expects it to return?

I’ve tried this and it didn’t work:
#lang racket
(define (show-k-arity)
  (let/ec k
    (error 'print-k-arity "the arity of k is ~v" (procedure-arity k))))
(let-values ([(x y) (show-k-arity)]) (void))

--

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

Tony Garnock-Jones | 22 May 22:52 2015

racket-explorer now deals with cyclic/mutable data

Hi all,

I've updated racket-explorer (https://github.com/tonyg/racket-explorer)
to handle cyclic (and mutable) data by lazily (and repeatedly) unfolding
children only when the triangle next to an item is opened (and every
time it is opened).

If you've tried it before and been discouraged at its handling of large,
mutable, or infinite structures, please have another go and file bug
reports using GH issues!
(https://github.com/tonyg/racket-explorer/issues/new)

Thanks,
  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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.

Jos Koot | 22 May 19:40 2015
Picon

disappeeraing binding arrows

Below two versions of a very stripped version of a macro I have made.
In version 1 background expansion and check-syntax show binding arrows within macro stx-case.
However, in version 2 the arrows are not shown.
How come?
Thanks, Jos
 
#lang racket
 
(require (for-syntax racket))
 
;;; version 1
 
(begin-for-syntax
 (define-syntax (stx-case stx) ; Here background expansion and macro stepper
  (syntax-case stx ()          ; do show binding arrows in stx-case.
   ((_ stx-expr clause ...)
    (with-syntax
     ((+ (datum->syntax stx '+))
      (- (datum->syntax stx '-))
      (* (datum->syntax stx '*))
      (/ (datum->syntax stx '/)))
   #'(syntax-case stx-expr (+ - * /) clause ...))))))
 
(define-syntax (a stx)
 (stx-case stx
  ((_ +) #''plus)
  ((_ -) #''minus)
  ((_ *) #''mult)
  ((_ /) #''div)
  ((_ x) #''x)))
 
;;; version 2
 
(define-syntax (b stx)
 (define-syntax (stx-case stx) ; Here background expansion and macro stepper
  (syntax-case stx ()          ; do NOT show binding arrows in stx-case.
   ((_ stx-expr clause ...)
    (with-syntax
     ((+ (datum->syntax stx '+))
      (- (datum->syntax stx '-))
      (* (datum->syntax stx '*))
      (/ (datum->syntax stx '/)))
   #'(syntax-case stx-expr (+ - * /) clause ...)))))
 (stx-case stx
  ((_ +) #''plus)
  ((_ -) #''minus)
  ((_ *) #''mult)
  ((_ /) #''div)
  ((_ x) #''x)))
 
; Both a and b work correctly:
 
(a +)
(a else)
(b -)
(b else)

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Junsong Li | 22 May 18:27 2015
Picon

BSL expansion

Hello list,

I am wondering how to expand a BSL program into the Racket _core language_? Let's say a simple program:

(define (id x) x)

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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Andy Keep | 22 May 04:28 2015
Picon

[CFP] *DEADLINE EXTENDED* Scheme and Functional Programming Workshop 2015

========================================================================

DEADLINE EXTENDED: Submissions is now May 31st, 2015

Call For Papers:

Scheme and Functional Programming Workshop 2015
Vancouver, British Columbia, Canada
(Co-located with ICFP 2015)

http://andykeep.com/SchemeWorkshop2015/

========================================================================

Submissions related to Scheme, Racket, Clojure, and functional
programming are welcome and encouraged. Topics of interest include
but are not limited to:

  * Program-development environments, debugging, testing
  * Implementation (interpreters, compilers, tools, benchmarks, etc.)
  * Syntax, macros, hygiene
  * Distributed computing, concurrency, parallelism
  * Interoperability with other languages, FFIs
  * Continuations, modules, object systems, types
  * Theory, formal semantics, correctness
  * History, evolution and standardization of Scheme
  * Applications, experience and industrial uses of Scheme
  * Education
  * Scheme pearls (elegant, instructive uses of Scheme)

We also welcome submissions related to dynamic or multiparadigmatic
languages and programming techniques.

========================================================================

Important Dates:

May 31st, 2015 - Paper deadline (was May 22nd, 2015)
July 5th, 2015 - Author notification (was June 26th, 2015)
July 26th, 2015 - Camera-ready deadline (was July 19th, 2015)
September 4th, 2015 - Workshop

========================================================================

Submissions must be in ACM proceedings format, no smaller than 9-point
type (10-point type preferred). Microsoft Word and LaTeX templates for
this format are available at:
http://www.acm.org/sigs/sigplan/authorInformation.htm

Submissions should be in PDF and printable on US Letter.

To encourage authors to submit their best work, this year we are
encouraging shorter papers (around 6 pages, excluding references). This
is to allow authors to submit longer, revised versions of their papers
to archival conferences or journals. Longer papers (10--12 pages) are
also acceptable, if the extra space is needed. There is no maximum
length limit on submissions, but good submissions will likely be in the
range of 6 to 12 pages.

More information available at: http://andykeep.com/SchemeWorkshop2015/

========================================================================

Organizers:
Andy Keep, Cisco Systems Inc. (General Chair)
Ryan Culpepper, Northeastern University (Program Chair)

(Apologies for duplications from cross-posting.)

========================================================================

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.
Daniel Prager | 22 May 00:52 2015
Picon

Re: How to fill a shape with a texture using 2htdp/image or similar?

Thanks Jens

That looks great. I'll give MetaPict whirl!

Dan

On Fri, May 22, 2015 at 2:28 AM, Jens Axel Søgaard <jensaxel-2WZPQIjRgZTk1uMJSBkQmQ@public.gmane.org> wrote:
Here is an example from MetaPict:

http://soegaard.github.io/docs/metapict/metapict.html#%28def._%28%28lib._metapict%2Fpict..rkt%29._brushstipple%29%29

The same effect can be achieved by setting the brush to a stipple 
and then filling a path.

/Jens Axel


2015-05-20 17:03 GMT+02:00 Robby Findler <robby-5YcgHWA4rVnfxgxxWyf0drK6bRJNSFrb@public.gmane.org>:
2htdp/image doesn't support that now, but the "color" argument of
various functions there could be generalized to support a new "brush"
struct (in the way that pen structs work for outline images) that had
a bitmap field to do what you want. The internal helper function
mode-color->brush would have to change to support that, which would be
pretty straightforward I expect (it creates a brush% object). And then
there's the work of updating the documentation and adding new examples
and test cases.

The relevant files are mrlib/image-core and various files in the 2htdp
collection. Patches welcome. :)

Robby


On Tue, May 19, 2015 at 6:36 PM, Daniel Prager
<daniel.a.prager-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 2htdp/image makes it easy to draw all sorts of solid shapes (triangles,
> squares, stars, etc.) and fill them with a solid color.
>
> But say I want to fill with a texture (say from a bitmap loaded from a
> file). I could brute-force it by creating a separate stencil image,
> converting both to pixels and converting back, but that seems laborious, or
> presumably switch to GL.
>
> Any other ideas?
>
> Thanks
>
> Dan
>
> --
> 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> 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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.



--
--
Jens Axel Søgaard




--
Daniel Prager
Agile/Lean Coaching, Software Development and Leadership
Twitter:  <at> agilejitsu 

--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.
Vishesh Yadav | 22 May 00:36 2015
Picon

Web framework in racket

Hi!

I'm working on racket web server to implement a basic web app. I found myself doing lots of low level stuff
like cookie handling, session management etc almost from scratch. I was thinking to abstract all these
stuff into some small library maybe, but before that I wanted to ask if there is already some work done by
someone to avoid redoing all this. Would also be nice to know about people's experiences writing web code.

Thanks!
Vishesh

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.
Robby Findler | 21 May 18:41 2015

Re: How to fill a shape with a texture using 2htdp/image or similar?

Oh, nice! We should add brushstipple to pict itself.

Robby

On Thu, May 21, 2015 at 11:28 AM, Jens Axel Søgaard
<jensaxel@...> wrote:
> Here is an example from MetaPict:
>
> http://soegaard.github.io/docs/metapict/metapict.html#%28def._%28%28lib._metapict%2Fpict..rkt%29._brushstipple%29%29
>
> The same effect can be achieved by setting the brush to a stipple
> and then filling a path.
>
> /Jens Axel
>
>
> 2015-05-20 17:03 GMT+02:00 Robby Findler <robby@...>:
>>
>> 2htdp/image doesn't support that now, but the "color" argument of
>> various functions there could be generalized to support a new "brush"
>> struct (in the way that pen structs work for outline images) that had
>> a bitmap field to do what you want. The internal helper function
>> mode-color-≥brush would have to change to support that, which would be
>> pretty straightforward I expect (it creates a brush% object). And then
>> there's the work of updating the documentation and adding new examples
>> and test cases.
>>
>> The relevant files are mrlib/image-core and various files in the 2htdp
>> collection. Patches welcome. :)
>>
>> Robby
>>
>>
>> On Tue, May 19, 2015 at 6:36 PM, Daniel Prager
>> <daniel.a.prager@...> wrote:
>> > 2htdp/image makes it easy to draw all sorts of solid shapes (triangles,
>> > squares, stars, etc.) and fill them with a solid color.
>> >
>> > But say I want to fill with a texture (say from a bitmap loaded from a
>> > file). I could brute-force it by creating a separate stencil image,
>> > converting both to pixels and converting back, but that seems laborious,
>> > or
>> > presumably switch to GL.
>> >
>> > Any other ideas?
>> >
>> > Thanks
>> >
>> > Dan
>> >
>> > --
>> > 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+unsubscribe@...
>> > 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+unsubscribe@...
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> --
> Jens Axel Søgaard
>

--

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

Matthew Flatt | 21 May 15:15 2015
Picon

try a new macro expander

I've been working on a new model of macros for Racket. The new model
provides a simple account of scope, makes reasoning about macros
easier, and simplifies the implementation of the macro expander while
fixing bugs (e.g., submodules in Typed Racket).

You can read more about the model here:

  http://www.cs.utah.edu/~mflatt/scope-sets-5/

Section 3 includes a download link and a report on how current packages
fare with the new expander:

  http://www.cs.utah.edu/~mflatt/scope-sets-5/implementation.html

As that report shows, most libraries and packages work as-is, but not
all of them work --- and that's counting only code that's registered at
the package catalog.

Unfortunately, we can't support multiple macro languages and keep all
old libraries working unmodified. The change is at the level of syntax
objects and scope representation, which is part of the foundation for
supporting multiple languages, and all Racket languages have to agree
on that part.

Although my experience with the new expander has been positive, I don't
think anyone else has worked with it seriously, yet. Give it a try if
you have time. Otherwise, be prepared for me to come back in a few
weeks and lobby for moving to a new macro expander.

--

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

Greg Hendershott | 21 May 14:05 2015
Picon

Re: pkg-build report for the v6.2 release candidate

1. Thanks for figuring this out!

2. I'm pushing a commit to utilize this.

3. I wanted to link to your post in my commit message -- but I can't.
When I type this, your post isn't showing up in the Google Groups UI
for this thread --
https://groups.google.com/forum/#!topic/racket-users/ANgDaNplOBc .
John, is it stuck in moderation?

On Mon, May 18, 2015 at 9:46 AM, Sam Tobin-Hochstadt
<samth@...> wrote:
> I've now figured out what's going on here. The program in Greg's tests
> already has lexical context for the `{0 1 2}`, so it uses the `#%app` from
> that context, which gets the `racket` `#%app`. Normally, we'd just use
> s-exps instead of syntax objects as input to `eval`, since they don't have
> spurious lexical context, but that would lose the 'paren-shape property,
> which is crucial here. The solution, taken from the implementation of
> `racket/load`, is below:
>
> ```
> #lang racket
> (require syntax/strip-context)
> (current-namespace (make-base-namespace))
> (eval (namespace-syntax-introduce (strip-context #'(module m rackjure {0 1
> 2}))))
> ```
>
> Sam
>
> On Fri, May 15, 2015 at 3:47 PM Sam Tobin-Hochstadt <samth@...>
> wrote:
>>
>> It turns out that Greg's test was actually failing, but in a very strange
>> way. Having looked at this a bunch now, the issue seems to be that:
>>
>> ```
>> (check-exn exn:fail:syntax? (λ () (eval #'(module m rackjure  {0 1 2}))))
>> ```
>>
>> Doesn't work inside a module, but it does work at the repl or in
>> `racket/load`. However, no namespace trickery that I've found will make it
>> work in a module.
>>
>> However, changing the syntax error to something different, such as
>> `(module m rackjure ())`, behaves as I would expect. Does `eval` +
>> `quote-syntax` do something strange with {} properties on syntax objects?
>>
>> Sam
>>
>> On Fri, May 15, 2015 at 1:53 PM Greg Hendershott
>> <greghendershott@...> wrote:
>>>
>>> This is OT wrt deps and doc, but:
>>>
>>> I don't understand this reported test failure for rackjure, on both
>>> versions of Racket:
>>>
>>> test.rkt: raco test: non-empty stderr:
>>> #"--------------------\nFAILURE\nname:       check-exn\nlocation:
>>>
>>> (#<path:/home/racket/build-pkgs/user/.racket/6.1.1/pkgs/rackjure/rackjure/test.rkt>
>>> 68 2 2223 186)\nexpression: (check-exn exn:fail:syntax? (thunk (eval
>>> (syntax (module m rackjure (0 1 ...
>>>
>>> When I run the tests locally or on Travis CI, with `raco test -x .`,
>>> all pass including this.
>>>
>>> The message seems to be complaining that stderr is non-blank. But the
>>> test is check-exn. Is this an issue with the test environment not
>>> handling check-exn (a successful check-exn will write to stderr)?
>>>
>>> --
>>> 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+unsubscribe@...
>>> 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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.


Gmane