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
aw- has joined #picolisp
orivej has quit [Ping timeout: 255 seconds]
aw- has quit [Quit: Leaving.]
<Regenaxer> Hehe
<Regenaxer> The hook *is* the supplier. In this example the tree for 'nr' is stored in each supplier, instead of the *DB root
<Regenaxer> (scan (tree 'nr '+Itm (db 'nm '+Sup "Siemens")))
alexshendi has joined #picolisp
<freemint> Regenaxer, I do not understand that
<Regenaxer> hmm
<Regenaxer> It would be best if you create a DB, and inspect the objects and trees
<Regenaxer> Start with (edit *DB) and click yourself through it
<freemint> but i think '(scan (tree 'nr '+Itm (db 'nm '+Sup "Siemens"))) should be added toe +Hokk doc
<cess11_> There is none.
<Regenaxer> Well, there is an (as always short) reference
<cess11_> Yes, but not like '(doc 'scan), only in the reference. +Entity and +relation are in the docs, though.
<cess11_> I think this is more of a good subject for a tutorial or write-up.
<freemint> Regenaxer, I also plan to make my own index type for emails ...
<freemint> this would make for a good write up too
<cess11_> Absolutely.
<freemint> It will be mostly an simplified +Fold
<freemint> me+pico@gmail.com is the same as me@gmail.com
<freemint> same for -
<Regenaxer> freemint, yes, good idea
<Regenaxer> Not sure what are legal characters in email user names
<Regenaxer> cess11_, right, the DB stuff would need a better tutorial
<freemint> *need a tutorial
orivej has joined #picolisp
<Regenaxer> There is a short one
<Regenaxer> in doc/tut.html
<freemint> I am aware ...
<freemint> but is more tongue and cheek to say there is none.
mario-goulart has quit [Remote host closed the connection]
mario-goulart has joined #picolisp
<freemint> Regenaxer, to make my own index type i just need to replace fold with my own function?
<freemint> & do the rest like +Fold
<cess11_> Inheritance is convenient, '(class +FreemintFold +Fold) probably is a good start.
<freemint> (class +Fold)
<freemint> (dm rel> (Obj Old New Hook)
<freemint> (if (= Val (fold Val)) (fold X) X) ) )
<freemint> (extra Val
<freemint> (dm has> (Val X)
<freemint> (extra Obj (fold Old) (fold New) Hook) )
<freemint> (dm rel?> (Obj Val Hook)
<freemint> (let V (fold Val)
<freemint> (or (not V) (extra Obj V Hook)) ) )
<freemint> (dm lose> (Obj Val Hook)
<freemint> (extra Obj (fold Val) Hook) )
<freemint> (dm keep> (Obj Val Hook)
<freemint> (extra Obj (fold Val) Hook) )
<freemint> inhereting will help nothing
<freemint> but thanks for tipp i did oversee that option
<cess11_> Sure, it's up to you if you reuse '+Fold or write your own versions of those methods.
<freemint> cess11_, what could i possibly reuse?
<freemint> *inherit
<Regenaxer> Yes, perhaps like +MupIdx in wiki?
<freemint> Regenaxer, honestly i have not grasped +MupIdx yet
<cess11_> freemint: It's nice to have 'has> and 'lose> at the least.
<Regenaxer> and rel>
<Regenaxer> rel> is the most important one, it does the actual work
<cess11_> T
<cess11_> Thought they were going to rewrite it, though not really sure.
<cess11_> Would it be appropriate to use '(rel gnrc (+List +Link) (+Any)) or are there better ways to do it?
alexshendi has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
alexshendi has joined #picolisp
freemint has quit [Ping timeout: 252 seconds]
freemint has joined #picolisp
<freemint> Regenaxer, can i 'throw inside 'rel>, 'has> and ... without breaking the database
<cess11_> It's up to your 'catch and 'finally code to handle that.
<freemint> cess11_, I am asking because of put! and so on
<freemint> which do locking and so
<freemint> i can not finalize them
<cess11_> Why would you use any of the !-varieties in those contexts?
<freemint> cess11_, good point ... i do not want actually ...
<Regenaxer> yes, throw is fine, but better do a (rollback) before
<freemint> ah ok
<Regenaxer> rollback also releases the locks
<freemint> Could you take a look at this: https://pastebin.com/sJLKbKq3
<Regenaxer> (let (c is better (let (C ..., and (when (=0 (length Email) is not as good as (unless Email
<Regenaxer> 'lenght' is expensive
<freemint> ah yes
<Regenaxer> But we still have guests, and I cannot dig into it now
<freemint> Take care of the physicall guest first
<Regenaxer> Instead of push/reverse make/link is better
<Regenaxer> What exactly is 'mnorm' supposed to do?
<Regenaxer> In addition to the above: (when (=0 (dec (length is (unless (cdr ..
<Regenaxer> And successive 'when's are a candidate for 'cond'
<Regenaxer> or 'if' with "else" part
<Regenaxer> as after the first 'when' the second will never fire
<freemint> Good tipps ...
<freemint> I looked into +MupIdx. Mein Verständniß: ein +MupIdx ist ein Baum von Paaren, diese bestehen aus einem einzelnen Word aus einer Datei und dem dazugehöriegen Mup. Ein Mup wird als Treffer anerkannt, wenn alle Wörter aus der Query drin vorkommen.
<freemint> Is that right?
<cess11_> Yes, something like that.
<cess11_> 'make is great, especially for exfiltrating data into objects or UI, it can deliver to just about any '+List or GUI-context.
<Regenaxer> An index is on a lower level than a query
<Regenaxer> It allows to find all Mups for a given word
<Regenaxer> (collect 'nm '+Cls "the")
<Regenaxer> not special for "Mups", in general for a +Cls
<Regenaxer> eg. in the wiki:
<Regenaxer> : (collect 'mup '+Doc "vip")
<Regenaxer> -> ({A4} {A357})
<Regenaxer> gives two documents
<Regenaxer> What exactly is 'mnorm' supposed to do?
<Regenaxer> It looks somehow too complicated to me
<freemint> Regenaxer, mnorm handles weird but legit emails ...
<freemint> emails are allowed to contain "" and in the "" even stuff like @ is allowed,
<Regenaxer> Example?
<freemint> https://en.wikipedia.org/wiki/Email_address i wanted a sensible subset of that
<Regenaxer> What patters does your code cover?
<freemint> it covers + as tag, "", and (comments)
<Regenaxer> Example?
<Regenaxer> I think of complicated rollbacks I would first do a simple check
<Regenaxer> on the higher level
<Regenaxer> a function 'email?'
<Regenaxer> What are the patterns?
<Regenaxer> The function really looks strange in my feeling. It must be a lot simpler
<freemint> read #localpart on the wikipedia artivle
<Regenaxer> ok
<freemint> (co)user@host = user(co)@host = user@host
<Regenaxer> So it could be a simple single expression
<freemint> user+tag@host = user@host
<Regenaxer> (fully '((C) ...) (car (split (chop Addr) "@")))
<Regenaxer> and '((C) ...) does a few 'member' checks
<freemint> \@ escapes at symbol in mail
<Regenaxer> *before* you start a DB operation
<Regenaxer> ok
<freemint> @ allowed in ""
<freemint> (willling to rop the last two ... never seen in the wild ... but i want to rfc closenss too)
<Regenaxer> good
<Regenaxer> \ before special chars can be checked too
<freemint> how?
<Regenaxer> with member and prior
<Regenaxer> (and (member "@" L) (not (= "\\" (car (prior @ L))))) or so
<Regenaxer> or iterate the list
<Regenaxer> and check each char
<freemint> (i did do the second thing)
<Regenaxer> if it is \, just skip the next
<freemint> i think i drop double paran support
<freemint> *quote
<freemint> ho
<freemint> *how can i set a cdr to a certain value?
<Regenaxer> 'con'
<Regenaxer> I still do not really grok this function. What does it return? It filters off bad patterns?
<freemint> It removes things which are not used by a mail server to deliver emails to a user but used to decide in which mailbox it goes
<freemint> it fails if the email i so borkcne that i can not parse it ...
<freemint> (mailbox as in mailfolder)
<freemint> user+tag@host is recieved by user@host
<Regenaxer> Let me look
<Regenaxer> analyze the flow
<freemint> read the scary wikipedoa article
<freemint> the code has bugs i noticed
<freemint> which case would make vanish
<freemint> but it works mostly allright
<Regenaxer> I don't have the time
<freemint> ok
<Regenaxer> I think the flow should be something along the line
<freemint> not that important
<Regenaxer> (make
<Regenaxer> (for (L (chop Email) L)
<Regenaxer> (case (++ Lst)
<Regenaxer> ("\\" (link (++ L)))
<Regenaxer> ("(" )
<freemint> what's +++
<freemint> ++ yeah that looks good
<Regenaxer> (pop 'L)
<freemint> thanks
<Regenaxer> At the very end of the 'case' you have then
<Regenaxer> (T (link @)) )
<freemint> i got that
<Regenaxer> ie normal char
<Regenaxer> ok
<freemint> i experimented with that before ... endless loop otherwise
<Regenaxer> And I would do that filter before storing it into the db
<Regenaxer> yeah
<Regenaxer> happens easily
<Regenaxer> I recommend to single-step to monitor what it does
<freemint> the "problem" is i want the raw string in the db but want it indexed by the canonized version
<Regenaxer> ("no time" because we still have guest ;)
<Regenaxer> yes, this is good
<Regenaxer> just if canonized version is empty then there is no index
<Regenaxer> I just mean to avoid the late check resulting in an abort
<Regenaxer> Checking could be done on a higher level, gui or input
<freemint> ok
<freemint> Rege.... the canonized version can not be empty, (unless i implemented it wrong) because all emails in the archive where sent before ... so they already passed "that works" and "let shave it down to the lowest demoninatorso no unknow email server might have a problem with it"
<Regenaxer> Ah, yes
karswell has joined #picolisp
<freemint> Regenaxer, (still_there> guest)
<Regenaxer> yess
<freemint> Regenaxer, brick wall number one: the list of chars is 31 times as big as original file
<freemint> (not really a brick wall but only want to keep the last N lines in RAM when parsing
<freemint> Line wise it is only 2,37 times so big
orivej has quit [Ping timeout: 240 seconds]
<freemint> 3 times so big if you include all newlines as an extra thing
<freemint> pure string is 1,9 something as big as the originall file
<freemint> 2,5 is each line ends with line break
<freemint> good night