Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Dylan > can dylan do th...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 223 of 285
Post > Topic >>

can dylan do this?

by dillogimp@[EMAIL PROTECTED] Apr 15, 2007 at 04:43 PM

hi

I'm stuck in the middle of my program with scheme.
I'm looking at other language that might be easier for solving my
problem

Here is my problem: (I'm using scheme's amb)
(define (solve-gen tt)
    (define hd 2)
    (let ((n (number-between 1 tt))
          (v (number-between 1 tt))
          (l (number-between 1 tt))
         )
      (assert       (= (+ n l v) tt) )
      (let ((g (number-between 1 l))
            (c (number-between 0 1))
           )
         (assert       (= (+ g c) l)  )
         (list n v l g c)
;; I need to do
;; (make-list n (number-between 0 hd))
      )
    )
)

;; (make-list n (number-between 0 hd))
This code won't work and but requires macro that can dynamically
generate code like:
(list (number-between 0 hd) (number-between 0 hd) (number-between 0
hd) ... )
;; need to generate (number-between 0 hd) n times at run time

can dylan easily do this?
Thanks.
 




 1 Posts in Topic:
can dylan do this?
dillogimp@[EMAIL PROTECTE  2007-04-15 16:43:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 16:45:54 CDT 2008.