User Activity

  • Modified a comment on discussion Help on CLIPS Rule Based Programming Language

    Thanks Gary! I did not mean to make your life more difficult. fact-slot-value looks definitely nice-enough to me. A thought. Might you (ab)use the template notation a bit in deffunctions, perhaps like this? (deffunction Ttot ((?a T)) ... ) ugh, no that's a lot of parens. Oh well, THANKS!

  • Posted a comment on discussion Help on CLIPS Rule Based Programming Language

    Thanks Gary! I did not mean to make your life more difficult. fact-slot-value looks definitely nice-enough to me. A thought. Might you (ab)use the template notation a bit in deffunctions, perhaps like this? (deffunction Ttot ((?a T)) ) ugh, no that's a lot of parens. Oh well, THANKS!

  • Posted a comment on discussion Help on CLIPS Rule Based Programming Language

    I can see from the CLIPS parser and manual that this does not work because T is not a <regular-parameter> nor a <wildcard-parameter>. CLIPS> ( deftemplate T (slot x) (slot y) ) CLIPS> ( deffunction Ttot (?a) (return (+ ?a:x ?a:y)) ) [PRCCODE3] Undefined variable ?a:x referenced in deffunction. My question is: I have a template, and I want to define a function that is something-like a method (?) for it. How should I express this idea in the most CLIPS-native way? for now, I am doing something like...

  • Posted a comment on discussion Help on CLIPS Rule Based Programming Language

    Oh ick. You are Gary Riley, whose goblin-laden book is perched to the left of my keyboard as I struggle with my middle-aged brain and CLIPS, and now I feel like a complete idiot. THANKS FOR THE BOOK, Gary, IT IS TERRIFIC https://www.kobo.com/au/en/ebook/adventures-in-rule-based-programming

  • Modified a comment on discussion Help on CLIPS Rule Based Programming Language

    Thinking, I could/should compile such a thing, but it is not where I wanteed to go today. Instead, and noting that the system command writes a file, that I then read, I thought: Why not use a pipe through awk to reformat the TSV to rules? We are out in unix land after all. This horrorshow ensued: # TSVtoRules.awk # convert a (ms-sql sourced) TSV into CLIPS rules BEGIN { cf = "" FS="\t" OFS=") (" # paren space paren } (NR==1) { deftemplateFile = "deftemplate-" factName factsFile = "facts-" factName...

  • Modified a comment on discussion Help on CLIPS Rule Based Programming Language

    Thinking, I could/shoul compile such a thing, but it is not where I wanteed to go today. Instead, and noting that the system command writes a file, that I then read, I thought: Why not use a pipe through awk to reformat the TSV to rules? We are out in unix land afterall. # TSVtoRules.awk # convert a (ms-sql sourced) TSV into CLIPS rules BEGIN { cf = "" FS="\t" OFS=") (" # paren space paren } (NR==1) { for(i=1; i < NF; i++) fieldName[i] = $i } (NR!=1) { #strip out quotes, paired quotes and other things...

  • Posted a comment on discussion Help on CLIPS Rule Based Programming Language

    Thinking, I could/shoul compile such a thing, but it is not where I wanteed to go today. Instead, and noting that the system command writes a file, that I then read, I thought: Why not use a pipe through awk to reformat the TSV to rules? We are out in unix land afterall. # TSVtoRules.awk # convert a (ms-sql sourced) TSV into CLIPS rules BEGIN { cf = "" FS="\t" OFS=") (" # paren space paren } (NR==1) { for(i=1; i < NF; i++) fieldName[i] = $i } (NR!=1) { #strip out quotes, paired quotes and other things...

  • Modified a comment on discussion Help on CLIPS Rule Based Programming Language

    I am trying to reason about data that come from a SQL database. The code to get the facts begins a little like this: (deffunction getData () (system "isql ADB -x0x09 -b -c -n username password < getSlots.sql > slots.tsv") (open "slots.tsv" slots "r") (bind ?L (readline slots)) (while (neq ?L EOF) (bind ?L (readline slots)) (printout t ?L crlf) ) (close slots) ) (I am aiming to explode$ rather than printout in there, and I'm not sure how to explode using tab characters - but I am having fun working...

View All

Personal Data

Username:
slander
Joined:
2000-11-06 04:40:38

Projects

  • No projects to display.

Personal Tools