Re: call, ..= operator, records (newbie)
- From: Martin Riener <e9927068@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 21 May 2008 16:04:07 +0200
levilista@xxxxxxxxx wrote:
I define a 'toy predicate' plus:
plus(X,Y):- Y is X+1.
Then I try the following:
24 ?- F=plus,F(2,X).
ERROR: Syntax error: Operator expected
ERROR: F=plus,F(2,X
ERROR: ** here **
ERROR: ) .
Why do I get an error here?
I know it can be solved with the introduction of a new variable (see
below) , but I'm just curious why.
26 ?- F=plus,X=..[F,2,Z], call(X).
F = plus,
X = plus(2, 3),
Z = 3.
:- X=..[plus,2,Y], X.
works for me too (swi)... as for why higher order predicates have to be explicit, i am too unaware of the context of the creation/standardisation of the language. i guess that seperate atom/function/predicate spaces play a role in this, but perhaps some of the prolog implementors on the list could help us out?
greetings Martin
.
- Follow-Ups:
- Re: call, ..= operator, records (newbie)
- From: levilista@xxxxxxxxx
- Re: call, ..= operator, records (newbie)
- References:
- call, ..= operator, records (newbie)
- From: levilista@xxxxxxxxx
- call, ..= operator, records (newbie)
- Prev by Date: Re: call, ..= operator, records (newbie)
- Next by Date: Re: call, ..= operator, records (newbie)
- Previous by thread: Re: call, ..= operator, records (newbie)
- Next by thread: Re: call, ..= operator, records (newbie)
- Index(es):
Relevant Pages
|
|