Mirko
4/1/2015 8:27:00 PM
On Wednesday, April 1, 2015 at 4:00:31 PM UTC-4, WJ wrote:
> Mirko Vukovic wrote:
>
> > Hello,
> >
> > I am using SCREAMER and could not figure out how to deal with real's
> >
> > Consider the following code in the SCREAMER-USER package
> > (defun f<->c (&key f c)
> > "Converter between degree Fahrenheit and Celsius
> >
> > Only one key should be specified.
> >
> > If both keys are specified, the results are undefined"
> > (let ((vf (a-realv 'f))
> > (vc (a-realv 'c)))
> > (when f (assert! (=v vf f)))
> > (when c (assert! (=v vc c)))
> > (assert! (=v vf (+v (*v 9/5 vc) 32)))
> > (list vf vc)))
> >
> > I get:
> > SCREAMER-USER> (f<->c :f 32)
> > ([F real 32:32] [C real 0:0])
> >
> > I would like to extract the numerical values.
>
> 1. That function contains the formula for converting Celsius
> to Fahrenheit; it doesn't contain the formula for converting
> Fahrenheit to Celsius.
Sorry, I was not clear. The screamer code is declarative, not
procedural. Thus the =v, /v, *v, +v.
The *same* code (in screamer gives the following results
SCREAMER-USER> (f<->c :c 100)
([F real 212:212] [C real 100:100])
SCREAMER-USER> (f<->c :f 212)
([F real 212:212] [C real 100:100])
SCREAMER-USER>