Hi,
I was wondering if someone could help me understand the problem with the
following code?
(struct: obj ([a : Integer] [b : Symbol]))
(: f1? (obj Symbol -> Boolean))
(define (f1? o x)
(and (= 0 (obj-a o))
(eq? x (obj-b o
(: f2? (obj Symbol -> Boolean))
(define (f2? o x)
(and (zer
Another option is you could turn change your fib function to be 'mk-fib' that
returns a new instance of the fib function each time it's called:
(define (mk-fib)
(let ([n0 -1] [n1 1])
(lambda ()
(let ([next (+ n0 n1)])
(set! n0 n1)
(set! n1 next))
n1)))
- Erik
O
t; (if (>= fib-val n) '() (cons fib-val (fib-less-than-n n))
>
> How would I use your idea in this case?
>
> thanks!
> -joe
>
> On Mon, Feb 13, 2012 at 9:18 PM, Erik Silkensen
> wrote:
> Another option is you could turn change your fib function
specially (let loop ([vs '()]).
> What exactly is going on there?
>
> Thanks again,
> -joe
>
> On Mon, Feb 13, 2012 at 9:51 PM, Erik Silkensen
> wrote:
> Instead of calling fib-less-than-n recursively, you could add a loop inside,
> for example something like,
>
&
I wonder if define-match-expander might be what you're looking for?
http://docs.racket-lang.org/reference/match.html?q=define-match-expander#(form._((lib._racket/match..rkt)._define-match-expander))
Erik
On Mar 9, 2012, at 8:22 PM, rob cook wrote:
> Thanks for the tips - I am new to using matc
Hi Cristian,
Check out SRFI 13: http://docs.racket-lang.org/srfi-std/srfi-13.html
You can load it in Racket with (require srfi/13)
-- Erik
On Apr 11, 2012, at 10:57 PM, Cristian Esquivias wrote:
> I just started getting my hands dirty with Racket on some utility
> scripts. Overall, it's been a
can I use a mix of the
> built-in Racket string functions and srfi/13 functions, or will I have
> to migrate completely to the srfi/13 functions?
>
> - Cristian
>
> On Wed, Apr 11, 2012 at 10:06 PM, Erik Silkensen
> wrote:
>> Hi Cristian,
>>
>> Check out SR
Try just the Racket language by putting "#lang racket" at the top of your file.
On May 20, 2012, at 9:09 PM, Olwe Melwasul wrote:
> I've been working through The Little Schemer using Petite Chez Scheme and
> Emacs, but now I'd like to try DrRacket. I have a large file where I've been
> putting
The arc page is out of date -- it will run with the MzScheme included in the
current Racket download
(https://sites.google.com/site/arclanguagewiki/getting-started/install-arc)
On May 21, 2012, at 12:37 AM, Marijn wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On 14-05-12 08:03,
You could use match or match-let, e.g.,
(match-let ([(list year month day) (regexp-split #rx"/" "2012/06/06")])
…)
http://docs.racket-lang.org/reference/match.html
On Jun 11, 2012, at 8:24 PM, Jordan Schatz wrote:
>
> Is there a way to unwrap or explode a list? I don't see it in the docs, bu
Hi,
The code
#lang typed/racket
(define-type IntList (Rec List (Pair Integer (U List Null
(define-predicate int-list? IntList)
> (int-list? '(1 2 3))
gives the runtime error:
recursive-contract: expected a flat contract or a value that can be coerced
into one, got #
Is there a way to
Hi,
I'm wondering if there's any way to have a macro like
(define-syntax (m stx)
(syntax-case stx ()
[(m expr)
#'(let ([t expr])
;;
t)]))
that binds expr to t, does some things, and then somehow returns t -- but with
whatever name would have been inferred for e
Cool, thanks!
Erik
On Sep 6, 2012, at 12:08 AM, Eric Dobson wrote:
> How about:
>
> (define-syntax (m stx)
> (syntax-case stx ()
>[(m expr)
> #'(let ([t (values expr)])
> ;;
> t)]))
>
> Which seems to work for me.
>
Could someone explain how this example works?
$ racket
Welcome to Racket v6.1.1.
-> (require racket/sandbox)
-> (define racket-eval (make-evaluator 'racket))
-> (define a (racket-eval '(set 1 2 3)))
-> a
(set 1 2 3)
-> (set? a)
#f
-> (define racket-eval-again (make-evaluator 'racket))
-> (equal? a
Hi Racket users,
I'm wondering how to control the documentation category for user-defined
packages? For example, I've created a YAML package and would like it to show
up under "Parsing Libraries". I tried setting
(define scribblings '(("yaml/yaml.scrbl" () (parsing-library
in info.rkt, b
ol:
>
> (define scribblings '(("yaml/yaml.scrbl" () ("Parsing Libraries"
>
> The only valid symbols are the category names listed here [1].
>
> [1] http://docs.racket-lang.org/raco/setup-info.html?q=info
> <http://docs.racket-lang.org/raco/set
fo file, I get no links in the docs. But
> changing the collection to "yaml" generates documentation under the "Parsing
> Libraries" category.
>
> Can you use "yaml" instead of 'multi ?
>
> On Tue, Feb 9, 2016 at 3:33 AM, Erik Silkensen &
, at 3:07 AM, Benjamin Greenman > <mailto:benjaminlgreen...@gmail.com>> wrote:
>>
>> Hm. I'm not sure what's going on.
>>
>> If I make a package with your info file, I get no links in the docs. But
>> changing the collection to "yaml&
18 matches
Mail list logo