Issue with \date datatype in Flora-2

1 view
Skip to first unread message

ehzut...@gmail.com

unread,
Jan 20, 2019, 5:18:08 AM1/20/19
to ErgoAI, Flora-2, and XSB Users Forum
Hello,
I'm using Flora-2 2.0 on a Manjaro Linux box. I want to build a program using the \date datatype.
- Following the user manaual, In the shell I successfully run:
"2019-01-19"^^\date[day -> ?a]@\basetype which gives me the expected: ?a = 19
However in a prgram  I have this class object:

Day[    name => \string,
    week => \integer,
    date => \date,
    status => \string ].

With the below data:

002:Day[name -> sun,
    week -> 01,
    date -> "2019-01-20",
    status -> F].

001:Day[name -> sat,
    week -> 01,
    date -> "2019-01-19",
    status -> F].

When loading the file, I get this error:
" <Compiler> near line(58)/char(10) `"2019-01-19"' this syntax is permitted in expert mode only"

And then, when I fail to to get the day with something like:
001:Day[date -> ?_y], ?_y^^\date[day -> ?a]@\basetype.

What am I missing?

Thanks for any tips.

Michael Kifer

unread,
Jan 20, 2019, 11:57:33 AM1/20/19
to ErgoAI, Flora-2, and XSB Users Forum


On Sunday, January 20, 2019 at 5:18:08 AM UTC-5, ehzut wrote:
Hello,
I'm using Flora-2 2.0 on a Manjaro Linux box. I want to build a program using the \date datatype.
- Following the user manaual, In the shell I successfully run:
"2019-01-19"^^\date[day -> ?a]@\basetype which gives me the expected: ?a = 19
However in a prgram  I have this class object:

Day[    name => \string,
    week => \integer,
    date => \date,
    status => \string ].

With the below data:

002:Day[name -> sun,
    week -> 01,
    date -> "2019-01-20",
    status -> F].

001:Day[name -> sat,
    week -> 01,
    date -> "2019-01-19",
    status -> F].


"2019-01-19" etc. is not a date constant. In fact, it isn't even legal syntax in the novice mode.
A date constant would be "...."^^\date.

ehzut...@gmail.com

unread,
Jan 24, 2019, 9:03:44 AM1/24/19
to ErgoAI-Flor...@coherentknowledge.com
Thanks Michael. I thought it was enough to declare "date" as "\date" type in the "Day" class. My small programm works fine now. Best.

Michael Kifer

unread,
Jan 25, 2019, 2:37:02 PM1/25/19
to ErgoAI, Flora-2, and XSB Users Forum


On Thursday, January 24, 2019 at 9:03:44 AM UTC-5, ehzut wrote:
Thanks Michael. I thought it was enough to declare "date" as "\date" type in the "Day" class. My small programm works fine now. Best.

You are welcome.
Regarding declarations, one can't write something that is inconsistent with declarations, especially if this is incorrect syntax. 
Reply all
Reply to author
Forward
0 new messages