Sean Cooper (secooper@VT.EDU)
Sun, 23 Apr 2000 14:34:20 -0400
Message-ID: <4.2.2.20000423142933.00a55440@mail.vt.edu> Date: Sun, 23 Apr 2000 14:34:20 -0400 From: Sean Cooper <secooper@VT.EDU> Subject: Re: [CS3304_1381] using is and =
It would be easier to make it a fact... if you receive a number as the head
of the list (represented by another list) then return that number...
factor([ [Num|Den] | _Tail], [Num|Den]).
So passing it [[3 , 1] , plus , minus ....] will return [3,1] at the second
variable position...
-Sean
At 02:36 PM 4/23/00 -0400, you wrote:
> >
> > factor([Head|Tail], Answer) :-
> > is_list(Head), Answer is Head. ??
> >
> > How do I bind answer to the first element in the list ( [3,1] )?
> >
>
>I've found that 'is' is for binding numerical expressions to variables, and
>that '=' is for binding other variables to variables. If 'is' isn't
>working, you may want to try '='.
This archive was generated by hypermail 2.0b3 on Sun Apr 23 2000 - 14:37:08 EDT