[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Info-gnuprologjava] Infix expressions with user-defined operators
From: |
Daniel Thomas |
Subject: |
Re: [Info-gnuprologjava] Infix expressions with user-defined operators |
Date: |
Tue, 23 Apr 2013 21:22:47 +0100 |
Hello Carlos,
Have you tried specifying the operator entirely in the prolog code using
op(350,xfy,::)?
Can I have details of exactly what is going wrong. What error messages
are you getting etc.? Can you give me a minimal test case which fails?
User defined infix operators should just work, if they don't that is an
unexpected bug.
Daniel
On Mon, 2013-04-15 at 21:00 -0500, Carlos-Manuel LÓPEZ-ENRÍQUEZ wrote:
> G'day,
>
>
> I used gnu-prolog to create a program. For syntax purposes I defined
> an operator '::' (i.e, op(350,xfy,::)) in order to make infix
> expressions such as A=a::b::c
>
>
> Now I want to use gnu prolog for java (0.2.6) and I defined the same
> operator in my environment:
>
>
> environment.getOperatorSet().add(350,SPECIFIER.XFY,"::");
>
>
> Nevertheless, the infix syntax A=a::b::c is not allowed and I have to
> use B=..[::,b,c], A=..[::,a,B].
>
>
> All my code has infix expressions (e.g., head(A::B::C):- ... ) and I
> want to avoid massive and dangerous modifications and keep my code
> readable.
>
>
> Is there a way in gnu prolog for java to enable infix expression with
> user-defined operators?
>
>
> Thanks in advance!
>
>
> --
> Carlos
signature.asc
Description: This is a digitally signed message part