<buenouanq>What's the proper way to load a custom module? <buenouanq>;;; WARNING: compilation of .../test.scm failed: <buenouanq>yet I can still use what (sxml html) exported <daviid`>buenouanq: there is no sxml hmtl module in guile <daviid`>if you installed from the above, you need to tell guile where to find the module ... see %load-path and GUILE_LOAD_PATH in the manua ... <buenouanq>I have saved it in the folder I'm working in. <buenouanq>the above errors come from using (load "./sxml-html.scm") <buenouanq>and even though it says there is no code, sxml->html still works as expected/desired. <buenouanq>but if I do the recommended (add-to-load-path (dirname (current-filename))) it fails to run at all <daviid`>buenouanq: first you should solve the (sxml html) module not found, by installing (see the link I pasted above) and telling guile - %load-path or GUILE_LOAD_PATH - where you did install ... fire a repl and ,use (sxml html) should work <daviid`>then you can further work on your scheme file ... <buenouanq>I'm trying to do exactly that and it's not working is the thing. <daviid`>buenouanq: if the file exists, it is somewhere, like /your/path/sxml/html then you must add "/your/path" to the list of path in %load-path, then it will work <buenouanq>I have dt"s library saved as a file in the same directory the script I'm working on is in. <buenouanq>but (add-to-load-path (dirname (current-filename))) dosen't work <daviid`>buenouanq: that won' work indeed, read what I just wrote <daviid`>you should read or re read about what are modules, hw to define and use them in the manual ... <buenouanq>/your/path in this case is the value of (dirname (current-filename)) <buenouanq>I've read it a bunch of times, there's obviously something that's not clicking. <daviid`>buenouanq: try to add it manually, till it works <buenouanq>t.. that's exactly what I'm talking about doing <daviid`>that is not the way tu use modules, and load has nothing to do with %load-path ... <buenouanq>with add-to-load-path it throws the errors and refuses to even run <daviid`>do as I say: manually like (add-to-load-path "/your/path") <daviid`>you may also check, by entering %load-path, and verify that "/your/path" is in the list <buenouanq>is the problem that it has to be named ./sxml/html.scm <daviid`>buenouanq: that won't work, you have to spel the fullpathname <daviid`>then %load-path, check it's i the list, then ,use (sxml html) <daviid`>guile won't accept it, i told you already <daviid`>buenouanq: we do that, guilers, million of times, there is something you don't understand and/or miss spell ... <daviid`>if the file exists: /your/path/sxml/html.scm, then it wil work, if you do as i say ... as it is explained in the manual .... anything else will fail <buenouanq>ok, relative paths do in fact work - the problem was what I said above <buenouanq>which has something to do with module naming conventions I guess <buenouanq>so if I wanted to have the file be ./sxml-html.scm I would have to change the name of the module and use (use-modules sxml-html) <daviid`>yes, that is how module are defined (sxml html) means there is a file sxml/html.scm <daviid`>buenouanq: that is why I suggested you re read the manual about what modules are, how to define and use them .. you shoud really do that first <buenouanq>I figured adding something to the load path would read anything in it and being defin-module calls it (sxml html) it would be found <buenouanq>I have it all open and have gone through it many times - There are things that just don't make sense until I talk through them like this. Hope the room doesn't mind the activity ( ._.) <daviid`>buenouanq: re read this section 6.20.4 Modules and the File System <mwette>buenouanq: This is what I use: `(add-to-load-path (getcwd)) (use-modules (sxml html))' <manumanumanu>the speed benefit of them isn't too big in guile, but in chez...whoosh! They are flying! <manumanumanu>I suspect the function calling overhead in guile is quite a bit larger, and the GC benefits aren't as noticeable. <chrislck>if A and B are both either numbers or #f (denoting absence of numbers), there's a beautiful symmetry to coding their addition <chrislck>(define (myadd A B) (if A (if B (+ A B) A) B)) <chrislck>this works on any combination of A B being numbers or #f <mwette>chrislck: check out "The Maybe monad" <lispsps>is the guile manual the best place to learn guile? <mwette>lispsps: SICP should be a great start <lispsps>if I would want to create for an example a game or a chat in guile, is the manual or that procedure table right place to start looking for libraries and stuff? <manumanumanu>lispsps: the manual can be a little sparse on examples, but yes. There isn't a good way to find external libraries, but googling generally works if you don't mind ignoring some results from the playstation game Tekken. ***hugh_marera_ is now known as hugh_marera
***hugh is now known as Guest42496
***francesco__ is now known as Franciman
<civodul>(ice-9 regex) provides POSIX regexps <civodul>but SRFI-115, which provides SRE, should work fine with Guile <civodul>but you can take the reference implementation from srfi.schemers.org <Franciman>especially because I just wrote: \\\\\\\\\\\\\\\\