[racket-users] Fwd: [ELS] [CfPart] 10th European Lisp Symposium, Apr 3-4 2017, Brussels

2017-03-05 Thread Daniel Brunner
Just a short x-post from the ELS mailing list:

Datum: Fri, 03 Mar 2017 15:25:26 +0100
Von: Didier Verna 
An: ELS Conference 


ELS'17 - 10th European Lisp Symposium

   VUB - Vrije Universiteit Brussel
   Belgium

   April 3-4, 2017

In co-location with  2017

 Sponsors: Brunner Software GmbH, Franz Inc., LispWorks Ltd. and EPITA

   http://www.european-lisp-symposium.org/


Recent news:

- Invited speakers announced (see below)
- Registration open. Don't miss the March 13 deadline for the full
   conference early bird discount!


The purpose of the European Lisp Symposium is to provide a forum for
the discussion and dissemination of all aspects of design,
implementation and application of any of the Lisp and Lisp-inspired
dialects, including Common Lisp, Scheme, Emacs Lisp, AutoLisp, ISLISP,
Dylan, Clojure, ACL2, ECMAScript, Racket, SKILL, Hop and so on. We
encourage everyone interested in Lisp to participate.


Keynote speakers:

- Hans Hübner -- Identity in a World of Values
- Bohdan B. Khomtchouk -- How the Strengths of Lisp Facilitate Building
  Complex and Flexible Bioinformatics Applications

Important dates:
 -13 Mar 2017 Early registration deadline
 - 03-04 Apr 2017 Symposium
 - 05-06 Apr 2017  main tack

Programme chair:
  Alberto Riva, University of Florida, USA

Programme committee:
  Marco Antoniotti, Università Milano Bicocca, Italy
  Marc Battyani, FractalConcept
  Theo D'Hondt, Vrije Universiteit Brussel, Belgium
  Marc Feeley, Université de Montreal, Canada
  Erick Gallesio, Université de Nice Sophia-Antipolis, France
  Stelian Ionescu, Google
  Rainer Joswig, Independent Consultant, Germany
  António Menezes Leitão, Technical University of Lisbon, Portugal
  Nick Levine, RavenPack
  Henry Lieberman, MIT, USA
  Mark Tarver, Shen Programming Group
  Jay McCarthy, University of Massachusetts Lowell, USA
  Christian Queinnec, Université Pierre et Marie Curie, France
  François-René Rideau, Bridgewater Associates, USA
  Nikodemus Siivola, ZenRobotics Ltd
  Alessio Stalla, Università degli Studi di Genova, Italy
  Chris Stacy, CS Consulting


Search Keywords:

#els2017, ELS 2017, ELS '17, European Lisp Symposium 2017,
European Lisp Symposium '17, 10th ELS, 10th European Lisp Symposium,
European Lisp Conference 2017, European Lisp Conference '17


And another note from Didier:

Hi all,

just a quick note to stress on the fact that the early bird discount for
the whole  conference is on March 13, so rush to the
registration page if you want to take the opportunity to attend the
whole 4 days.

Also, we're aware of the fact that due to the co-location, the student
fee is high this year (even for the workshop only registration), and in
order to compensate for that, we're planning to partially refund the
costs for every student attending the 2 days of ELS, to the extent
possible. So do not let the fee frighten you, young padawans

See you there!

-- 
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] How to type annotate for bindings in complex syntax forms

2017-03-05 Thread kay
For a complex syntax form like `command-line`, I have difficulty correctly 
annotate the bindings it defines.

More specifically, in the below code, for variable `msg`, even the document[1] 
says the `#:args` binds as list of **strings**, but the error indicates that it 
somehow is declared as `Listof Any`.

Similarly, for variable `ch` bound in line 11, I believe it should always be 
`String`, but it somehow is declared to be `Any`.

What should I do with this type of error, if I want my varaibles to be more 
precisely typed than just `Any`?


[1]: 
https://docs.racket-lang.org/reference/Command-Line_Parsing.html?q=command-line#%28form._%28%28lib._racket%2Fcmdline..rkt%29._command-line%29%29

```
 1  #lang typed/racket
 2  
 3  (define *channel* (make-parameter "#general"))
 4  (define *message* : (Parameterof (Listof String)) (make-parameter '()))
 5  
 6  
 7  (define (parse-cmdline)
 8  (command-line
 9   #:program "q"
10   #:once-each
11   [("-c" "--channel") ch "slack channel to post (default: use .qrc 
setting or default)" (*channel* ch)]
12   #:args msg
13   (*message* msg)))
14  
15  
16  #|
17  tr.rkt:11:91: Type Checker: Wrong argument to parameter - expected 
String and got Any in: (*channel* ch)
18  tr.rkt:13:5: Type Checker: Wrong argument to parameter - expected 
(Listof String) and got (Listof Any) in: (*message* msg)
19  |#
```

-- 
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] Typed Racket: Polymorphic function `dynamic-wind' could not be applied to arguments

2017-03-05 Thread kay
Thanks for pointing it out. I also figured later that the multiple return 
values was the problem here.

Is this a TR type system limitation that polymorphic functions don't like 
multiple return values? Looks like it might be worth mentioning somewhere in 
the documentation or better in the error message.


On Sunday, March 5, 2017 at 1:54:54 AM UTC-8, WarGrey Gyoudmon Ju wrote:
> The problem is not the `AnyValues` since it accepts all types, but you cannot 
> instantiate a polymorphic type to return multiple values, so you have to 
> return (cons ... ...) in dynamic-wind then extract that pair as two return 
> values of the function.   
> 
> 
> On Sun, Mar 5, 2017 at 3:23 PM, kay  wrote:
> I have the following simple module that I'm converting to typed/racket. I got 
> a type check error that I don't know how to fix. More specifically, it's 
> related to the polymorphic function dynamic-wind's arguments. I read from 
> document [1] that type inference doesn't work for a lambda that is an 
> argument to a polymorphic function. But since here the three arguments are 
> all thunks (without input argument), I don't know how to properly annotate 
> them.
> 
> 
> 
> Note that I tried to even annotate the first argument:
> 
> 
> 
>   (λ () (ann #f AnyValues))
> 
> 
> 
> And the type checker complained:
> 
> 
> 
>   Argument 1:
> 
>     Expected: (-> AnyValues)
> 
>     Given:    (-> AnyValues)
> 
> 
> 
> which is really weird.
> 
> 
> 
> 
> 
> [1]: 
> https://docs.racket-lang.org/ts-guide/more.html#%28part._when-annotations~3f%29
> 
> 
> 
> 
> 
> 
> 
> Here's the module:
> 
> --
> 
> 
> 
> #lang typed/racket
> 
> 
> 
> ;;(require racket/string racket/list racket/match racket/system racket/port 
> racket/function)
> 
> (provide execute)
> 
> 
> 
> (: execute (-> String * (Values String String)))
> 
> (define (execute . args)
> 
>   (define cmdln (string-join args))
> 
>   (displayln (format "running ~a" cmdln))
> 
>   (match (process cmdln)
> 
>     [(list out in pid err f)
> 
> 
> 
>      (define cust (make-custodian))
> 
>      (dynamic-wind
> 
>       (λ () (ann #f AnyValues))
> 
> 
> 
>       (thunk
> 
>        (parameterize ([current-custodian cust])
> 
>          (define buf_stdout (open-output-string))
> 
>          (define buf_stderr (open-output-string))
> 
> 
> 
>          (thread (λ () (copy-port out buf_stdout (current-output-port
> 
>          (thread (λ () (copy-port err buf_stderr (current-error-port
> 
> 
> 
>          (displayln (f 'status))
> 
>          (f 'wait)
> 
> 
> 
>          (values (get-output-string buf_stdout) (get-output-string 
> buf_stderr
> 
> 
> 
>       (thunk (custodian-shutdown-all cust)))
> 
>      ]))
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Here's the type error:
> 
> --
> 
> 
> 
> . executor.rkt:14:5: Type Checker: Polymorphic function `dynamic-wind' could 
> not be applied to arguments:
> 
> Argument 1:
> 
>   Expected: (-> AnyValues)
> 
>   Given:    (-> AnyValues)
> 
> Argument 2:
> 
>   Expected: (-> a)
> 
>   Given:    (-> (values (String : (Top | Bot)) (String : (Top | Bot
> 
> Argument 3:
> 
>   Expected: (-> AnyValues)
> 
>   Given:    (-> Void)
> 
> 
> 
> Result type:     a
> 
> Expected result: (values String String)
> 
>  in: (dynamic-wind (λ () (ann #f AnyValues)) (thunk (parameterize 
> ((current-custodian cust)) (define buf_stdout (open-output-string)) (define 
> buf_stderr (open-output-string)) (thread (λ () (copy-port out buf_stdout 
> (current-output-port (thread (λ () (copy-port err buf_stderr 
> (current-error-port (displayln (f (quote status))) (f (quote wait)) 
> (values (get-output-string buf_stdout) (get-output-string buf_stderr 
> (thunk (custodian-shutdown-all cust)))
> 
> 
> 
> --
> 
> 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...@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] scribble and optional latex arguments

2017-03-05 Thread Robby Findler
Oh sorry. What you have done is what I would do.

Robby

On Sun, Mar 5, 2017 at 9:58 AM David Van Horn  wrote:

> That's what I'm doing.
>
> On Sun, Mar 5, 2017 at 10:48 AM, Robby Findler
>  wrote:
> > Define two different commands at the latex level?
> >
> > Robby
> >
> > On Sun, Mar 5, 2017 at 9:39 AM David Van Horn 
> wrote:
> >>
> >> I'm trying to make a wrapper for a latex command that has an optional
> >> argument.  My current solution is to do the following to wrap a
> >> command called `\foo`:
> >>
> >> (define (foo #:opt [o #f] x)
> >>   (if o
> >>   (make-multiarg-element (make-style "SfooOpt" '(multicommand))
> >>  (list (decode-string o)
> >>(decode-string x)))
> >>   (make-element (make-style "foo" '(command))
> >> (decode-string x
> >>
> >> And then I have to insert a definition in the latex:
> >>
> >> \newcommand{\SfooOpt}[2]{\foo[#1]{#2}}
> >>
> >> Is there a better way to accomplish this?
> >>
> >> David
> >>
> >> --
> >> 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.
>

-- 
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] scribble and optional latex arguments

2017-03-05 Thread David Van Horn
That's what I'm doing.

On Sun, Mar 5, 2017 at 10:48 AM, Robby Findler
 wrote:
> Define two different commands at the latex level?
>
> Robby
>
> On Sun, Mar 5, 2017 at 9:39 AM David Van Horn  wrote:
>>
>> I'm trying to make a wrapper for a latex command that has an optional
>> argument.  My current solution is to do the following to wrap a
>> command called `\foo`:
>>
>> (define (foo #:opt [o #f] x)
>>   (if o
>>   (make-multiarg-element (make-style "SfooOpt" '(multicommand))
>>  (list (decode-string o)
>>(decode-string x)))
>>   (make-element (make-style "foo" '(command))
>> (decode-string x
>>
>> And then I have to insert a definition in the latex:
>>
>> \newcommand{\SfooOpt}[2]{\foo[#1]{#2}}
>>
>> Is there a better way to accomplish this?
>>
>> David
>>
>> --
>> 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] Are types first class values in typed/racket

2017-03-05 Thread Robert Kuzelj
Hey Jack,

are there any users already for turnstile?
I couldn't find anybody except the package itself.

ciao robertj

Am Mittwoch, 15. Februar 2017 20:13:43 UTC+1 schrieb Jack Firth:
> That's not possible in Typed Racket, no. Type checking is after macro 
> expansion so type information doesn't even exist when your macro would expand.
> 
> However, hope is not lost. There is a new approach to typechecking with 
> macros outlined in the Types as Macros paper by Stephen Chang and Alex 
> Knauth, and reified in the `turnstile` Racket package. This approach 
> interleaves typechecking and macro expansion, making types essentially macros 
> with extra compile time metadata that alter the flow of macro expansion. In 
> this case, types are actual *things* that exist at macro expansion time, so 
> you could make a macro that interacted with types and used type information 
> to decide how to expand.
> 
> On Tuesday, February 14, 2017 at 5:32:30 AM UTC-8, Robert Kuzelj wrote:
> > given a type definition in typed/racket like
> > 
> > (define-type BinaryTree (U Number (Pair BinaryTree BinaryTree)))
> > 
> > would it be possible to feed that type into a macro (aka not runtime) so 
> > that
> > 
> > (define-transformed-type MyBinaryTree BinaryTree)
> > 
> > and would that macro be able to access the constituent elements and their 
> > types of given type?

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] scribble and optional latex arguments

2017-03-05 Thread Robby Findler
Define two different commands at the latex level?

Robby

On Sun, Mar 5, 2017 at 9:39 AM David Van Horn  wrote:

> I'm trying to make a wrapper for a latex command that has an optional
> argument.  My current solution is to do the following to wrap a
> command called `\foo`:
>
> (define (foo #:opt [o #f] x)
>   (if o
>   (make-multiarg-element (make-style "SfooOpt" '(multicommand))
>  (list (decode-string o)
>(decode-string x)))
>   (make-element (make-style "foo" '(command))
> (decode-string x
>
> And then I have to insert a definition in the latex:
>
> \newcommand{\SfooOpt}[2]{\foo[#1]{#2}}
>
> Is there a better way to accomplish this?
>
> David
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] scribble and optional latex arguments

2017-03-05 Thread David Van Horn
I'm trying to make a wrapper for a latex command that has an optional
argument.  My current solution is to do the following to wrap a
command called `\foo`:

(define (foo #:opt [o #f] x)
  (if o
  (make-multiarg-element (make-style "SfooOpt" '(multicommand))
 (list (decode-string o)
   (decode-string x)))
  (make-element (make-style "foo" '(command))
(decode-string x

And then I have to insert a definition in the latex:

\newcommand{\SfooOpt}[2]{\foo[#1]{#2}}

Is there a better way to accomplish this?

David

-- 
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] scribble section as link

2017-03-05 Thread Matthew Flatt
I think we'll need to add something to make this work.

Maybe the simplest addition would be a style property on a part that
means "when rendering my label as a reference, don't make it a
hyperlink". Then, any hyperlinks in the label content would be
preserved in a reference to the section, effectively redirecting the
reference.

At Sat, 4 Mar 2017 15:42:54 -0500, Stephen Chang wrote:
> Ah, I understand now. I remember trying to do this as well but I'm not
> sure it's possible.
> 
> I just tried manually playing around a bit with scribble structs but
> couldnt figure it out. Best I could do was redirecting a seclink, or
> changing the toc contents of an element.
> 
> But there doesnt seem to be any way to change the toc contents of a
> part (someone correct me if I'm wrong).
> 
> Here's my code in case it's helpful.
> 
> #lang scribble/manual
> @(require scribble/core
>   scribble/html-properties
>   net/url)
> @title{asdf}
> @section[#:style (make-style #f (list (make-part-link-redirect
> (string->url "http://google.com; #:tag "a"]{A}
> @section{@seclink["a"]{link to sec A (goes to google)}}
> 
> @(make-toc-target2-element #f "stuff" '(element "stf")
> @hyperlink["http://google.com"]{link to "stuff" (try to redirect to
> google but doesnt work)"})
> 
> On Sat, Mar 4, 2017 at 2:38 PM, David Van Horn  wrote:
> > The latex analogy of what I'd like is something like:
> >
> > \addcontentsline{toc}{section}{\href{google.com}{The Google}}
> >
> > On Sat, Mar 4, 2017 at 2:30 PM, David Van Horn  wrote:
> >> Thanks, this does make the section heading a link, but in the table of
> >> contents or in the left hand navigation bar, the link is to the
> >> (empty) section, not the URL.  What I'd like is for the navigation
> >> links to go to the URL.
> >>
> >> David
> >>
> >>
> >> On Sat, Mar 4, 2017 at 2:06 PM, Stephen Chang  wrote:
> >>> Does `hyperlink` do what you want?
> >>>
> >>> eg
> >>>
> >>> @section{@hyperlink["http://google.com"]{The Google}}
> >>>
> >>> On Sat, Mar 4, 2017 at 1:49 PM, David Van Horn  
> >>> wrote:
>  I'm using scribble to make a web page and I'd like a section-like
>  heading that is just a link to an external URL, but I don't see how to
>  do this.  Is it possible?
> 
>  David
> 
>  --
>  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.
> 
> -- 
> 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] Typed Racket: Polymorphic function `dynamic-wind' could not be applied to arguments

2017-03-05 Thread WarGrey Gyoudmon Ju
The problem is not the `AnyValues` since it accepts all types, but you
cannot instantiate a polymorphic type to return multiple values, so you
have to return (cons ... ...) in dynamic-wind then extract that pair as two
return values of the function.

On Sun, Mar 5, 2017 at 3:23 PM, kay  wrote:

> I have the following simple module that I'm converting to typed/racket. I
> got a type check error that I don't know how to fix. More specifically,
> it's related to the polymorphic function dynamic-wind's arguments. I read
> from document [1] that type inference doesn't work for a lambda that is an
> argument to a polymorphic function. But since here the three arguments are
> all thunks (without input argument), I don't know how to properly annotate
> them.
>
> Note that I tried to even annotate the first argument:
>
>   (λ () (ann #f AnyValues))
>
> And the type checker complained:
>
>   Argument 1:
> Expected: (-> AnyValues)
> Given:(-> AnyValues)
>
> which is really weird.
>
>
> [1]: https://docs.racket-lang.org/ts-guide/more.html#%28part._
> when-annotations~3f%29
>
>
>
> Here's the module:
> --
>
> #lang typed/racket
>
> ;;(require racket/string racket/list racket/match racket/system
> racket/port racket/function)
> (provide execute)
>
> (: execute (-> String * (Values String String)))
> (define (execute . args)
>   (define cmdln (string-join args))
>   (displayln (format "running ~a" cmdln))
>   (match (process cmdln)
> [(list out in pid err f)
>
>  (define cust (make-custodian))
>  (dynamic-wind
>   (λ () (ann #f AnyValues))
>
>   (thunk
>(parameterize ([current-custodian cust])
>  (define buf_stdout (open-output-string))
>  (define buf_stderr (open-output-string))
>
>  (thread (λ () (copy-port out buf_stdout (current-output-port
>  (thread (λ () (copy-port err buf_stderr (current-error-port
>
>  (displayln (f 'status))
>  (f 'wait)
>
>  (values (get-output-string buf_stdout) (get-output-string
> buf_stderr
>
>   (thunk (custodian-shutdown-all cust)))
>  ]))
>
>
>
>
> Here's the type error:
> --
>
> . executor.rkt:14:5: Type Checker: Polymorphic function `dynamic-wind'
> could not be applied to arguments:
> Argument 1:
>   Expected: (-> AnyValues)
>   Given:(-> AnyValues)
> Argument 2:
>   Expected: (-> a)
>   Given:(-> (values (String : (Top | Bot)) (String : (Top | Bot
> Argument 3:
>   Expected: (-> AnyValues)
>   Given:(-> Void)
>
> Result type: a
> Expected result: (values String String)
>  in: (dynamic-wind (λ () (ann #f AnyValues)) (thunk (parameterize
> ((current-custodian cust)) (define buf_stdout (open-output-string)) (define
> buf_stderr (open-output-string)) (thread (λ () (copy-port out buf_stdout
> (current-output-port (thread (λ () (copy-port err buf_stderr
> (current-error-port (displayln (f (quote status))) (f (quote wait))
> (values (get-output-string buf_stdout) (get-output-string buf_stderr
> (thunk (custodian-shutdown-all cust)))
>
> --
> 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.