In the forgotten theory /fold/ should reduce its arguments like in the
following examples:
(define (apply-or well-formed-list)
(foldl {lambda (a b) (or a b)}
#f
well-formed-list))
(define (apply-and well-formed-list)
(foldl {lambda (a b) (and a b)}
#t
We're preparing a v6.2.1 release, which will go out before August 10.
The v6.2.1 build will be a small set of patches to v6.2, i.e., not
derived from the current development branch.
The patches are for the HtDP teaching languages. The main patch for
v6.2.1 is to add an option to restore the old
On Jul 29, 2015, at 7:50 AM, Klaus Ostermann wrote:
Thanks, Matthew and Matthias. The service on this mailing list is incredible!
I know it is not cbn because it is local, but a better name didn't come to my
mind and it is what I need to solve my problem.
It's not about locality, the
Everyone, please feel free to re-broadcast this message to mailing lists whose
members may not necessarily be on this list but who might wish to know about
RacketCon anyways.
-- Matthias
On Jul 29, 2015, at 10:46 AM, Vincent St-Amour wrote:
The full program of (fifth RacketCon) is
在 2015年7月29日星期三 UTC+8下午10:11:07,Vincent St-Amour写道:
On Wed, 29 Jul 2015 05:51:33 -0500,
Yanpeng Li wrote:
I don't know if a new Racket user can ask some `fool questions'
here. I am learning sicp using Dr. Racket, it is interesting(the book
and the Racket language). I encounter some
.. the conversion for neil's xexpr .. at this point the two converters can
be abstracted by passing in two lambdas, is-at-list predicate, and
extract-at-list. Neil can you comment on what other differences I might
expect to find?
(define (neil-xexpr-tok-tree an-xexpr)
(define (is-at-list
Alexander, you will notice I pulled a couple lambdas to the top, and added
a test routine at the bottom take those out ... then the code you sent
isn't shorter. I am also expecting to have to add more code to the
intermediate points. I like seeing those named. I think it is easy to
read. ...
Thomas Lynch wrote on 07/29/2015 11:22 PM:
The most obvious difference between racket's xexpr and yours is the
'@' as the head of the attributes list. Any idea where else I will
see divergences?
You might not be able to implement a tool that works correctly with all
conforming SXML, until
Great! thanks Neil!
On Thu, Jul 30, 2015 at 11:02 AM, Neil Van Dyke n...@neilvandyke.org
wrote:
Thomas Lynch wrote on 07/29/2015 10:25 PM:
Neil can you comment on what other differences I might expect to find?
Are the below 2 messages to the list helpful?
* Historical background on SXML
On Thu, Jul 30, 2015 at 11:09 AM, Thomas Lynch
thomas.ly...@reasoningtechnology.com wrote:
Great! thanks Neil!
Ah spoke too soon! Those links just point back into this very same thread!
The most obvious difference between racket's xexpr and yours is the '@' as
the head of the attributes
I wrote primitive conversion routines to bring the xexpr or Neil's xexpr
into ... oh gosh, my parser token format, which by coincidence is very
close. Just playing with this now .. In my target format token children
are always other tokens. All values given as attributes in value tokens.
I use
I'd like to have a macro let-cbn which does this:
(let-cbn ((x1 e1) ...) body)
is transformed to
(let ((x1 (thunk e1)) ...) newbody)
where newbody is the result of replacing every occurence of x1... by (x1)... .
What is the best way to do that in Racket?
--
You received this message because
At Wed, 29 Jul 2015 06:28:48 -0700 (PDT), Klaus Ostermann wrote:
I'd like to have a macro let-cbn which does this:
(let-cbn ((x1 e1) ...) body)
is transformed to
(let ((x1 (thunk e1)) ...) newbody)
where newbody is the result of replacing every occurence of x1... by (x1)... .
What
(I was 2/3 there when I noticed Matthew's response.)
Klaus, fwiw this is NOT cbn. A cbn let will run the thunks only when they show
up in strict positions. Not every identifier shows up in strict positions.
On Jul 29, 2015, at 7:37 AM, Matthew Flatt wrote:
At Wed, 29 Jul 2015 06:28:48
Dear racket maintainers,
Maybe, I found a bug.
(foldr (lambda (x y) (list x y)) '() '(a1 a2 a3 a4 a5))
'(a1 (a2 (a3 (a4 (a5 ())
(foldl (lambda (x y) (list x y)) '() '(a1 a2 a3 a4 a5))
'(a5 (a4 (a3 (a2 (a1 ())
Thanks, I hope racket language is more popular.
Taro
--
You received this
Would it be easier using match?
(define (xexpr-tok-tree an-xexpr)
(match as-xexpr
['()
'()]
[(not (cons _ _))
(tok-make ...)]
[(list tag)
(list tag)]
[(list-rest tag (? is-at-list at-list) r2)
]
))
On Jul 29, 2015, at 7:56 AM, Thomas Lynch
Oh, right. I tried to declare the macros in the wrong part of the signature,
and then I got an error message that this wasn't allowed.
Sorry for not RTFM.
--
You received this message because you are subscribed to the Google Groups
Racket Users group.
To unsubscribe from this group and stop
For any f, acc, and lst, (foldl f acc lst), from left-to-right,
applies to f to each element of lst and the current accumulated value.
The initial accumulator is acc so the second intermediate accumulated
value is (f (first lst) acc). Replacing f, acc, and lst with your
arguments, the second
You are right.
; proc, init and lst are from the racket reference.
(define (my-foldl proc init lst)
(define (rec res rest1)
(if (null? rest1)
res
(rec (proc res (first rest1)) (rest rest1
(rec init lst))
(my-foldl (lambda (x y) (list x y)) '() '(a1 a2 a3 a4 a5))
What's the output you expected?
Does this post help you?
http://stackoverflow.com/questions/8778492/why-is-foldl-defined-in-a-strange-way-in-racket
On Wed, Jul 29, 2015 at 9:45 AM, sagyo12341...@gmail.com wrote:
Dear racket maintainers,
Maybe, I found a bug.
(foldr (lambda (x y) (list x
Sorry Stephen,
I expected,
(foldl (lambda (x y) (list x y)) () '(list a1 a2 a3 a4 a5))
(list (list (list (list (list a1 a2) a3) a4) a5).
it may be a problem in non-commutative operations.
Taro
--
You received this message because you are subscribed to the Google Groups
Racket Users group.
On Wed, 29 Jul 2015 05:51:33 -0500,
Yanpeng Li wrote:
I don't know if a new Racket user can ask some `fool questions'
here. I am learning sicp using Dr. Racket, it is interesting(the book
and the Racket language). I encounter some concepts, such as module,
library, collection, package which
At Wed, 29 Jul 2015 07:00:54 -0700 (PDT), Klaus Ostermann wrote:
Units are not allowed to export macros, presumably because the unit wiring
takes place after the macro expansion.
I have a unit and would like to define a few macros based on the interface of
that unit.
Right now I
Something like this:
#lang racket
(require (for-syntax syntax/parse racket/syntax))
(define-syntax (let-cbn stx)
(syntax-parse stx
[(_let-cbn ([x:id e:expr] ...) body)
;; For each identifier x we need a new identifier bound to (λ () e)
(define/with-syntax (x* ...)
Units are not allowed to export macros, presumably because the unit wiring
takes place after the macro expansion.
I have a unit and would like to define a few macros based on the interface of
that unit.
Right now I copypaste my macros into every file where I wire the unit, such as
in
...
http://stackoverflow.com/questions/8778492/why-is-foldl-defined-in-a-strange-way-in-racket
Oh, I see.
Racket's holdl is non-regular type for calculation efficiency.
Thank you, Stephen.
--
You received this message because you are subscribed to the Google Groups
Racket Users group.
To
You can put the macros in the signature.
http://docs.racket-lang.org/reference/creatingunits.html?q=signature#%28form._%28%28lib._racket%2Funit..rkt%29._define-signature%29%29
On Wed, Jul 29, 2015 at 8:00 AM, Klaus Ostermann klaus...@gmail.com wrote:
Units are not allowed to export macros,
27 matches
Mail list logo