ChanServ changed the topic of #picolisp to: PicoLisp language | Channel Log: https://irclog.whitequark.org/picolisp/ | Picolisp latest found at http://www.software-lab.de/down.html | check also http://www.picolisp.com for more information
u0_a183 has quit [Ping timeout: 260 seconds]
pierpal has joined #picolisp
pierpal has quit [Ping timeout: 260 seconds]
crides has joined #picolisp
crides has quit [Read error: Connection reset by peer]
crides has joined #picolisp
crides has quit [Ping timeout: 265 seconds]
pierpal has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #picolisp
<tankf33der> morning
<tankf33der> Regenaxer:
<tankf33der> pilog doesnt support rule within rule, right ?
<Regenaxer> Morning
<tankf33der> is it possible to workaround? :/
<Regenaxer> What does that do?
<tankf33der> is just a rule in rule
<Regenaxer> You use 'assert' to add rules at runtime
<Regenaxer> and 'retract' to remove
<tankf33der> this is not this case.
<Regenaxer> assert and retract are also in Prolog
<Regenaxer> I don't know what 'once' and 'chain' do in Prolog
<Regenaxer> I meant asserta/1
<Regenaxer> and assertz
<Regenaxer> not assert
<tankf33der> add_stone(stone(A,B),FreeSides,RestStones,Chain) :-
<tankf33der> i mean this !!!
<Regenaxer> yes, look up asserta
<tankf33der> ok then
<Regenaxer> and assertz
<Regenaxer> Something like (assertz (stone (@A @B) (freeSides) (Rest ...
<tankf33der> simple example.
<tankf33der> ========
<tankf33der> all i want is convert this code to pilog
<Regenaxer> yes
<Regenaxer> Should be straightforward, not?
<tankf33der> this rule within rule confuse me a lot first time.
<Regenaxer> It is just adding a property
<Regenaxer> Pilog rules are in the 'T' property
<tankf33der> how to convert this then ? :(
<Regenaxer> assertz or asserta
<Regenaxer> Where is the problem?
<Regenaxer> See example above
<tankf33der> hm
<Regenaxer> you want to code 'mike'?
<tankf33der> yes
<Regenaxer> no need for a special rule
<tankf33der> i want convert this three line to pilog
<Regenaxer> (? (assertz (stone 1 2)))
<Regenaxer> (? (assertz (stone 2 2)))
<Regenaxer> (? (stone @A @A))
<Regenaxer> not?
<tankf33der> no
<tankf33der> all above known
<tankf33der> but there is rule mike
<tankf33der> third line
<Regenaxer> Try call/1
<Regenaxer> I was wrong above
<Regenaxer> must be (? (assertz (stone (1 2))))
<Regenaxer> then: (be mike (@CL) (call @CL))
<Regenaxer> (? mike (stone @A @B))
<Regenaxer> bbl
<Regenaxer> ret
<tankf33der> i will use mike inside rules
<tankf33der> (mike (stone @A @B))
<tankf33der> doesnt work
<tankf33der> i will try without call then
<tankf33der> i meant (? (mike (stone @A @B)))
orivej has joined #picolisp
styx has joined #picolisp
xificurC has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
freemint has joined #picolisp
styx has quit [Quit: styx]
freemint has quit [Ping timeout: 248 seconds]
freemint has joined #picolisp
orivej has quit [Ping timeout: 264 seconds]
orivej has joined #picolisp
xificurC has joined #picolisp
<Regenaxer> I still don't understand
orivej has quit [Ping timeout: 244 seconds]
<Regenaxer> ok, tried it:
<Regenaxer> (be mike ((@P @X @Y))
<Regenaxer> (call @P @X @Y) )
<Regenaxer> : (? (mike (stone @A @B)))
<Regenaxer> @A=1 @B=2
<Regenaxer> @A=2 @B=2
<Regenaxer> Alternate syntax:
<Regenaxer> (be mike (@P @X @Y)
<Regenaxer> (call @P @X @Y) )
<Regenaxer> : (? (mike stone @A @B))
<Regenaxer> @A=1 @B=2
<Regenaxer> @A=2 @B=2
orivej has joined #picolisp
groovy2shoes has quit [Excess Flood]
groovy2shoes has joined #picolisp
<tankf33der> problem is mike should be true when first and second argument are equal
<tankf33der> check this again
<Regenaxer> That's the normal Prolog behavior
<Regenaxer> : (?
<Regenaxer> A=2
<Regenaxer> oops
<Regenaxer> : (? (mike stone @A @A))
<Regenaxer> @A=2
<Regenaxer> or:
<Regenaxer> : (? (mike stone @A @B) (equal @A @B))
<Regenaxer> @A=2 @B=2
<Regenaxer> I picked the first definition:
<Regenaxer> (be mike (@P @X @Y) # (? (mike stone @A @B))
<Regenaxer> (call @P @X @Y) )
<Regenaxer> With the other
<Regenaxer> (be mike ((@P @X @Y)) # (? (mike (stone @A @B)))
<Regenaxer> (call @P @X @Y) )
<Regenaxer> you get
<Regenaxer> : (? (mike (stone @A @B)))
<Regenaxer> @A=1 @B=2
<Regenaxer> @A=2 @B=2
<Regenaxer> -> NIL
<Regenaxer> : (? (mike (stone @A @A)))
<Regenaxer> @A=2
<Regenaxer> -> NIL
<Regenaxer> : (? (mike (stone @A @B)) (equal @A @B))
<Regenaxer> @A=2 @B=2
<Regenaxer> All a result of how {Pi,Pro}log matches and unifies patterns
orivej has quit [Ping timeout: 260 seconds]
freemint has quit [Ping timeout: 265 seconds]
erkin has joined #picolisp
<tankf33der> i will play, thanks
<tankf33der> this is my idea
<tankf33der> behaves like prolog now.
<tankf33der> all this for init_freesides
<tankf33der> check how it works differently if stone A A and stone A B
<tankf33der> so i need do emulate init_freesides on next step.
<Regenaxer> Yes, but falling back to Lisp is not so elegant
<Regenaxer> Are you sure? I would expect (solve '((mike (stone 'a 'a)))) to return false
<Regenaxer> otherwise 'mike' is like 'equal/2' ?
<Regenaxer> A Lisp solution is usually less useful also because it does not work backwards
<Regenaxer> bbl
<tankf33der> im just translate prolog to pilog
<tankf33der> mike stone a a returns true in prolog
<Regenaxer> ret
<tankf33der> this prolog code chains domino stones
<tankf33der> thats why it should understands 1,2 and 2,2
<Regenaxer> I don't want to dig into Prolog code. Can you tell me in words what *exactly* 'miki' should do?
<Regenaxer> What is the difference to 'equal/2'? Does it need to support more than 2 args?
<Regenaxer> How about this?
<Regenaxer> (be mike (@A))
<Regenaxer> (be mike (@A . (@B . @L))
<Regenaxer> (equal @A @B)
<Regenaxer> (mike @B . @L) )
<Regenaxer>
<Regenaxer> : (? (mike 1 1))
<Regenaxer> -> T
<Regenaxer> : (? (mike 1 2))
<Regenaxer> -> NIL
<Regenaxer> : (? (mike 1 1 1))
<Regenaxer> -> T
<Regenaxer> : (? (mike 1 1 2))
<Regenaxer> -> NIL
<Regenaxer> : (? (mike 7 @A 7))
<Regenaxer> @A=7
<Regenaxer> : (? (mike 3 3 3 @X))
<Regenaxer> @X=3
orivej has joined #picolisp
freemint has joined #picolisp
<freemint> Regenaxer to what would need to happen for minipicolisp to support databases?
<Regenaxer> PLIO
<Regenaxer> and some POSIX calls, which by definition are not supported by miniPicoLisp
<Regenaxer> pread(), pwrite(), but most notably fcntl()
<Regenaxer> And for full support also pipe() and select()
freemint has quit [Ping timeout: 244 seconds]
freemint has joined #picolisp
<Regenaxer> afp
alexshendi has joined #picolisp
erkin has quit [Quit: Ouch! Got SIGIRL, dying...]
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
orivej has quit [Ping timeout: 248 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
alexshendi_ has joined #picolisp
alexshendi has quit [Ping timeout: 248 seconds]
styx has joined #picolisp
<Regenaxer> ret
alexshendi_ has quit [Ping timeout: 256 seconds]
alexshendi has joined #picolisp
pierpal has quit [Quit: Poof]
pierpal has joined #picolisp
alexshendi_ has joined #picolisp
alexshendi has quit [Ping timeout: 256 seconds]
styx has quit [Quit: styx]
orivej has joined #picolisp
alexshendi has joined #picolisp
alexshendi_ has quit [Ping timeout: 256 seconds]
pierpal has quit [Ping timeout: 256 seconds]
freeemint has joined #picolisp
freemint has quit [Ping timeout: 245 seconds]
freemint has joined #picolisp
freeemint has quit [Ping timeout: 264 seconds]
<N3k0> how to define a predicate for floating point numbers?
<N3k0> isit even possible? does picolisp perceive any difference between scaled integers and normal numbers?