Re: [racket-users] IO in racket is painful

2016-03-22 Thread Mark Engelberg
On Tue, Mar 22, 2016 at 9:20 PM, Stephen Chang  wrote:

> :) I had started writing up a parsack example, and I was all set to
> admonish the OP for not creating a parser when you want a parser but
> then I saw it was for a programming contest where I guess this sort of
> scanf/regexp hackery is ok?
>

Generally the purpose of these sorts of programming contests is to solve as
many programming problems as you can in the span of, say, 3 hours.  So it
is all about writing code as fast as you can, nothing else counts.

One of the ground rules in the programming contests in my area is that you
cannot use any libraries that don't come with the language.  So if it comes
with the Racket distribution, that's fine.  But you can't pre-code up a
library of functions you would like to use, and you can't download and
install a package from Planet or Github.  Does Parsack come with Racket?
Is Parsack the quickest way (in terms of time to write the code) to dice
the file into a list of datasets?  Those are the questions that matter here.

-- 
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] IO in racket is painful

2016-03-22 Thread Stephen Chang
> It may be overkill for this use case, but I would probably use the
> parsack package, since I think its interface is pretty intuitive.

:) I had started writing up a parsack example, and I was all set to
admonish the OP for not creating a parser when you want a parser but
then I saw it was for a programming contest where I guess this sort of
scanf/regexp hackery is ok?

> Should it throw an exception, or should it
> return #f? I’m not sure there is great precedent set here, though
> throwing seems to be the Racket way in other places.

printf throws an exception when there's a type mismatch, eg (printf "~b" "1")

(thanks for the example Ben)


>
> --
> 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] IO in racket is painful

2016-03-22 Thread Alexis King
Honestly, judging from the responses in this thread, it would seem there
may be a hole in Racket’s toolbox. Nothing I’ve seen so far is
particularly stellar, especially since this is a problem that does not
seem like it should be hard.

It may be overkill for this use case, but I would probably use the
parsack package, since I think its interface is pretty intuitive.
However, it would be nice to have some sort of inverse to printf that
parses values given a template string. Racket has a very good set of
tools for formatting text, but it seems that doing the inverse is much
harder, which seems to be against Racket’s “batteries included”
philosophy.

Would anyone object to a scanf-like function in Racket itself? The
obvious point of difficulty is how to handle errors, given that parsing
can fail but printing cannot. Should it throw an exception, or should it
return #f? I’m not sure there is great precedent set here, though
throwing seems to be the Racket way in other places.

-- 
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] IO in racket is painful

2016-03-22 Thread Mark Engelberg
Hi, I have coached several teams on using Racket in programming contests.

In our local contests, the most common input format is to have one line per
dataset, and each dataset is typically several pieces of data separated by
spaces.  For this common input format, the 2htdp/batch-io teachpack is the
most convenient tool.

Here is a document I give to beginner students about how to use the
teachpack for the common case:
https://docs.google.com/document/d/1rJ9psWwB6qbYrYSKriQi15IpgN1qjQSxE4riAPHhQE8/edit?usp=sharing

But the advanced students sometimes run into files like the one you
describe, where the input has a somewhat different.  I teach the students
to build up a little toolkit of useful functions that they can write very
quickly once at the beginning of the contest -- functions that are useful
for "slicing and dicing" any file into a list of datasets.

Here are three such functions, that come in handy:

#lang racket
(require srfi/1)

; f->l stands for file->lines. We use the shorter name for less typing in a
contest, and to avoid conflict with built-in file->lines
; A hard lesson we learned is that in contests, the input files aren't
always "clean".  Sometimes there are stray spaces at the
; front or end of certain lines, or extra blank lines at the end of the
file.  This version of file->lines sanitizes the input.
(define (f->l file)
  (reverse (drop-while (curry equal? "") (reverse (map string-trim
(file->lines file))

; convert takes a string as an input and converts it to a number if it is a
number, otherwise, leaves it alone
(define (convert s)
  (if (string->number s)(string->number s) s))

; string-parse takes a string which is strings and/or numbers separated by
spaces, and returns a list of those elements
; So (string-parse "hello 1 2.0 world") returns (list "hello" 1 2.0 "world")
(define (string-parse s)
  (map convert (string-split s)))


Once these three functions are written (once at the beginning of the
contest), you can tackle a problem like yours as follows:

; Now we solve the contest problem

; We don't need the initial number of lines, because Racket is awesome.
; Let's take a moment to pity the students who use languages that force
them to read
; the data into a fixed-length array.

; Now, let's do it our way, and drop the number of lines with a simple call
to rest.

(define lines (rest (f->l "C:/temp/infile.dat")))

; We can put a line into a format consumable by string-parse by getting rid
of brackets and commas
; regexp-replace* is a very useful function to remember
; Make a habit out of using #px rather than #rx, as it supports some
additional features that can be useful,
; and it's easier to just always use #px instead of trying to recall which
features require which regexp type.

(define datasets (for*/list ([line lines]) (string-parse (regexp-replace*
#px"\\[|\\]|," line ""

; So that's all it took with our "library" of three functions in place.
; It just took two lines to massage the input file into a list of datasets.
; Now we implement the logic of processing a given dataset.
; If you know match, you might want to write it this way:

(define (process-dataset ds)
  (match ds
[`(,a ,b ,c)
 (printf "[~a, ~a, ~a]\n"
  (~a a #:width 2 #:align 'right #:pad-string "0
  b
  (~r c #:min-width 4 #:precision 1 #:pad-string "0"))]))

(for ([dataset datasets]) (process-dataset dataset))

; Alternatively, if you don't know match, you can write it as follows,
taking advantage of apply.

(define (process-dataset a b c)
  (printf "[~a, ~a, ~a]\n"
  (~a a #:width 2 #:align 'right #:pad-string "0")
  b
  (~r c #:min-width 4 #:precision 1 #:pad-string "0")))

(for ([dataset datasets]) (apply process-dataset dataset))


With most problems, it only takes a few lines like this to manipulate the
input file into a list of datasets, so my students have done well without a
scanf function.  Not that it wouldn't hurt to have it in specific
situations, but it's usually not necessary.

Good luck in the contest!

-- 
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] IO in racket is painful

2016-03-22 Thread WarGrey Gyoudmon Ju
On Wed, Mar 23, 2016 at 8:26 AM, WarGrey Gyoudmon Ju 
wrote:

> In Racket, (read) and (write) know all the builtin datatypes
> 
>  which
> are already structured more than a stream of bytes (like in C).
> Thus, you don't need scanf to tell Racket what is the type of the next
> token.
>
> That *is* painful in a situation like coding challenges since the input
> format is language independent (however actually it's the C style).
> Of course this kind of situation also has its own fixed format, you can
> define your own read tables
>  :
> 1. the "," is special in Racket, you need to drop off them first;  
> (with-input-from-string
> "[04 foo 03.5]" read) gives you '(4 foo 3.5) directly.
> 2. Symbols are internal Strings, you need (symbol->string) to covent them
> into normal Strings (Yes, sometimes, I think if there are string-like or
> bytes-like APIs that work on symbols directly).
>
>
Sorry, please forget the Read Table, it makes things more complex here.

-- 
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] IO in racket is painful

2016-03-22 Thread WarGrey Gyoudmon Ju
In Racket, (read) and (write) know all the builtin datatypes

which
are already structured more than a stream of bytes (like in C).
Thus, you don't need scanf to tell Racket what is the type of the next
token.

That *is* painful in a situation like coding challenges since the input
format is language independent (however actually it's the C style).
Of course this kind of situation also has its own fixed format, you can
define your own read tables
 :
1. the "," is special in Racket, you need to drop off them first;
(with-input-from-string
"[04 foo 03.5]" read) gives you '(4 foo 3.5) directly.
2. Symbols are internal Strings, you need (symbol->string) to covent them
into normal Strings (Yes, sometimes, I think if there are string-like or
bytes-like APIs that work on symbols directly).


On Wed, Mar 23, 2016 at 4:33 AM, rom cgb  wrote:

> Hi,
>
> I recently started using Racket and i couldn't find a good alternative to
> C's scanf/printf in the racket standard library. When doing programming
> challenges, you often need to comply to a specific input/ouput thus having
> something like scanf for string to values and printf for values to string
> is comfy.
>
> For example, let's say a challenge where you simply have to output the
> input but you need to translate the strings input into values and then
> those values back to strings.
>
> The given input(and excepted ouput) is
>
>   3
>   [04, foo, 03.5]
>   [05, bar, 04.6]
>   [06, fun, 05.7]
>
> In C, you would simply do
>
>   #include 
>
>   int main(void)
>   {
>   int n;
>
>   // Read number of rows
>   scanf("%d\n", &n);
>
>   // Output number of rows
>   printf("%d\n", n);
>
>   // Process rows
>   for (unsigned int i; i < n; ++i)
>   {
>   int a;
>   char b[20];
>   float c;
>
>   // Read row
>   scanf("[%d, %[^,], %f]\n", &a, b, &c);
>
>   // Output row
>   printf("[%02d, %s, %04.1f]\n", a, b, c);
>   }
>   }
>
> Now, for a solution in Racket, You first have to read the first line and
> convert it into a number.
>
>   (define rows (string->number (read-line)))
>
> Then, for all rows, read and split the string. The best that i have found
> to do that is using regular expressions.
>
>   (define split-row (regexp-match #rx"\\[(.+), (.+), (.+)\\]" (read-line)))
>
> Then you have to manually convert the substrings into values
>
>   (define a (string->number (second split-row)))
>   (define b (third split-row))
>   (define c (string->number (fourth split-row)))
>
> Then you have to manually convert the values back into strings
>
>   (printf "[~a, ~a, ~a]\n"
>   (~a a #:width 2 #:align 'right #:pad-string "0")
>   b
>   (~r c #:min-width 4 #:precision 1 #:pad-string "0")))
>
> This is way more tedious than with the classical input/output format,
> especially when you are doing coding challenges.
>
> Final Racket solution:
>
>   #lang racket
>
>   (define rows (string->number (read-line)))
>
>   (for ([in-range rows])
> (define split-row (regexp-match #rx"\\[(.+), (.+), (.+)\\]"
> (read-line)))
>
> (define a (string->number (second split-row)))
> (define b (third split-row))
> (define c (string->number (fourth split-row)))
>
> (printf "[~a, ~a, ~a]\n"
> (~a a #:width 2 #:align 'right #:pad-string "0")
> b
> (~r c #:min-width 4 #:precision 1 #:pad-string "0")))
>
>
> Having something like (not necessary the same specifiers as with printf)
>
>   (string-scan "[%d, %s, %f]" "[45, foo, 10.9]") -> '(45 "foo" 10.9)
>
> and a proper output formatter would be comfy.
>
> Are racket devs against such a thing in the standard library ?
> How you guys are actually doing IO in racket ?
>
> --
> 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] IO in racket is painful

2016-03-22 Thread Stephen Chang
A "read" variant that works with format strings would be a useful
addition I think.

Matthew, your solution is clever :) (but with symbols instead of strings).

Another alternative could be to use match:

#lang racket

(define (trim-brackets str)
  (string-trim str #rx"\\[|\\]|,"))

(define (pad n w)
  (~r n #:pad-string "0" #:min-width w))

(parameterize ([current-input-port (open-input-file "file.txt")])
  (for ([ln (in-lines)])
(match (string-split (trim-brackets ln) ", ")
  [(list (app string->number x)) (displayln x)]
  [(list (app string->number x) y (app string->number z))
   (printf "[~a, ~a, ~a]\n" (pad x 2) y (pad z 4))])))

or if you are willing to write a macro:

#lang racket

(define (trim-brackets str)
  (string-trim str #rx"\\[|\\]|,"))

(define (pad n w)
  (~r n #:pad-string "0" #:min-width w))

(define-match-expander numstr
  (syntax-rules () [(_ x) (app string->number x)]))

(parameterize ([current-input-port (open-input-file "file.txt")])
  (for ([ln (in-lines)])
(match (string-split (trim-brackets ln) ", ")
  [(list (numstr x)) (displayln x)]
  [(list (numstr x) y (numstr z))
   (printf "[~a, ~a, ~a]\n" (pad x 2) y (pad z 4))])))



(yes, I didnt close the port)

On Tue, Mar 22, 2016 at 6:34 PM, Matthew Butterick  wrote:
>> Then, for all rows, read and split the string. The best that i have found to 
>> do that is using regular expressions.
>>
>>   (define split-row (regexp-match #rx"\\[(.+), (.+), (.+)\\]" (read-line)))
>>
>> Then you have to manually convert the substrings into values
>>
>>   (define a (string->number (second split-row)))
>>   (define b (third split-row))
>>   (define c (string->number (fourth split-row)))
>
> This kind of destructuring & conversion from strings to values can sometimes 
> be more conveniently handled by converting your source data into something 
> that looks like Racket S-expressions (in this case, by removing the commas) 
> and then calling `read` to do the rest, e.g.
>
> #lang racket
> (with-input-from-file "data.txt"
>   (λ _ (for/list ([ln (in-lines)])
>  (read (open-input-string (string-replace ln "," ""))
>
> --
> 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] IO in racket is painful

2016-03-22 Thread Matthew Butterick
> Then, for all rows, read and split the string. The best that i have found to 
> do that is using regular expressions.
> 
>   (define split-row (regexp-match #rx"\\[(.+), (.+), (.+)\\]" (read-line)))
> 
> Then you have to manually convert the substrings into values
> 
>   (define a (string->number (second split-row)))
>   (define b (third split-row))
>   (define c (string->number (fourth split-row)))

This kind of destructuring & conversion from strings to values can sometimes be 
more conveniently handled by converting your source data into something that 
looks like Racket S-expressions (in this case, by removing the commas) and then 
calling `read` to do the rest, e.g.

#lang racket
(with-input-from-file "data.txt"
  (λ _ (for/list ([ln (in-lines)])
 (read (open-input-string (string-replace ln "," ""))

-- 
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] IO in racket is painful

2016-03-22 Thread rom cgb
Hi,

I recently started using Racket and i couldn't find a good alternative to C's 
scanf/printf in the racket standard library. When doing programming challenges, 
you often need to comply to a specific input/ouput thus having something like 
scanf for string to values and printf for values to string is comfy.

For example, let's say a challenge where you simply have to output the input 
but you need to translate the strings input into values and then those values 
back to strings.

The given input(and excepted ouput) is

  3
  [04, foo, 03.5]
  [05, bar, 04.6]
  [06, fun, 05.7]

In C, you would simply do

  #include 

  int main(void) 
  {
  int n;
  
  // Read number of rows
  scanf("%d\n", &n);
  
  // Output number of rows
  printf("%d\n", n);
  
  // Process rows
  for (unsigned int i; i < n; ++i)
  {
  int a;
  char b[20];
  float c;
  
  // Read row
  scanf("[%d, %[^,], %f]\n", &a, b, &c);
  
  // Output row
  printf("[%02d, %s, %04.1f]\n", a, b, c);
  }
  }

Now, for a solution in Racket, You first have to read the first line and 
convert it into a number.

  (define rows (string->number (read-line)))

Then, for all rows, read and split the string. The best that i have found to do 
that is using regular expressions.

  (define split-row (regexp-match #rx"\\[(.+), (.+), (.+)\\]" (read-line)))

Then you have to manually convert the substrings into values

  (define a (string->number (second split-row)))
  (define b (third split-row))
  (define c (string->number (fourth split-row)))

Then you have to manually convert the values back into strings

  (printf "[~a, ~a, ~a]\n"
  (~a a #:width 2 #:align 'right #:pad-string "0")
  b
  (~r c #:min-width 4 #:precision 1 #:pad-string "0")))

This is way more tedious than with the classical input/output format, 
especially when you are doing coding challenges. 

Final Racket solution:

  #lang racket

  (define rows (string->number (read-line)))

  (for ([in-range rows])
(define split-row (regexp-match #rx"\\[(.+), (.+), (.+)\\]" (read-line)))
  
(define a (string->number (second split-row)))
(define b (third split-row))
(define c (string->number (fourth split-row)))

(printf "[~a, ~a, ~a]\n"
(~a a #:width 2 #:align 'right #:pad-string "0")
b
(~r c #:min-width 4 #:precision 1 #:pad-string "0")))


Having something like (not necessary the same specifiers as with printf)

  (string-scan "[%d, %s, %f]" "[45, foo, 10.9]") -> '(45 "foo" 10.9)

and a proper output formatter would be comfy. 

Are racket devs against such a thing in the standard library ?
How you guys are actually doing IO in racket ?

-- 
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] submodule order dependency

2016-03-22 Thread Jos Koot
Hi Matthias,
Thanks,
I did see that part of the docs, but overlooked the word "preceding".
Apologies for my noise.
On second thought, I agree with the choice of order,
because comparing with 'define' (in a non-lazy language) we can't allow:
(define b a)
(define a 'whatever)
So indeed, the choice of order as has been made seems more natural.
Thanks again,
Jos
 

-Original Message-
From: Matthias Felleisen [mailto:matth...@ccs.neu.edu] 
Sent: martes, 22 de marzo de 2016 17:13
To: Jos Koot
Cc: 'Racket Users'
Subject: Re: [racket-users] submodule order dependency


On Mar 22, 2016, at 8:47 AM, Jos Koot  wrote:

> The following works in the definitions window of DrRacket:
>  
> #lang racket
> (module a racket (display 'dog))
> (module b racket (require (submod ".." a)))
> (require 'b)
>  
> Display 'dog' when run.
>  
> But reversing the order of the submodules a and b does not work:
>  
> #lang racket
> (module b racket (require (submod ".." a)))
> (module a racket (display 'dog))
> (require 'b)
>  
> Gives already before running (background expansion enabled):
> require: unknown module module name: #
>  
> May be this order dependency is documented, but I could not find it.
> If it is not documented, should'nt this order dependency be included in
the docs?


Reference, evaluation model, 1.1.10.5:

 "A submodule declared with module can import any preceding submodule
declared with module."



> It would be nice to allow a submodule to require a submodule yet to
follow,
> just like the body of a procedure definition may refer to a procedure yet
to be defined.
> I can imagin that it would be impossible, or at least difficult, to remove
the order dependency.


Remember that modules cannot refer to each other in a mutually recursive
manner. 
What might want to argue for is that the order is reversed. I can see the
advantage
of that and I definitely need this for plain defines. For submodules I have
wanted this
at first but after years of programming with them, I have come to the
conclusion that
what we have is fine. Either order would have worked, the one we have is a
bit more
natural than the other way round. 

-- Matthais

-- 
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] submodule order dependency

2016-03-22 Thread Matthias Felleisen

On Mar 22, 2016, at 8:47 AM, Jos Koot  wrote:

> The following works in the definitions window of DrRacket:
>  
> #lang racket
> (module a racket (display 'dog))
> (module b racket (require (submod ".." a)))
> (require 'b)
>  
> Display 'dog' when run.
>  
> But reversing the order of the submodules a and b does not work:
>  
> #lang racket
> (module b racket (require (submod ".." a)))
> (module a racket (display 'dog))
> (require 'b)
>  
> Gives already before running (background expansion enabled):
> require: unknown module module name: # 'anonymous-module a)>
>  
> May be this order dependency is documented, but I could not find it.
> If it is not documented, should'nt this order dependency be included in the 
> docs?


Reference, evaluation model, 1.1.10.5:

 "A submodule declared with module can import any preceding submodule declared 
with module."



> It would be nice to allow a submodule to require a submodule yet to follow,
> just like the body of a procedure definition may refer to a procedure yet to 
> be defined.
> I can imagin that it would be impossible, or at least difficult, to remove 
> the order dependency.


Remember that modules cannot refer to each other in a mutually recursive 
manner. 
What might want to argue for is that the order is reversed. I can see the 
advantage
of that and I definitely need this for plain defines. For submodules I have 
wanted this
at first but after years of programming with them, I have come to the 
conclusion that
what we have is fine. Either order would have worked, the one we have is a bit 
more
natural than the other way round. 

-- Matthais

-- 
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] [TFPIE 2016] 2nd call for papers

2016-03-22 Thread p.achten
  Trends in Functional Programming in Education (TFPIE 2016)
   2nd Call for papers
 https://wiki.science.ru.nl/tfpie/TFPIE2016

The 5th International Workshop on Trends in Functional Programming in
Education, TFPIE 2016, will be held on June 7, 2016 at the University
of Maryland College Park in the USA. It is co-located with the
Symposium on Trends in Functional Programming (TFP 2016) which takes
place from June 8 - 10.

*** Goal ***

The goal of TFPIE is to gather researchers, teachers and professionals
that use, or are interested in the use of, functional programming in
education. TFPIE aims to be a venue where novel ideas,
classroom-tested ideas and work-in-progress on the use of functional
programming in education are discussed. The one-day workshop will
foster a spirit of open discussion by having a review process for
publication after the workshop. The program chair of TFPIE 2016 will
screen submissions to ensure that all presentations are within scope
and are of interest to participants. Potential presenters are invited
to submit an extended abstract (4-6 pages) or a draft paper (up to 16
pages) in EPTCS style. The authors of accepted presentations will have
their preprints and their slides made available on the workshop's
website/wiki. Visitors to the TFPIE 2016 website/wiki will be able to
add comments. This includes presenters who may respond to comments and
questions as well as provide pointers to improvements and follow-up
work. After the workshop, presenters will be invited to submit (a
revised version of) their article for review. The PC will select the
best articles for publication in the journal Electronic Proceedings in
Theoretical Computer Science (EPTCS). Articles rejected for
presentation and extended abstracts will not be formally reviewed by
the PC. TFPIE workshops have previously been held in St Andrews,
Scotland (2012), Provo Utah, USA (2013), Soesterberg, The Netherlands
(2014), and Sophia-Antipolis, France (2015).

*** Program Committee ***

  Stephen Changat Northeastern Universityin Massachusetts, USA
 Marc Feeley   at Université de Montréal in Québec, Canada
 Patricia Johann   at Appalachian State University   in North Carolina, USA
  Jay McCarthy at University of Massachusetts Lowell in Massachusetts, USA 
(Chair)
Prabhakar Ragdeat University of Waterloo in Ontario, Canada
Brent Yorgey   at Hendrix Collegein Arkansas, USA

*** Submission Guidelines ***

TFPIE 2016 welcomes submissions describing techniques used in the
classroom, tools used in and/or developed for the classroom and any
creative use of functional programming (FP) to aid education in or
outside Computer Science.  Topics of interest include, but are not
limited to:

- FP and beginning CS students 
- FP and Computational Thinking 
- FP and Artificial Intelligence 
- FP in Robotics 
- FP and Music 
- Advanced FP for undergraduates 
- Tools supporting learning FP 
- FP in graduate education 
- Engaging students in research using FP 
- FP in Programming Languages 
- FP in the high school curriculum 
- FP as a stepping stone to other CS topics 
- FP and Philosophy 

*** Best Lectures ***

In addition to papers, we request "best lecture" presentations. What
is your best lecture topic in an FP related course? Do you have a fun
way to present FP concepts to novices or perhaps an especially
interesting presentation of a difficult topic? In either case, please
consider sharing it. Best lecture topics will be selected for
presentation based on a short abstract describing the lecture and its
interest to TFPIE attendees.

*** Submission ***

Papers and abstracts can be submitted via EasyChair at the following
link:

https://easychair.org/conferences/?conf=tfpie2016

It is expected at at least one author for each submitted paper will
attend the workshop.

*** Registration & Local Information ***

Please see the TFP site for registration and local information:

http://tfp2016.org/

*** Important Dates ***

April 27, 2016: Submission deadline for draft TFPIE papers and abstracts
  May  3, 2016: Notification of acceptance for presentation
  May 13, 2016: Registration for TFP/TFPIE closes
 June  7, 2016: Presentations in Maryland, USA
 July  7, 2016: Full papers for EPTCS proceedings due.
September  1, 2016: Notification of acceptance for proceedings
September 22, 2016: Camera ready copy due for EPTCS

Submission of an abstract implies no obligation to submit a full version;
abstracts with no corresponding full versions by the full paper deadline will be
considered as withdrawn.

-- 
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] submodule order dependency

2016-03-22 Thread Jos Koot
The following works in the definitions window of DrRacket:
 
#lang racket
(module a racket (display 'dog))
(module b racket (require (submod ".." a)))
(require 'b)
 
Display 'dog' when run.
 
But reversing the order of the submodules a and b does not work:
 
#lang racket
(module b racket (require (submod ".." a)))
(module a racket (display 'dog))
(require 'b)
 
Gives already before running (background expansion enabled):
require: unknown module module name: #
 
May be this order dependency is documented, but I could not find it.
If it is not documented, should'nt this order dependency be included in the
docs?
 
It would be nice to allow a submodule to require a submodule yet to follow,
just like the body of a procedure definition may refer to a procedure yet to
be defined.
I can imagin that it would be impossible, or at least difficult, to remove
the order dependency.
 
Lifting submodules to top-modules in separate files resolves the problem, of
course,
but sometimes I like to unify small modules in one single file.
 
I like submodules!
Thanks, Jos


-- 
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] Can a macro have an affect above/outside its scope?

2016-03-22 Thread Hendrik Boom
On Mon, Mar 21, 2016 at 08:37:57AM -0700, Brian Adkins wrote:
> On Monday, March 21, 2016 at 11:19:18 AM UTC-4, Neil Van Dyke wrote:
> > I propose that it's time for `#lang racket/base` to have a `define/provide`.
> > 
> > (Out of all the possible combinations of definition forms and other 
> > things we might often want to do with the defined identifier(s) at the 
> > same time, the pair of `define` and `provide` together is overwhelmingly 
> > the most common in my code.  It might even be the normal case for me 
> > that `define` is usually paired with a `provide`.  Years ago, I moved to 
> > putting `provide` right before the `define`, which was a win in a few 
> > ways, but I always feel dumb typing "(provide foo)\n(define (foo ".  I 
> > haven't wanted to make a special package dependency or new `#lang` for 
> > `define/provide`; I think `define/provide` belongs in `racket/base` now.)
> > 
> > Neil V.
> 
> As I mentioned in my original post, I wasn't suggesting we emulate the Elixir 
> behavior - I was really just curious about macro limitations :) 
> 
> `define/provide` seems a bit long to me. I also like the distinction 
between defining  a function with define and indicating export 
behavior with provide.

Separating the two has the advantage that you can collect thhe provides 
together and  see them all in one place.  For some styles of usage, 
this may be a disadvantage.

-- hendrik

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