freenode/#lisp - IRC Chatlog
Search
14:59:49
jackdaniel
interesting read about formally-specified user interfaces: https://www.hillelwayne.com/post/formally-specifying-uis/
16:38:32
_death
using statecharts for this is an interesting idea.. some months ago I started on a code generator in lisp to generate C++ code from statecharts.. I modeled a small application I wrote with it, but in the end I had other things to do ;) so the project is on hold.. the verification stuff, I don't care for
16:51:26
jackdaniel
oh, I thought I've posted it on #clim (I wouldn't post it here because it is not really related to lisp as such)
20:22:37
macbug
i tried to ask a question in #clnoobs but no answe, is it ok if i post eustion here?
20:23:55
macbug
hi, i'm trying to code a function with generates a random number, this random number should be between two given numbers.
20:25:11
Xach
macbug: if start and end are 10 and 20, what is the range? the range is what you want to give to random.
20:26:22
macbug
i have tried to give end the value of 100 and start a value of 1. The problem is that it always returns 45 or 93.
20:27:21
pjb
macbug: now newbies go to #clschool, because some people thought #clnoobs was demeaning to newbies.
20:28:35
pjb
macbug: in the same lisp image, the pseudo-random number generator will generate other values.
20:33:03
sjl_
that's what I would expect. You bind the random number to a variable, but the body of your LET is empty, so it just returns NIL.
20:33:29
sjl_
I don't see how it could be returning 45 or 93 or anything aside from NIL as it's currently written
20:33:43
pjb
(defun random-between (start end) (+ start (random (- end start)))) (loop repeat 10 collect (random-between 50 100)) #| --> (82 74 94 81 87 79 75 90 50 56) |#
20:33:49
Xach
sometimes when i have a problem like that it is because i have renamed something but forgotten to use the new name.
20:40:44
macbug
it will take me a while to understand this new funtion but atleast i can continue to work on my game, thx. I'll ask questions in #clschool from now.
20:47:09
pjb
macbug: there's nothing strange to understand here, but that when you add S to a number between A and B, you get an number between S+A and S+B.
20:47:52
pjb
macbug: so if you want start=S+A and end=S+B with and A=0, then start=S and end-start=B.
23:45:42
rpg
I know I should know this but... where is the iterate library hosted these days? the project page on common-lisp.net still points at a darcs repo
23:47:04
rpg
Xach: Thanks! I wish someone would fix the iterate project page, or if not just kill it.
23:47:39
aeth
rpg: you can find the source Xach uses here: https://github.com/quicklisp/quicklisp-projects/search?utf8=%E2%9C%93&q=iterate&type=