While working on the Rhipmunk FFI, I ran into a definition called
"NOT_GRABABLE_MASK", which as far as I can tell, is defined as:
#define GRABABLE_MASK (1<<31)
#define NOT_GRABABLE_MASK (~GRABABLE_MASK)
The problem with this, is that when I do the same operations:
(define GRABABLE_MASK (int->uint
Thx , and that should be what I want : )
2012/6/9 Jay McCarthy
> There is no way to mark some strings as "safe". However, you can
> include CDATA in an xexpr and the xml library assumes that cdata have
> the cdata wrapper--- but you can just lie.
>
> Here is the documentation for CDATA:
>
There is no way to mark some strings as "safe". However, you can
include CDATA in an xexpr and the xml library assumes that cdata have
the cdata wrapper--- but you can just lie.
Here is the documentation for CDATA:
http://docs.racket-lang.org/xml/index.html?q=cdata#(def._((lib._xml/main..rkt)
Hi all,
I use xexpr to write template, but i find "xexpr/response" will escape
html entities like "<" to < . xexpr->string do this thing also, so how
to mark some strings are "safe" in expr?
Best wishes
--
aisk
Racket Users list:
http://lists.racket-lang.org/use
It is kind of like you want a dependent contract: once the first
function is called then it's range contract is forever fixed to some
specific number of values and after that the domain of P2 is also
fixed to some specific number of values.
You can drop down to the low-level and write such a contr
Robby Findler wrote at 06/08/2012 09:31 PM:
To get a little more context: what happens if P1 returns different
numbers of values each time it is called?
That would be a programming error by the user of this library, and I'm
fine with them getting a non-contracts runtime error.
I think my
To get a little more context: what happens if P1 returns different
numbers of values each time it is called? How do you know which ones
match up to which calls of P2?
Also, perhaps not the best thing (pending the answer above), you can
write a predicate contract that gets the procedure-arity resul
Is there a way with the core procedure contractor combinators, to say
"at least 2 arguments, possibly more"?
So far, I have gotten "->*" to give me "2 arguments and arbitrarily
more", which is not what I want.
(Rationale for why I want "at least 2 arguments, possibly more"... I
have a librar
Two work arounds:
1. Launch DrRacket from a terminal with
2. Run
==
This fragment from racket/collects/redex/private/dot.rkt succinctly
describes the problem and a hard-coded
solution to the root problem:
;; these paths are explicitly checked (when find-executable-path
;
2012/6/8 Sam Tobin-Hochstadt :
> What's happening is that `#%top` behaves differently at the REPL than
> in a module. This enables you to write:
>
> -> (define (even? x) (or (zero? x) (odd? (sub1 x
> -> (define (odd? x) (or (= x 1) (even? (sub1 x
>
> without getting an error when entering
Ah silly me, another senior moment :-)
On Jun 8, 2012, at 12:06 PM, Robby Findler wrote:
> Yes, of course it is and that first branch executes and thus the error
> in the second branch (now a runtime error, thanks to the repl), is not
> signaled.
>
> Robby
>
> On Fri, Jun 8, 2012 at 11:01 AM
Yet, the REPL allows this interaction:
> (let ([x 1])
(cond
[(= x 1)
(define u 2)
(+ u 1)]
[else u]))
3
> (define (f x) (cond
[(= x 1)
(define u 2)
(+ u 1)]
[else u]))
> (f 1)
3
> (f 0)
reference to undefined identifier: u
=== context ===
/home/ianj/plt/pltgit/collec
Yes, of course it is and that first branch executes and thus the error
in the second branch (now a runtime error, thanks to the repl), is not
signaled.
Robby
On Fri, Jun 8, 2012 at 11:01 AM, Matthias Felleisen
wrote:
>
> With all due respect, I disagree. Like Jens, I consider the (define u ..)
With all due respect, I disagree. Like Jens, I consider the (define u ..)
nested and scoped inside the first cond branch.
On Jun 8, 2012, at 11:56 AM, Sam Tobin-Hochstadt wrote:
> On Fri, Jun 8, 2012 at 11:42 AM, Jens Axel Søgaard
> wrote:
>>
>> When
>>
>> (let ([x 1])
>> (cond
>>[(=
On Fri, Jun 8, 2012 at 11:42 AM, Jens Axel Søgaard
wrote:
>
> When
>
> (let ([x 1])
> (cond
> [(= x 1)
> (define u 2)
> (+ u 1)]
> [else u]))
>
> is pasted into the interaction window, I get 3 !
>
> I was expecting an error.
This is the same behavior as:
-> (if #f x 1)
1
What's
I have found an interesting program:
#lang racket
(let ([x 1])
(cond
[(= x 1)
(define u 2)
(+ u 1)]
[else u]))
When run gives a very reasonable error message:
expand: unbound identifier in module in: u
When
(let ([x 1])
(cond
[(= x 1)
(define u 2)
(+ u 1)]
[els
Since the inner-most lambda block references the list ("l"), aren't the
nested lambda's the cleanest implementation? Otherwise, you would have to
use currying, which looks like it would add complexity (based on a random
article i just found, here
http://www.engr.uconn.edu/~jeffm/Papers/curry.html)
On Jun 8, 2012, at 10:25 AM, Ashok Bakthavathsalam wrote:
>
> (define (permute l)
>
>
> (if (null? l)
>
>
> '(())
>
>
> (apply append (map (lambda (p)
>
>
>(map (lambda (n)
>
>
> (insert p n (car l)))
>
>
>
Below, I have enclosed the code from Rosetta for generating Permutations.
Can someone show me how to replace nested lambdas with defines?
Thanks,
(define (insert l n e)
(if (= 0 n)
(cons e l)
(cons (car l)
(insert (cdr l) (- n 1) e
(define (seq start end)
(if
19 matches
Mail list logo