Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Scheme Programming Language

how do solve for more then one amb?


hi

ok I've managed to get amb working. But how do I have more then one
amb and initialize-amb-fail ?

Thanks.

(define (solve-partition-n n)
    (let ((x (number-between 1 n))
          (y (number-between 1 n))
          (z (number-between 1 n))
         )
      (assert
       (= (+ x y z) n)
      )
      (list x y z)
    )
)
(initialize-amb-fail)
(solve-partition-n 5)
(amb)
(amb)
(amb)
(amb)
(amb)

dillog@gmail.com skrev:

> ok I've managed to get amb working. But how do I have more then one
> amb and initialize-amb-fail ?

I think you need to reimplemnt amb, if you need two at the "same time".

But why do you need two? Can you show us, what you have in mind?

--
Jens Axel Sgaard

Jens Axel Sgaard writes:
> dillog@gmail.com skrev:
>> ok I've managed to get amb working. But how do I have more then one
>> amb and initialize-amb-fail ?
> I think you need to reimplemnt amb, if you need two at the "same time".
> But why do you need two? Can you show us, what you have in mind?

Judging from his example, I guess he wants a way to get further
solutions for the problem.

--
Emlio C. Lopes                            Ich leb und wei nit wie lang,
Munich, Germany                            ich stirb und wei nit wann,
                                           ich fahr und wei nit wohin,
                 (Martinus von Biberach)   mich wundert, dass ich frhlich bin!

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc