freenode/#lisp - IRC Chatlog
Search
1:11:27
dlowe
One interesting thing it does is provide a docker container so you can try it out with no setup
1:17:51
jasom
just because it seems like something that might already exist; a tool for pretty-printing durations to round amounts? e.g. print "3 seconds or "5 minutes" or "2 hours" or "3 days" or "3 weeks" given some type of time duration as input?
1:23:09
oni-on-ion
whoa -- just learned about: (format nil "~r" 1234) ==> "one thousand two hundred thirty-four"
1:24:24
oni-on-ion
jasom, i cant seem to find anything built in, perhaps this is helpful? --> https://github.com/quek/simple-date-time
1:32:23
pjb
oni-on-ion: even better: this is the (format nil "~:r" 1234) #| --> "one thousand two hundred thirty-fourth" |# time somebody found it!
1:37:35
oni-on-ion
its possible to do custom formats ? for eg., print digit from 1-26 for alphabet: "abcd -> 1234"
1:39:27
specbot
Tilde Slash: Call Function: http://www.lispworks.com/reference/HyperSpec/Body/22_ced.htm
1:44:03
no-defun-allowed
I believe it was this part that tripped me up: If name does not contain a ":" or "::", then the whole name string is looked up in the COMMON-LISP-USER package.
1:50:54
no-defun-allowed
I assume it could be so compilers could generate code for FORMAT rather than interpreting the string. If that rule wasn't there, the effect would be dependent on the current package, but that doesn't seem too difficult to manage
2:22:39
jasom
I've used that for escaping strings: (format X "Foo \"~/pkg:escape/\"" bar) is much more obviously correct that (format X "foo \"~a\"" (escape bar)), particularly when you have a long format string or many arguments.
2:26:57
pjb
(format nil "Foo ~S bar" "Hello \" World! \\ <-- ha! \"") #| --> "Foo \"Hello \\\" World! \\\\ <-- ha! \\\"\" bar" |#
2:53:24
vms14
what's the "correct" way for having a group of labelled functions with local variables, should I use let and put the labels inside that let, or make the labelled functions receive them as argument? two of them are recursive and one gets called from another, but needs an argument that the callee does not need
2:54:24
vms14
sorry if you cry with the code, but it's a bad implementation of a image format I've created
2:55:00
vms14
the image will be a list of positive and negative numbers and the first item will be the width of the image
2:55:58
vms14
positive numbers refer to a color and negative numbers mean steps or points to draw with the current color
4:20:03
vms14
Josh_2: ty but now I need to create a paint software able to export to this weird format I've created
4:21:06
vms14
and I have no idea about how I should do it, but since will be for basic pixel art stuff it should be easier
4:28:52
vms14
oni-on-ion: I'm using clx and I saw no way to import images more than monochrome bitmaps
4:30:30
vms14
new-clx has support for xpm format, but the old one not, I use the "old" one since I target sbcl
4:32:29
oni-on-ion
could always hook up opengl to the window, might be helpful for higher color and hardware acceleration if neede
4:35:12
oni-on-ion
nice =) couple months ago i got some raw pixel blitting happening and it was very fast. so one can use any image loader
4:35:28
oni-on-ion
like the recent PNG library for CL which is nice n fast (compared to the previous one, afaik)
4:36:39
vms14
if you want to get started I recommend to google for "simple clx", they're simple examples and knowing xlib you'll easily get the difference
4:37:11
oni-on-ion
i can imagine =) however i am just using raylib for now. its a nice library, than SDL(2), and works for win32 and the web as well.
4:37:35
oni-on-ion
for using opengl, i had it rendering Cairo onto opengl texture then to window in real time at hyper speed on old hardware
4:39:19
oni-on-ion
(cairo because i needed vector and also font. also the API is just about interchangeable (especially with ocaml!!) with html5 canvas so that my work could run on any modern system incl. mobile and game console)
4:43:21
oni-on-ion
cool =) i honestly would too but i want to show my friends who only have mobile, and my tablet is stuck with windows8.1
6:08:55
pjb
oni-on-ion: cliki.net references several graphic toolkits. I would suggest pgl, since it's very simple. (However it's not native). Depending on the sophistication of your paint application, and the target systems, McCLIM or CLX could be good choices too.
6:11:26
oni-on-ion
i think it was vms14 who is doing current clx work. i will regard this new information
8:11:57
Harag
What should the method-combination-type-name be in find-method-combination if I am trying to check if method z has a specialization on class a for (defmethod z ((var a)))
8:39:12
beach
Harag: I am thinking you probably want to call METHOD-SPECIALIZERS on every method on Z instead.
9:18:16
Harag
but (find-method #'z '() (list (find-class 'b))) gives me an error, I was expecting nil ??
9:36:11
phoe
_death: find-method is going to signal an error anyway if you call it like (find-method #'z '() (list nil))
9:40:32
Harag
_death: thanx did not see errorp parameter, and I should never have the nil issue so its ok
9:42:31
_death
phoe: the misunderstanding is that you think I referred to find-class, while I referred to find-method
9:43:33
Harag
find-class was just to simplify the example I am actually looping through a list of super classes