On Aug 17, 2014, at 2:29 PM, Carl Eastlund wrote:
> Comparing lexical context is a very involved process. Remember that every
> syntax object potentially carries context for an unbounded number of symbol
> names at an unbounded number of phases, since context information can be
> transferred
Comparing lexical context is a very involved process. Remember that every
syntax object potentially carries context for an unbounded number of symbol
names at an unbounded number of phases, since context information can be
transferred freely. Comparing all of them for equivalence would be quite
e
But those only work on identifiers, right?
But would something like this work?
(define (lexical-context=? s1 s2)
(bound-identifier=? (datum->syntax s1 ‘x) (datum->syntax s2 ‘x)))
Or would that miss something?
On Aug 17, 2014, at 1:31 PM, Roman Klochkov wrote:
> Maybe something of
>
> h
Maybe something of
http://docs.racket-lang.org/reference/stxcmp.html
?
Sat, 16 Aug 2014 23:32:10 -0400 от "Alexander D. Knauth" :
>Is there any way to check whether two syntax objects have the same lexical
>information, syntax-e (recursively), source location, properties, and whatever
>else
Hi Mark
'in-value' -- which is new to me - thanks Sam! -- is cleaner than using a
'let' (or 'define') outside the for/list, hence preferable.
Re-factoring my earlier example:
(define (mersenne-primes-3 n)
(for*/list ([i n]
[c (in-value (sub1 (expt 2 i)))]
#:when (pr
Thank Daniel and Sam!
Below is a little conclusion:
1. When it comes to "for*/list", "in-values" can be used to introduce
bindings just like "let".
2. "filter-map" can be a great alternative when "for/list" is considered.
On 08/17/2014 07:59 PM, Sam Tobin-Hochstadt wrote:
This is what 'in-v
This is what 'in-value' is for.
Sam
On Aug 17, 2014 5:07 AM, "Mark Wallace" wrote:
> Consider the following pseudocode:
>
> (for/list ([i ...]
>#:when )
> )
>
> Can I bind that expression E and reference in the body of "for/list"?
>
> If expression E takes lots of time to finish, w
Hi Mark
Two ideas:
1. add a bit of state with for/list to save a reference to the expensive
computation
2. filter-map keeps the reference more localised
E.g.
#lang racket
(require math/number-theory)
(define (mersenne-primes n)
(let ([c 'dummy])
(for/list ([i n]
#
Consider the following pseudocode:
(for/list ([i ...]
#:when )
)
Can I bind that expression E and reference in the body of "for/list"?
If expression E takes lots of time to finish, we would not want to
compute it again :).
I understand that there are workarounds like first colle
9 matches
Mail list logo