Re: [racket-users] making a language that can return the body of a function

2017-05-27 Thread Vityou
On Thursday, May 25, 2017 at 5:50:29 PM UTC-6, Matthias Felleisen wrote:
> The client module can refer to all imported #% forms. If you don’t export it 
> from the language module, it’s not there. [Well, mostly] Implicitly the 
> client module already refers to #% forms already. 
> 
> 
> 
> > On May 25, 2017, at 7:09 PM, Vityou  wrote:
> > 
> > On Wednesday, May 24, 2017 at 2:05:23 PM UTC-6, Matthias Felleisen wrote:
> >> Don’t eval. This is a bit crude but it now your lam-s keep track of your 
> >> environment, too. 
> >> 
> >> #lang racket ;; new-lang.rkt 
> >> 
> >> (provide
> >> #%app
> >> #%datum
> >> #%top-interaction
> >> (rename-out
> >>  (new-lambda lambda)
> >>  (new-mb #%module-begin)))
> >> 
> >> (require racket/stxparam)
> >> 
> >> (define-syntax (new-lambda stx)
> >>  (syntax-case stx ()
> >>[(_ (x ...) e ...)
> >> #`(letrec ([L (lam '(x ...)
> >>'(e ...)
> >>(*env)
> >>(lambda (x ...)
> >>  (syntax-parameterize ([*env
> >> (lambda (stx)
> >>   (syntax-case stx ()
> >> [(_) #`(append '(x 
> >> ...) (lam-environment L))]))])
> >>e)
> >>  ...))])
> >> L)]))
> >> (define-syntax-parameter *env
> >>  (syntax-rules () [(_) '()]))
> >> (struct lam (parameters bodies environment closure) #:property 
> >> prop:procedure 3)
> >> 
> >> (define-syntax (new-mb stx)
> >>  (syntax-case stx ()
> >>[(_ e ...)
> >> #'(#%module-begin
> >>(let ([v e])
> >>  (if (lam? v)
> >>  `(let (,@(map (lambda (x) `(,x --some-value--)) 
> >> (lam-environment v)))
> >> (lambda ,(lam-parameters v) ,@(lam-bodies v)))
> >>  v))
> >>...)]))
> >> 
> >> 
> >> 
> >>> On May 24, 2017, at 3:41 PM, Vityou  wrote:
> >>> 
> >>> On Wednesday, May 24, 2017 at 12:05:19 PM UTC-6, Vityou wrote:
>  On Tuesday, May 23, 2017 at 8:21:59 PM UTC-6, Matthias Felleisen wrote:
> > Try to start with this: 
> > 
> > 
> > 
> > 
> > 
> > #lang racket ;; new-lang.rkt 
> > 
> > 
> > (provide
> > #%app
> > #%datum
> > #%top-interaction
> > (rename-out
> >  (new-lambda lambda)
> >  (new-mb #%module-begin)))
> > 
> > 
> > (define-syntax (new-lambda stx)
> >  (syntax-case stx ()
> >[(_ (x ...) e ...)
> > #'(lam '(x ...) '(e ...) (lambda (x ...) e ...))]))
> > 
> > 
> > (struct lam (parameters bodies closure) #:property prop:procedure 2)
> > 
> > 
> > (define-syntax (new-mb stx)
> >  (syntax-case stx ()
> >[(_ e ...)
> > #'(#%module-begin
> >(let ([v e])
> >  (if (lam? v)
> >  `(lambda ,(lam-parameters v) ,@(lam-bodies v))
> >  v))
> >...)]))
> > 
> > 
> > 
> > 
> > ;; - - - 
> > 
> > 
> > 
> > #lang s-exp "new-lang.rkt” ;; new-lang-client.rkt 
> > 
> > 
> > ((lambda (x) x)
> > (lambda (y) y))
> > 
> > 
> > 
> > 
> > 
> > 
> > On May 23, 2017, at 10:03 PM, Vityou  wrote:
> > 
> > 
> > On Tuesday, May 23, 2017 at 7:17:18 PM UTC-6, Matthias Felleisen wrote:
> > Why do you interpret S-expressions instead of re-mapping lambda and 
> > #%app? 
> > 
> > 
> > 
> > 
> > 
> > On May 23, 2017, at 9:14 PM, Vityou  wrote:
> > 
> > I might be able to do something like this, but what I'm looking for is 
> > something that will be able to show the variables available to it in 
> > adition to its source.  I'll probable have to do something like what 
> > you did with the struct accept add a field with its available variables 
> > and modify #%app to add to its known variables.
> > 
> > -- 
> > 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.
> > 
> > I dont know what I could map lambda to that would let it retain and 
> > print its known variables besides a list.
>  
>  That's probably good enough for most cases, but I tried to add a struct 
>  field to record the lexical content, I can't fin a way to mimic 
>  evaluating the body of the function in the struct, this is the closest I 
>  got:
>  
>  (define-syntax (new-app stx)
>  (syntax-case stx ()
>    [(_ f x)
> #'(let ([result (#%app f x)])
> (if (lam? result)
> 

[racket-users] Re: Question: 2D data (Arrays?) in Universe Teachpack

2017-05-27 Thread Luis Sanjuán
On Saturday, May 27, 2017 at 4:00:09 PM UTC+2, A Mauer-Oats wrote:
> Does anyone use array data with the Universe teachpack?
> 
> I thought it would be interesting to work with 2D data in an "advanced 
> introductory" class. At least to the extent of being able to model classic 
> board games like Battleship and Checkers.
> 
> This time we used math/array, but arrays are basically mutable in nature and 
> that doesn't seem to work very well with way the universe is set up. My 
> students ended up writing a lot of code like (begin (array-set! board ...) 
> board) without really understanding it. Some copied arrays far too much and 
> performance suffered, but I think that is a secondary concern.
> 
> Is there a 2d data structure with functional updates that would be more 
> suitable to this situation?
> 
> I am aware of the possibility of abandoning big-bang for gui-lib, but I think 
> that has its own minuses - it felt like I would need to teach too much about 
> classes for it to work.
> 
> Any suggestions or tales of relevant experience would be welcome. (Even 
> "don't do that!" notes from people with more experience. :)
> 
> Andrew Mauer-Oats
> CPS/Whitney Young Magnet High School

You could use a list of values of some sort suitable to the game at hand to 
represent the board, and rely on operations on lists in a purely functional 
manner. For boards of relatively small size and without lots of dynamics 
performance shouldn't be an issue.

In the MOOC 'How to Code' (known before as 'Systematic Program Design') you can 
find examples of this kind of representation. Take a look, for instance, at 
this sudoku solver:

https://www.youtube.com/watch?v=cDaEykxaR6M

Though this solver doesn't include a "world" program, I think it would be easy 
to add that functionality.

-- 
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] Re: Question: 2D data (Arrays?) in Universe Teachpack

2017-05-27 Thread Luis Sanjuán
On Saturday, May 27, 2017 at 4:00:09 PM UTC+2, A Mauer-Oats wrote:
> Does anyone use array data with the Universe teachpack?
> 
> I thought it would be interesting to work with 2D data in an "advanced 
> introductory" class. At least to the extent of being able to model classic 
> board games like Battleship and Checkers.
> 
> This time we used math/array, but arrays are basically mutable in nature and 
> that doesn't seem to work very well with way the universe is set up. My 
> students ended up writing a lot of code like (begin (array-set! board ...) 
> board) without really understanding it. Some copied arrays far too much and 
> performance suffered, but I think that is a secondary concern.
> 
> Is there a 2d data structure with functional updates that would be more 
> suitable to this situation?
> 
> I am aware of the possibility of abandoning big-bang for gui-lib, but I think 
> that has its own minuses - it felt like I would need to teach too much about 
> classes for it to work.
> 
> Any suggestions or tales of relevant experience would be welcome. (Even 
> "don't do that!" notes from people with more experience. :)
> 
> Andrew Mauer-Oats
> CPS/Whitney Young Magnet High School

You could use a list of values of some sort suitable to the game at hand to 
represent the board, and rely on operations on lists in a purely functional 
manner. For boards of relatively small size and without lots of dynamics 
performance shouldn't be an issue.

In the MOOC 'How to Code' (known before as 'Systematic Program Design') you can 
find examples of this kind of representation. Take a look, for instance, at 
this sudoku solver:

https://www.youtube.com/watch?v=cDaEykxaR6M

Though this solver doesn't include a "world" program, I think it would be easy 
to add that functionality.

You may find interesting to 

-- 
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] CFP Deadline Extended: Scheme and Functional Programming Workshop 2017

2017-05-27 Thread Faré
Scheme and Functional Programming Workshop 2017
Oxford, United Kingdom
Co-located with ICFP 2017
http://scheme2017.namin.org/


Important Dates

Submission deadline (extended)
June 16th, 2017 (AoE)
Author notification (extended)
July 18th, 2017 (AoE)
Camera-ready deadline (extended)
August 18th, 2017 (AoE)
Workshop
September 3rd, 2017


Important Links

  • Submission Page https://easychair.org/conferences/?conf=scheme17
  • (TBD) Registration Page
  • Twitter feed: @schemeworkshop https://twitter.com/schemeworkshop


Introduction

The Scheme and Functional Programming Workshop is a yearly meeting of
programming language practitioners who share a sense of aesthetic
as embodied by the Algorithmic Language Scheme:
universality through minimalism, adequation through self-improvement,
flexibility through rigorous design, and
composability through orthogonal features.


Call For Papers

We invite high-quality papers about novel research results,
lessons learned from practical experience in industrial or educational
setting, and even new insights on old ideas.
We welcome and encourage submissions that apply
to any language that can be considered Scheme:
from strict subsets of RnRS to other "Scheme" implementations, to Racket,
to Lisp dialects including Clojure, Emacs Lisp, Common Lisp,
to functional languages with continuations and/or macros
(or extended to have them) such as
Dylan, ECMAcript, Hop, Lua, Scala, Rust, etc.
The elegance of the paper and the relevance of its topic to the interests
of Schemers will matter more than the surface syntax of the examples used.
Topics of interest include (but are not limited to):

  • Interaction:
program-development environments, debugging, testing, refactoring
  • Implementation:
interpreters, compilers, tools, garbage collectors, benchmarks
  • Extension:
macros, hygiene, domain-specific languages, reflection, and
how such extension affects interaction.
  • Expression:
control, modularity, ad hoc and parametric polymorphism, types,
aspects, ownership models, concurrency, distribution, parallelism,
non-determinism, probabilism, and other programming paradigms
  • Integration:
build tools, deployment, interoperation with other languages and systems
  • Formal semantics:
Theory, analyses and transformations, partial evaluation
  • Human Factors:
Past, present and future history,
evolution and sociology of the language Scheme,
its standard and its dialects.
  • Education:
approaches, experiences, curricula
  • Applications:
industrial uses of Scheme
  • Scheme pearls:
elegant, instructive uses of Scheme


Submission Information

Please submit full papers and experience reports to our Submission Page.
https://easychair.org/conferences/?conf=scheme17

[NEW IN 2017!] Paper submissions must use the format acmart and its
sub-format acmlarge. They must be
in PDF, printable in black and white on US Letter size. Microsoft Word
and LaTeX templates for this
format are available at:

http://www.sigplan.org/Resources/Author/

This change is in line with ACM conferences (such as ICFP with which
we are colocated) switching from
their traditional two-column formats (e.g. sigplanconf) to the above.
While a two-column format with
small fonts is much more practical when reading printed papers, the
single-column format with large
fonts is nicer to view on a computer screen, as most `papers' are read
these days.

To encourage authors to submit their best work, we offer three tracks:

  • Full Papers, with a limit to 24 pages. Each accepted paper will be
presented by its authors in a
40 minute slot including Q
  • Experience Reports, with a limit to 12 pages. Each accepted report
will be presented by its
authors in a 20 minute slot including Q
  • Lightning talks, with a limit to 192 words. Each accepted
lightning talk will be presented by its
authors in a 5 minute slot including Q

The size limits above exclude references and any optional appendices.
There are no size limits on
appendices, but the papers should stand without the need to read them,
and reviewers are not required
to read them.

Authors are encouraged to publish any code associated to their papers
under an open source license, so
that reviewers may try the code and verify the claims.

Proceedings will be printed as a Technical Report at Indiana University.

Publication of a paper at this workshop is not intended to replace
conference or journal publication,
and does not preclude re-publication of a more complete or finished
version of the paper at some later
conference or in a journal.


Program Committee

  • Barış Aktemur, Ozyegin University, Turkey
  • Nada Amin (general chair), University of Cambridge, UK
  • Kenichi Asai, Ochanomizu University, Japan
  • Eli Barzilay, Microsoft, USA
  • Felix S Klock II, Mozilla Research, USA
  • Jay McCarthy, University of Massachusetts Lowell, USA
  • Christian Queinnec, Professor emeritus at Sorbonne 

[racket-users] Question: 2D data (Arrays?) in Universe Teachpack

2017-05-27 Thread A Mauer-Oats
Does anyone use array data with the Universe teachpack?

I thought it would be interesting to work with 2D data in an "advanced 
introductory" class. At least to the extent of being able to model classic 
board games like Battleship and Checkers.

This time we used math/array, but arrays are basically mutable in nature and 
that doesn't seem to work very well with way the universe is set up. My 
students ended up writing a lot of code like (begin (array-set! board ...) 
board) without really understanding it. Some copied arrays far too much and 
performance suffered, but I think that is a secondary concern.

Is there a 2d data structure with functional updates that would be more 
suitable to this situation?

I am aware of the possibility of abandoning big-bang for gui-lib, but I think 
that has its own minuses - it felt like I would need to teach too much about 
classes for it to work.

Any suggestions or tales of relevant experience would be welcome. (Even "don't 
do that!" notes from people with more experience. :)

Andrew Mauer-Oats
CPS/Whitney Young Magnet High School



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