#clojure log - Jan 03 2009

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:07 Chouser: traffic here: http://spreadsheets.google.com/pub?key=p1hkQs__fVybaFUEpdsigMg&oid=4&output=image

0:08 arbitrary units.

0:31 nibbs: anone working with compojure?

0:31 is it possible to use javascript with it to?

0:31 what about the clojure-javascript compiler someone is working on?

0:37 dhaya: nibbs: contrib has clojurescript that Chouser worked on, but I don't know the status of that.

1:06 nibbs: http://sourceforge.net/projects/clojure-contrib

1:06 where is the actual downlod to contrib?

1:08 dhaya: http://clojure-contrib.googlecode.com/svn/trunk

1:37 chrisn: how does one create a runnable jar file with clojure? Looking at clojure main, it is kind of weird.

1:37 main.clj, that is

2:03 dhaya: chrisn: (:gen-class) to generate a main() method, and a Manifest file, didn't work for you?

2:03 chrisn: dhaya: Thanks. I used gen-class then created -main[& args]

2:03 I may be using an old version

2:03 of clojure

2:04 (defn- -main[& args] blah blah)

2:04 the -main part is what I thought was weird.

2:04 But it worked...

2:05 I also don't quite understand gen-class

2:05 But I don't need to right now.

2:22 falconair: Hi, I'm having trouble instantiating Line2D.Double from clojure "new Line2D.Double(10, 10, 100, 100 );"

2:22 how does one instantiate nested classes?

2:23 oops, just found it

2:24 Line2D$Double <== dollar sign

2:54 nibbs: how do I pull contrib from svn, i dont know svn

2:58 dhaya: nibbs: http://code.google.com/p/clojure-contrib/source/checkout

2:59 svn checkout http://clojure-contrib.googlecode.com/svn/trunk/ clojure-contrib-read-only

3:01 If git is your thing, you can pull from a git mirror using: git clone git://github.com/kevinoneill/clojure-contrib.git

3:54 nibbs: I have compojure.jar in C:/clojure/ , I have it in my classpath.

3:54 how do I import it from the repl?

4:13 is it require or :require?

4:22 hiredman: depends where you use it

4:22 in (ns ...) it is :require

4:26 nibbs: compojure.jar in C:/clojure/compojure.jar

4:26 how do I then import it from the repl?

4:34 user=> (use 'compojure.http)

4:34 java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0)

4:35 hiredman: uh

4:35 last I checked compojure was more than a single jar

4:36 nibbs: i pulled from github, or cloned to be exact

4:36 +jetty

4:36 user=> (use 'compojure.jetty)

4:36 java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest (NO_SOURCE_FILE:0)

4:36 u

4:37 wtf they are there

4:37 hiredman: are the jars in your classpath?

4:38 nibbs: yes

4:39 hiredman: are you sure?

4:42 nibbs: hmm now require worked'

4:42 (require '[compojure.html :as html])

4:42 how do I require several different ones?

4:46 hiredman: (doc require)

4:46 clojurebot: Loads libs, skipping any that are already loaded. Each argument is either a libspec that identifies a lib, a prefix list that identifies multiple libs whose names share a common prefix, or a flag that modifies how all the identified libs are loaded. Use :require in the ns macro in preference to calling this directly. Libs A 'lib' is a named set of resources in classpath whose contents define a library of

4:46 nibbs: works:

4:46 (require '[compojure.html :as html])

4:46 doesnt work:

4:46 (require '[compojure.jetty :as jetty])

4:47 (require '[compojure :as cpj])

4:58 come on someone?

4:59 (require '[compojure.validation :as val])

4:59 validation is a dir

4:59 how do i import a .clj file?

4:59 compojure is a dir with 2 dirs a nd a bunch of .clj files

4:59 i can import the dirs but how the rest?

5:00 and how do I import seevral names ?

5:00 (require '[compojure.html :as html])

5:00 (require '[compojure.validation :as val])

5:00 how do I merge them?

5:14 java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest (NO_SOURCE_FILE:0)

5:15 (import '(org.mortbay.jetty Server))

5:15 wtf it IS there

5:33 who created compojure?

5:38 (import '(org.mortbay.jetty Server))

5:38 that is the stuff not working it seems

5:38 but the classpath is correct goooood

5:40 ah

5:41 weeeee!

6:18 who created compojure? i have some comments

6:19 it seems great

6:19 but the example could use require instead of use and thus use the namespace

6:19 would b eeasier to follow the examples then

6:24 Puzzler: Is there something like def- which is analogous to defn- to make a private definition?

6:26 nibbs: where does GET come form in compojure?

6:46 (def pod-server

6:46 (jetty/http-server {:port 8080}

6:46 "/main" main-servlet))

6:46 whats wrong with that?

6:49 StartsWithK: nibbs: GET is in compojure.http under "public macros" section

6:51 nibbs: yeah i found it

6:51 but i have a problem with jetty/http-server

6:51 i can create it and start it if i leave out "/main"

6:51 above

6:51 but then I cant find the site

7:07 (defserver my-server

7:07 {:port 8080}

7:07 "/*" my-main-servlet

7:07 "/other/*" another-servlet

7:07 ...))

7:07 thats the example in compojure

7:07 but it doesnt work...

7:11 arbscht_: nibbs: how does it fail?

7:12 nibbs: HTTP ERROR: 404


7:12 RequestURI=/main

7:12 Powered by Jetty://

7:12 i will aste

7:12 paste

7:13 http://paste.lisp.org/display/72999

7:14 (jetty/http-server {:port 8080}

7:14 {"/*" main-servlet}))

7:14 i tried that, is that correct?

7:14 arbscht_: that is not like the example

7:14 nibbs: because then in contstucts correctly but stioll doesnt show up

7:15 in / or /main

7:15 i tried as example

7:15 then i get error no mathcin ctor

7:17 the sevrer starts obv

7:17 but doesnt serv correctly

7:20 anyone with an example of a working compojure-example?

7:20 arbscht_: nibbs: http-server and defserver expect routes/servlets as arguments, not in a map

7:21 try something like this: (defserver pod-server {:port 8080} "/*" main-servlet)

7:22 nibbs: like i said i get:

7:23 user=> 2009-01-03 13:21:08.159::INFO: Logging to STDERR via org.mortbay.log.StdErrLog

7:23 java.lang.IllegalArgumentException: No matching ctor found for class org.mortbay.jetty.servlet.ServletHolder (web.clj:45)

7:23 u

7:23 when using that form

7:24 arbscht_: nibbs: your main-servlet is a function, not a servlet, too

7:26 nibbs: also, to make it easier, do something like this at the start: (ns nibbs (:use (compojure http jetty html))

7:26 you won't need to qualify symbols like http/defservlet then

7:27 nibbs: I hate use

7:27 I want the package/function deal

7:27 arbscht_: makes for hard reading

7:27 nibbs: nah the opposite, you see where stuff comes from

7:28 but basically i need to change main-servlet?

7:28 or just pass it?

7:29 arbscht_: see how the servlet is defined in the example

7:29 it isn't wrapped in a function

7:32 nibbs: ah see

7:32 now i get another error but progress at least :)

7:34 http://hpaste.org/13568

7:34 lissppaste doesnt work

7:36 arbscht_: what are you server and servlet definitions now?

7:36 your

7:37 nibbs: http://hpaste.org/13569

7:39 arbscht_: try setting your server pattern to "/*", to dispatch podly-servlet. iirc servlet routes are relative to the * in the server definition

7:40 nibbs: booya!

7:40 cool

7:40 so much thanks youll have thanks for the rest of youe life!

7:41 arbscht_: heh, np :)

7:42 Puzzler: If you want to mark a multimethod as private, do you just annotate the defmulti with a private meta, or do you also have to mark all the methods?

7:42 leafw: Puzzler: the methods are accessible on dispatch from the defmulti, so I guess one needs to set defmulti as private only.

7:48 nibbs: so Compojure is great to organize a site logically but let's say I want to do the html statically, how can I call a specific site like main.html?

7:53 arbscht_: nibbs: I don't know if this is the best way, but you can use http/serve-file

8:05 nibbs: is there no decent application or program for laying out websites? doing statically feels so 95...

8:22 leafw: in clojure/core.clj, in the definition of =, there are a few interesting meta tags that I know nothing about

8:23 can anybody explain what the :inline does? And the :tag Boolean?

8:23 is the :tab the return type?

8:23 the :inline-arities is even more mysterious

8:23 kotarak: :tag Boolean is information for the Compiler. So that it can avoid reflection.

8:24 leafw: kotarak: for the return type, I assume.

8:25 kotarak: I think so, yes.

8:25 leafw: the :inline is also present in (defn compare ... and it looks like its repeating the whole function as a list, like for an eval or a defmacro.

8:25 kotarak: The :inline stuff is also a hint, that the compiler can use the code instead of a function call.

8:26 leafw: but that "hint" is a function on itself -- although for =, it's a java method call.

8:26 oh I see, for 'compare' as well. Replace it with a java method call.

8:26 kotarak: I guess it's actually a macro.

8:26 leafw: :inline (fn [x y] `(. clojure.lang.Util equal ~x ~y))

8:26 kotarak: The the compiled code contains the code directly instead of a function call to =.

8:27 Looks macroistic, no?

8:27 leafw: yes and no

8:27 its still a fn with 2 args

8:27 as if it was for an eval, or a macro as you say

8:27 hum, it's a fn that returns the macro code, kind of thing.

8:27 kotarak: A macro is nothing different then a function. It's just called at compile time.

8:28 leafw: then that's what it may be

8:28 and the :inline-arity?

8:28 kotarak: Maybe, that only the named arities are inlined?

8:28 leafw: is it perhaps the method to choose from the 20+ methods present in IFn ?

8:28 by the number of args?

8:28 it's a bit cryptic, but it makes kind of sense

8:29 kotarak: Probably there is no other attribute to distinguis them.

8:29 leafw: true.

8:30 nibbs: (http/serve-file "C:/" "clojure/progs/pod/front.html")

8:30 how am i supposed to do?

8:30 icant get it to work

8:30 compojure.http/serve-file

8:30 ([path] [root path])

8:44 Chouser: (doc definline)

8:44 clojurebot: Experimental - like defmacro, except defines a named function whose body is the expansion, calls to which may be expanded inline as if it were a macro. Cannot be used with variadic (&) args.; arglists ([name & decl])

8:51 nibbs: ah got it working

8:52 kotarak: congrats

8:52 scode: I have a namespace/code loading issue, and I'm obviously missing something. If I (require x.y.z), have p in my CLASSPATH, and p/x/y/z.clj exists - it still just fails with a ClassNotFoundException. If I first (load "/x/y/z.clj") I get the same result.

8:53 In this case I have test/myns.clj containing just (ns test.myns).

8:53 And my attempted user simply use (require test.myns).

8:53 kotarak: (require 'x.y.z) note the quite

8:53 quote

8:54 scode: kotarak: When I do that, it goes looking for test/myns/myns.clj instead of test/myns.clj.

8:54 kotarak: Then you are using a really old version.

8:54 Have a look at the december release

8:54 scode: Oh ;)

8:54 Thanks.

8:55 kotarak: here a pointer: http://code.google.com/p/clojure/downloads/list

8:55 scode: Yeah no problem, I'm maintaining the freebsd port anyway. Just hadn't got the latest tree on this machine.

8:55 I had missed that changes to this were recently done.

8:56 That did it, thanks!

8:57 kotarak: np :)

9:09 nibbs: when I have a HTML file and a CSS file with the layout, how do I call that file? like should I open the html-file still? and how does it know where to look for the css-file?

9:13 is there no documentation-system for Clojure? I started writing one, perhaps I should finish it. like: (doc-gen "C:/clojure/programs/hmm.clj") -> hmm.html

9:13 which has function-names and their arguments and metadata

9:14 Chouser: nibbs: there's something that produces http://clojure.org/api but that is wiki markup not html, and I don't think the code is available.

9:14 kotarak: I mostly use (doc), anyway.

9:14 nibbs: sure but sometimes you want to overlook a whole package

9:15 kotarak: yes

9:22 Chousuke: there was some other place with documentation too

9:23 apparently generated from the docstrings etc.

9:23 it was posted on the google group some time ago, but I don't remember the details :/

9:25 kotarak: http://d2nbqsesuabw8o.cloudfront.net/tmp/doc-1116/index.html

9:25 Chousuke: right

9:26 kotarak: Hmm.... How does this main thing work again?

9:26 Chousuke: that's a bit outdated though :P

9:26 kotarak: I thought a namespace with a main function is turned into a class, which can be called from java.

9:27 java my.name.space

9:58 Chousuke: kotarak: yeah.

9:59 kotarak: yeah?

10:00 Chousuke: I think you just need to defn main

10:12 kotarak: But it complains about not finding the class.... (Yes. Everything is in the classpath. (ns .. (:gen-class)) (defn -main ...) works)

10:16 Chousuke: I'm looking at clojure.main and it only defns a "main" :/ I wonder what it does differently.

10:17 kotarak: no clue...

10:53 nibbs: anyone good with html? http://hpaste.org/13577 , why doesnt that generate the stylized page? must i have the complete path to front.css?

10:57 karmazilla: the body tag should be outside the head tag

10:58 and the meta, title and style should be inside head

10:58 scode: /na

10:58 Oops, soryr.

11:01 duck1123: does anyone know if clojure needs any special permissions for classloading?

11:02 Chouser: it uses its own dynamic classloader, which interferes with applet containters for example

11:03 nibbs: karmazilla: "and the meta, title and style should be inside head", how do you mean? there is no head-tag in the css-file, should i add one? or do you mean inside <!-- ?

11:03 duck1123: I'm getting a permission denied exception from Tomcat after switching OS's to Ubuntu

11:04 lisppaste doesn't seem to be working for me

11:04 Chousuke: nibbs: the tags

11:04 nibbs: meta, title and style are children of head

11:05 nibbs: Chousuke: ok but are they in the wrong document then? should they be in.html?

11:05 Chousuke: you have the tags in the css file?

11:06 a css file is not supposed to contain HYML tags.

11:06 HTML*

11:06 just the CSS

11:07 you don't even need <style> with a separate CSS file :)

11:08 nibbs: I dont know why title is in .css, doesnt make snese

11:09 http://hpaste.org/13577

11:09 those 2 are separate files

11:10 RSchulz: Your <body> element is inside your <head> element.

11:10 Body has to come _after_ head.

11:10 Chousuke: http://hpaste.org/13577#a1

11:11 I fixed it.. I think.

11:11 I'm not sure about the type attribute for link

11:11 but something at the back of my consciousness kept telling me link tags need one :P

11:12 RSchulz: I usually recommend using XHTML, unless it's just some one-off / throw-away kind of thing.

11:12 Chousuke: yeah

11:13 RSchulz: Someone recommended these, but I've yet to see if I think they're very good: http://reference.sitepoint.com/html http://reference.sitepoint.com/css

11:13 Chouser: there are people who know and understand html, xml, and http very well that recommend against xhtml.

11:14 RSchulz: According to http://reference.sitepoint.com/html/link you have your <link> element correct.

11:14 (Whether the href= attribut is correct depends on the layout on your server and how it's presented to the clients, of course.)

11:14 Really? Why?

11:14 Chousuke: Chouser: I think the problem with xhtml is that any error will halt page rendering.

11:14 so you can't have user-supplied html

11:15 RSchulz: That's pretty much browser-dependent, but who defends incorrect markup?

11:15 Chousuke: but I think it's still good to write xhtml; you can serve it as HTML.

11:15 RSchulz: no, the xhtml standard requires that you stop if there is an error.

11:15 RSchulz: many sites depend on user-supplied markup.

11:15 RSchulz: User-supplied content sounds like an invitation to mischief and XSS attacks...

11:16 Chousuke: I'd still write things like page templates in xhtml.

11:16 RSchulz: If there's anyone here who's attending the DC study group at 1:00 this afternoon, do you know if there's WiFi at that venue?

11:19 duck1123: It's usually a good idea to run any user-supplied markup through a sanitation algorithm anyway. Well-formedness checks can easily be part of it.

11:19 nibbs: hmm it works when just doubleclicking the front.html but it doesnt work when I do http/serve-file from compojure, any ideas?

11:20 StartsWithK: nibbs: compojure uses jetty?

11:20 if so, did you configure your mime types?

11:21 nibbs: isnt there some click-and-drag layout-program for html? i think it nis insane to do it statically...

11:22 StartsWithK: 1. yes 2. no. what are those and how do I do that?

11:22 duck1123: nibbs: There are, but part of the EULA, you have to give up your soul

11:22 nibbs: lol

11:23 duck1123: but if you're looking for a good XML editor, I used to love Oxygen

11:23 nibbs: i was hoping weebly would get more advanced but it seems to stay at noob-level(which i am but i need more advanced stuff)

11:23 duck1123: I haven't used it in a while as I'm now 100% emacs, but it has some nice layout features

11:24 StartsWithK: nibbs: http://is.gd/etUU you should add .html (just "html") extension for "text/html" in your server config

11:25 so when you serv static files with ResourceHandler wrap him in ContextHandler set your ContextPath ResourceBase and MimeTypes

11:27 duck1123: compojure should handle the setting of mimetypes for you

11:28 nibbs: yeah im not messing with contexthandler contextpath etc at all

11:29 StartsWithK: i'm looking at serve-file and yes, it dosn't use ResourceHandler for static files, it should :)

11:30 i guess when you should return then [{"Content-Type" "text/html"} (serv-file your-file)] then from your controller

11:30 (i don't use compojure just so you know, only jetty)

11:30 nibbs: ok

11:31 perhaps it is easier to use directly?

11:31 duck1123: I use compojure, but not with Jetty

11:31 nibbs: i dont have a controller

11:31 duck1123: and how do you do with this then?

11:32 StartsWithK: controller/servlet/view i don't know how compjure calls it

11:33 RSchulz: Is Compojure basedon on an MVC architecture?

11:33 duck1123: you need to create you own controller for your defservlet

11:33 RSchulz: it doesn't need to be, but it lends itself to that style easily

11:34 RSchulz: Where is it hosted?

11:34 The sources, that is.

11:34 duck1123: clojurebot: compojure?

11:34 clojurebot: compojure is http://github.com/weavejester/compojure/tree/master

11:34 RSchulz: Thanks.

11:35 duck1123: when it first started, it was a whole framework like rails, now it's just the library

11:35 RSchulz: Thank you, clojurebot

11:35 duck1123: clojurebot: botsnack

11:35 clojurebot: thanks; that was delicious. (nom nom nom)

11:35 RSchulz: It's _less_ than it once was??

11:35 Right, right. botsnak. I should have remembered that.

11:35 duck1123: less is sometimes more

11:35 RSchulz: Sure, but has it lost functionality??

11:35 StartsWithK: there is no sql/orm in compojure, was it there before?

11:36 duck1123: not really, you just have to make your own folders

11:36 but it means that you can do it however you want

11:36 nibbs: duck1123: what class is this controller thou speak of?

11:36 duck1123: I really recommend following the servlet api guidelines

11:37 nibbs: for instance, I have a net.mycyclopedia.controller that has just my defservlet and all the path locations

11:37 nibbs: yeah I noticed that before there was a lot of fodler socming with it, boot app etc. kind of prefer this, it doesnt obfuscate. just small and nice

11:38 duck1123: that's not entirely true, as I am now using gen-class to create a class for Tomcat to pick up

11:38 RSchulz: Lau_of_DK (not here at the moment) is working on an SQL access library for Clojure. Search for ClojureQL.

11:38 duck1123: clojurebot: clojureql?

11:38 clojurebot: clojureql is http://github.com/Lau-of-DK/clojureql/tree/master

11:38 StartsWithK: that will be cool when finished, its on github?

11:38 RSchulz: That bot is quite the know-it-all, isn't it??

11:39 duck1123: if it didn't know it, I was going to teach it

11:39 StartsWithK: can i just make one remark with clojurebot, it should respond with NOTICE like a good bot

11:39 RSchulz: hiredman: Clourebot recommendation above

11:40 StartsWithK: Is that an IRC protocol thing?

11:40 StartsWithK: yes

11:40 privmsg (normal text) is for humans, notice for bots, becouse you never respond to notice

11:40 so there in no chance that two boots get in an loop

11:41 bots*

11:41 RSchulz: I don't know, that could be fun to watch. ... For about 20 seconds.

11:42 duck1123: anyone here a wiz with java security and classloaders? http://gist.github.com/42897

11:43 I've been getting this error since I switched to ubuntu

11:47 scode: How do you throw/catch exceptions in clojure? I suddenly realized I don't think I've seen that yet and I am unable to find it in the API section. Googling yields some references to contrib libraries that do it. Is there an idiomatic way to do exceptions in Clojure?

11:47 RSchulz: (doc try)

11:47 clojurebot: excusez-moi

11:47 RSchulz: It's a special form.

11:48 It's documented here: http://clojure.org/special_forms

11:49 scode: Thanks!

11:50 (I didn't realize the API section didn't contain everything under the sun :)

11:50 RSchulz: It's generated by code from doc strings and special forms don't carry doc strings.

11:51 nibbs: the thing is I don't know much about html, css, MVC, webdev in general. so I don't really know what I need to do.

11:52 RSchulz: Perhaps the place to start is with some tutorial material on those foundation technologies, then?

11:52 There's tons out there, books, articles, tutorials, Web sites, etc.

11:52 StartsWithK: nibbs: http://www.w3schools.com/ for simple html/css tutorials, https://developer.mozilla.org/en/JavaScript#Documentation javascript

11:53 RSchulz: That's good content, though I don't really care for their presentation.

11:53 It could use the Tom Hickey touch...

11:54 StartsWithK: and, this may be strange, but to get startet with web dev, and if you know python look at http://www.cherrypy.org/

11:54 duck1123: There's always the official w3c specs' if you are a masochist

11:54 StartsWithK: i know its not clojure but on the first page is small working example that shows how easy is to use it

11:57 nibbs: i already have some woking webapps in webpy

11:57 StartsWithK: if you don't want to go in the trouble of learing css for layout, maybe framework like http://code.google.com/p/emastic/ or http://code.google.com/p/blueprintcss/ will help you with that

12:05 RSchulz: Blueprint has relocated: http://www.blueprintcss.org/

12:29 nibbs: in MVC-layout, would V be the actual html-pages?

12:29 and model the databse functions

12:30 and C the handlerfunctions that takes requests from V to M and back?

12:30 Chousuke: yeah.

12:35 nibbs: I should start using namespaces for my own files. i have my programs in C:/clojure/progs, should i add C:/clojure to the classpath then? then refer to them as progs.program ?

12:36 RSchulz: In the MVC for Web apps, the Views are often page templates such as JSP / ASP / GSP, etc., since static content is usually not an interesting part of responding to a request.

12:39 Chousuke: nibbs: yeah

12:42 RSchulz: And I'd say it's not quite right to think of requests coming from the View. It comes from the user.

12:42 In Web apps, the fact that the result of view rendering is HTML interpreted by a browser which is also the user's agent can lead to some confusion on this point.

13:19 dcnstrct: hi peoples. just thought I'd report that playing with Clojure + couchdb4j is a lot of fun

13:25 Lau_of_DK: Good evening everyone

13:26 Chousuke: evening

13:37 MarkVolkmann: What is the function that returns the name of the current default namespace?

13:41 gnuvince: *ns*?

13:41 MarkVolkmann: Ah, thanks! So it's a special variable and not a function.

13:42 gnuvince: Happy to help :)

13:43 If you want the name, (ns-name *ns*)

13:43 (doc ns-name)

13:43 clojurebot: Returns the name of the namespace, a symbol.; arglists ([ns])

13:55 fanda: hello all!

13:56 i found 2 little bugs

13:56 1) this Reference isn't updated according to the menu on the left:

13:56 http://clojure.org/Reference

13:57 nibbs: honestly, is Clojure on Android possible for real applications or will it be to slow or use to much memory?

13:57 fanda: 2) new files added in the last Clojure check-ins don't have Eclipse licence, but CPL

14:00 nibbs: http://hpaste.org/13579

14:00 gnuvince: nibbs: why would it be significantly slower than Java?

14:00 nibbs: cant I just force-push it?

14:00 gnuvince: runtime type-checking

14:02 gnuvince: nibbs: I don't imagine it would have that big of an impact

14:02 Puzzler: Good morning.

14:03 Hey, last night I worked on some code for contrib. I've already sent in a contributor agreement. What's the process for submitting code? Do I just post to to the clojure google group as an attachment?

14:06 nibbs: in html/page_functions: (defn include-css

14:07 does that sovle what we talked about before perhaps?

14:07 gnuvince: Puzzler: I think Rich would prefer you add the code to the Google Code page now

14:07 I seem to recall reading something like that

14:12 nibbs: how do I import several : (:require (compojure [html :as html])) into one?

14:13 (:require (compojure [html :as html http :as http])) etc

14:33 Lau_of_DK: Chousuke: Is your version of Clojurebot in action ?

14:34 Chousuke: Lau_of_DK: ask hiredman, he's the one running clojurebot

14:34 Lau_of_DK: Oh, I thought you usurped for some reason

14:35 Chousuke: I just thought it would be fun to play with it some and ended up making something that might be easier to work with than the earlies clojurebot.

14:35 earlier*

14:35 Lau_of_DK: k

14:41 Chousuke: I was supposed to poke it some more today, but instead I spent the whole day doing nothing.

14:41 which is a good way to spend a day, sometimes.

14:42 Lau_of_DK: Thats true

14:42 Wait...

14:42 Im uncertain of my answer, I'll have to think it over

14:45 Yes a day of rest is good, once a week :)

15:44 hiredman: clojurebot: latest?

15:44 clojurebot: latest is 1192

15:45 hiredman: hmmm

15:45 that is incorrect

15:45 duck1123: bad clojurebot

15:46 Chousuke: hiredman: is it v2? :/

15:46 hiredman: no

15:46 I guess I may as well do that now

15:48 Chousuke: backup the brain files :P

15:48 durka: braaaiiinnnsss

15:49 kotarak: feature request: check-completeness on \ef

15:58 hiredman: here goes

15:58 clojurebot: svn rev 1193; Added uniform metadata handling for atoms/refs/agents/vars/namespaces Note - breaking change for agent/ref when supplying validator - validator must be passed using :validator option Added :validator and :meta options to agent/ref/atom Added alter-meta! and reset-meta! for reference types renamed set-validator to set-validator! Validators now can simply return false, or throw Refactoring, added IMeta, IRefer

15:58 svn rev 1194; Added watcher support for agents/atoms/refs/vars Watchers must be agents (add-watcher reference :send/:send-off an-agent an-action)

15:58 svn rev 1195; fixed typo in add-watcher docs, explained var watchers

15:58 hiredman: clojurebot: how much do you know?

15:58 clojurebot: I know 115 things

16:00 hiredman: ,(System/getProperty "java.class.path")

16:00 hmmm

16:01 that will need fixing

16:01 Lau_of_DK: hiredman: Does it still fall for the ol' loop/recur trick ?

16:02 hiredman: it kills running code after 10 seconds

16:02 or it does when the evaluating is working

16:04 duck1123: hiredman: have you locked it down so that no one can execute scripts on your host?

16:05 I've always wondered if java could be locked down enough that it's somewhat ok to have an exposed repl

16:07 Chousuke: ,(+ 1 1)

16:07 clojurebot: 2

16:07 hiredman: hmmm

16:07 ,(println "foo")

16:07 clojurebot: foo

16:07 Chousuke: hiredman: System/getProperty is not allowed in a sandbox

16:07 hiredman: ,(System/getProperty "java.class.path")

16:07 clojurebot: java.security.AccessControlException: access denied (java.util.PropertyPermission java.class.path read) (NO_SOURCE_FILE:0)

16:07 Chousuke: right.

16:07 hiredman: yeah, but i was looking for that exception

16:07 Chousuke: what was wrong with it though

16:07 hiredman: I know what it is

16:08 I run it in a jvm with a very low memory ceiling

16:08 so it needs a few minutes after start up to clear things up, or starting new threads fails

16:08 Lau_of_DK: ,(loop [] (recur))

16:08 Chousuke: maybe the exceptions should be trimmed a bit

16:09 clojurebot: Execution Timed Out

16:09 Lau_of_DK: ,(println "still here")

16:09 clojurebot: still here

16:09 Lau_of_DK: Thats cool

16:12 Puzzler: how long does it take before it times out?

16:12 Chousuke: 10 seconds.

16:12 should make that configurable.

16:12 it is now, but it's a global variable instead of a value in the property map :/

16:18 kotarak: durka: Ok. Noted. :)

16:19 geez. a second too late.

16:33 fffej: is there an alternative syntax I've missed for creating structures? e.g. if I do (defstruct foo :a :b :c) do I have to do (struct foo 1 2 3) to initialize it or is there a short-hand I've missed?

16:34 Chousuke: are you sure you need a struct though?

16:34 you could just use a map. :)

16:34 but no, I'm not aware of any shorthand.

16:34 fffej: true - it's to represent a point in 3D space

16:34 pd: fffej: there's also (struct-map foo :a 1)

16:34 Chousuke: fffej: maybe a vector then?

16:34 fffej: pd: that also feels quite clunky, I was hoping for something like foo-create

16:35 i could use a vector, but i'm pretty sure i'm only going to need 3 dimensions :)

16:35 Chousuke: aren't structs just maps though?

16:36 pd: yes

16:36 kotarak: structs are maps with some optimisation for the keys

16:37 fffej: what would be the idiomatic way of representing a point in Clojure? Am I barking up the wrong tree with struct?

16:37 Chouser: There's a patch floating around to let you say (foo 1 2 3) instead of (struct foo 1 2 3), but rhickey has rejected it (at least temporarily) because I think he has bigger plans for struct maps.

16:37 Chousuke: fffej: perhaps a map is fine

16:37 fffej: it allows you to do (:x point) :)

16:38 fffej: chousuke: true, that's what i'm doing with the struct though

16:38 Chousuke: yeah, I guess it's fine for your use then.

16:38 fffej: chouser: bigger plans are good - Lisp's structs are richer (for example, couldn't find a way of including a struct within a struct)

16:38 Chousuke: fffej: you can write a macro to create the foo-create for you

16:38 Chouser: for a point, I'd use a struct-map or a vector.

16:39 Chousuke: or a function

16:39 fffej: chousuke: true, I was hoping that already existed in some corner of Clojure I hadn't visited yet - I'll stick with my (struct point 1 2 3) for now and see what the future brings

16:39 Chousuke: Chouser: that wouldn't def it though?

16:40 Chouser: fffej: you can nest any kind of collection inside any other collection, including structs in structs

16:40 fffej: chouser: what's the syntax for that?

16:40 Chousuke: fffej: (struct point 1 2 3) is as long as (create-point 1 2 3) anyway.

16:40 Chouser: Chousuke: sorry, you're right -- I misread what you were saying. You were another level meta than I. :-)

16:41 {:a 1 :b {:b1 :x :b2 :y} :c 3}

16:41 that's a map as a value of another map. you can also use maps (or anything else) as keys.

16:42 Chousuke: fffej: or (struct myvec (struct point 1 2 3) (struct point 3 2 1)) if you want all structs :P

16:42 fffej: chouser: but what about with a defstruct, like with lisp I'd do something like (defstruct (sphere (:include point) radius))

16:43 Chousuke: fffej: a struct is in clojure is a map that is guaranteed to contain some keys

16:43 the values are irrelevant.

16:44 fffej: I'm probably saying it badly - if I have a set of known keys in one struct, how do I put them in another without repeating the keys?

16:44 Chousuke: I don't think you can do that without some macros :/

16:46 fffej: chousuke: thanks :) I just wanted to make sure I wasn't missing anything, and it looks like I'm not

16:46 Chousuke: remember that you can add keys to a struct instance, just like any other map

16:46 or actually

16:46 that's wrong; since the result will be a different instance :P

16:49 fffej: i put the code in question at http://paste.lisp.org/display/73029, I'd appreciate any thoughts on how I could make it clearer. It's just a port of some ray tracing code from Ansi Common Lisp (next on the list is paralellizing it with pmap)

16:55 Chousuke: fffej: you could add a higher-order function "point-op" that takes an [op & points] and returns (struct point (apply op (map :x points)) (apply op (map :y points)) (apply op (map :z points)))

16:55 fffej: dunno what that does to speed, but it might make it clearer :)

16:56 fffej: chousuke: thanks, clearer is good. I was going to use pmap and map the ray-trace function between different width and height (e.g. divide it into 2x2 images and compute them at the same time.

16:59 Lau_of_DK: Has anyone fixed some type of pretty printing for clojure yet, or will I have to do it myself?

17:00 Chousuke: I think Chouser was working on it at some point.

17:01 Lau_of_DK: Good

17:01 Chouser: I need it soon, can you mail it to me?

17:01 Chousuke: :D

17:01 you phrased that wrong.

17:01 you should've said "pls mail me the codes"

17:03 Raynes: Rayne wants a Clojure eclipse plugin.

17:05 kotarak: Isn't it called clojure-dev?

17:06 Lau_of_DK: Raynes: Ever heard of Emacs?

17:06 Chouser: Lau_of_DK: on the google group.

17:06 Raynes: Lau_of_DK: Emacs doesn't cut it for JVM languages for me.

17:07 Lau_of_DK: Raynes: Then you havent configured it correctly

17:07 kotarak: I think clojure-dev is an Eclipse plugin. But I'm not sure about how far it is already.

17:08 Lau_of_DK: (which actually is the answer for everything where you find Emacs insufficient)

17:08 Raynes: Lau_of_DK: I configured it fine, I just don't care to use it for JVM languages.

17:08 Chousuke: Lau_of_DK: indeed

17:08 Lau_of_DK: my complaint about emacs was that it wasn't vim-like enough.

17:08 Lau_of_DK: solved with configuration

17:08 Raynes: I'd like to note that I use emacs for everything else.

17:08 Lau_of_DK: Chousuke: Yea, Emacs can among other thing, do everything

17:08 Chousuke: yeah

17:09 kotarak: good olde M-x butterfly.

17:09 Chousuke: it's a platform, kind of like the JVM

17:09 most people just think it's a bloated editor :/

17:09 Lau_of_DK: Yea, only more extensible

17:09 Chousuke: well yeah

17:09 Lau_of_DK: You can even have fly-make for most languages right there in good ol' emacs

17:09 Chousuke: and probably not as fast :P

17:09 kotarak: It lacks a decent editor, though. (<- the usual joke)

17:09 Lau_of_DK: (including java-script)

17:10 Chousuke: kotarak: nah, viper is decent.

17:10 kotarak: Lau_of_DK: what's fly-make?

17:10 Chousuke: incremental compilation?

17:10 Lau_of_DK: Its where everything you typed is compiled/executed and any errors will be displayed directly

17:11 kotarak: Ah. Like :make in vim.

17:11 Lau_of_DK: Possibly, but I wouldnt think so

17:17 Chousuke: kotarak: :make is not automatic though.

17:17 kotarak: nor is it as well integrated as flymake

17:18 integration with external programs is where vim fails, hard.

17:18 Lau_of_DK: nor does it support *.*

17:18 yea kota, big time

17:18 :))))

17:18 (just teasing)

17:18 Vim has one thing going for it and thats Gorilla, other than that its abandon-ware

17:19 Chousuke: even gorilla shows the fact that vim isn't designed to interface with external components :/

17:19 kotarak: Gorilla is terrible hack. As is the rest of Vim.

17:19 But Vim is a good hack. :)

17:19 Chousuke: the editor wars could be solved by implementing a proper vim in elisp

17:20 kotarak: Or even better: Vijure. :)

17:20 Chousuke: viper+vimpulse is okay, but some hardcore vim users will probably find it lacking.

17:20 it's good enough for me though.

17:21 kotarak: In Vim I know where to look when I have a problem.

17:21 For emacs I have to learn that again...

17:21 Big obstacle.

17:21 Chousuke: I guess

17:21 I never got that deep into vim

17:21 Lau_of_DK: I think getting started with Emacs, using Viper+vimpulse, is a bit like switching from your old Fiat to a brand new Mercedes, and insisting on moving your seats and steering wheel from the fiat to the Mercedes, but hey thats just me

17:22 kotarak: C-h t

17:22 Chousuke: Lau_of_DK: but the seats and the wheel are infinitely more comfortable.

17:22 Lau_of_DK: No theyre not, you just know them

17:22 Chousuke: no, really.

17:22 kotarak: It's more like going from a Fiat to a Renault....

17:22 Lau_of_DK: Hey kotarak, no need to bring the french into this

17:23 Anyway, I think this analogy talk got a little out of hand, sorry

17:23 Chousuke: I consider the vim modal interface superior to emacs' bag of shortcuts

17:23 kotarak: When I look at the SLIME threads, I think SLIME isn't less hacky than Gorilla... at least for CLojure.

17:23 Chousuke: because vim is actually learnable; something that emacs shortcuts lack.

17:23 er, no. not learnable: "discoverable"

17:24 Lau_of_DK: Chousuke: Ever tried C-h b ?

17:24 Chousuke: what does that do?

17:24 Lau_of_DK: Shows you all the short-cuts in a given mode

17:24 Pretty discoverable if you ask me

17:25 kotarak: I tried to turn on some sane highlighting in emacs. And it took me an afternoon before I gave up. The things in the help didn't work. But more likely I'm just too stupid to use emacs.

17:25 Chousuke: ah, but in vim you can apply previously learned and discover things without even looking at help

17:25 like I did with d% :)

17:27 I knew d, which is delete, and %, which means "matching paren/bracket/whatever" and d% does exactly what you'd expect.

17:27 kotarak: The basic idea of vi is simple: operator + motion.

17:27 Or range + command.

17:27 Chousuke: yeah

17:29 for me, viper is like the perfect compromis

17:29 e

17:30 I can do most things vim can do, and have access to emacs when needed :/

17:31 kotarak: I like the rendering of Vim more than Emacs. Don't know why I have this feeling. Just, somehow, nicer...

17:31 Chousuke: rendering?

17:31 kotarak: Display of font and stuff.

17:32 Chousuke: I use vim from a terminal. :/

17:32 kotarak: When I compare my MacVim with Aquamacs the Vim feels somehow smoother. I don't know. Really. Can't explain.

17:32 I used to, but not anymore.

17:32 Was too much pain of Windows.

17:32 Chousuke: macvim is a bit more maclike I guess.

17:32 kotarak: s/of/on

17:32 Probably. Has some nice integration.

17:33 Chousuke: aquamacs preferences still just does M-x customize :P

17:34 but any rendering problems are definitely solvable with it :)

17:34 I don't even know how many configuration variables emacs has, but I'd guess it goes past a thousand.

17:38 Lau_of_DK: kotarak: Try Emacs23, font rendering is VASTLY improved

17:46 chrisn: Hey Lau, are you willing to try out my demo again?

17:47 Raynes: I think Lau_of_DK is too addicted to Emacs. I suggest editor rehab :>

17:47 Lau_of_DK: chrisn: I absolutely am - But Im headed to bed now, if you have something specific you want me to try out can you send me an email with instructions? If its just git pull and run, then I can do it tomorrow and get back to you ?

17:47 chrisn: git pull, build, ./run_wave_demo

17:47 Lau_of_DK: <Raynes> I think Lau_of_DK <#Garbage not received> hab :>

17:47 ??

17:48 ./run_wave_demo

17:48 ./run_wave_demo: 5: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java: not found


17:48 chrisn: ah

17:48 Lau_of_DK: Ive got 2 minz, what do I need to modify ?

17:48 chrisn: I have to do that to get java 6 to work

17:49 on my mac

17:49 edit the script and just try java.

17:49 Lau_of_DK: k

17:49 chrisn: we will see how good opengl support you have on your computer

17:49 Lau_of_DK: oh man thats a nasty script

17:50 chrisn: I don't trust classpath

17:50 Lau_of_DK: hehe, I can tell

17:52 chrisn: Can we make a deal. For tomorrow you make a working jar file, then I'll pull, type java -jar lambi.jar, and thats it? :)

17:52 I cant reconstruct that entire script in 2 minutes here

17:52 chrisn: what didn't work?

17:53 ok, we can try that.

17:53 Lau_of_DK: Cool, sorry it didnt work, have a good night

17:53 chrisn: Do you have mydoggy window toolkit?

17:53 k lates.

17:53 Lau_of_DK: no

17:53 chrisn: k

17:54 Would it be a good idea to have a git repository that contains versions of clojure, clojure-swank, clojure-contrib, and slime that are all known to work with each other?

17:59 Chouser: the flow of new code and patches from the google group are becoming overwhelming as well.

18:49 dreish: Am I correct in saying that clojure.contrib.sql/transaction is a classic example of what not to do with macros?

18:51 kotarak: dreish: it's not a shiny example. It should be a function transaction* taking a function and a helper macro transaction which basically looks `(transaction* (fn [] ~@body))

18:51 dreish: My thought exactly.

18:51 chrisn: why the that design?

18:51 dreish: I'll freely admit I didn't understand this three days ago. And someone wrote this more than three days ago. :)

18:52 chrisn: why not just the macro?

18:52 kotarak: Because it's not necessary.

18:52 dreish: chrisn: As a macro that spits out 18 lines of code, every time you call it, you're rubberstamping the same 18 lines of code all of your program.

18:52 chrisn: ah I see

18:52 A lot of macros aren't necessary.

18:52 dreish: As a single function, the JVM can profile it, optimize it, and inline it where needed and where appropriate.

18:53 kotarak: the macro plus function macro* is a usual pattern

18:54 chrisn: then they should be written as functions.

18:54 chrisn: well, couldn't you say the same about with-open?

18:54 kotarak: This is mostly convenience, that you don't have to type (fn [] ...) all over the place, I guess.

18:54 chrisn: instead of a macro, it could take a function that takes one arguments.

18:55 argument

18:55 dreish: A lot of macros just do things like allowing the user to avoid having to write the (fn [] ...) themselves, which is nice. Only a handful really need to be very long, and they're using doing something very complicated.

18:55 kotarak: Where macros are really necessary are things like if, cond or or.

18:55 Whenever we have to control the evaluation.

18:55 chrisn: or when you need to call set! a million times because of the time of gridbagconstraints

18:55 dreish: Or for, or let destructuring ...

18:55 chrisn: then I wrote sets!

18:56 the design. Jesus I can't type today.

18:56 I see now.

18:56 karmazilla: fn is a macro :)

18:57 kotarak: it needs to control the evaluation of the argument vector.

18:59 chrisn: I got used to F# and ML where higher level functions and the ease of declaring new functions made a lot of macros unnecessary

18:59 clojure's #( syntax also makes a lot of macros unnecessary

19:00 (fn [ a b c] is a little wordy

19:00 dreish: chrisn: Sometimes it's nice to avoid the #(), though, because your caller might want a #() inside that, and #() doesn't nest.

19:01 chrisn: true. I found that out the old fasioned way

19:01 fashioned

19:01 I am done

19:01 Thanks!

19:01 hiredman: #() disapears at read time, doesn it?

19:01 kotarak: yep. It is translated into a (fn....)

19:02 dreish: ,'#()

19:02 Well, cjbot should be saying (fn* [] ())

19:02 hiredman: so, uh, what dreish said doesn't matter

19:03 ,(identity '#())

19:03 clojurebot: (fn* [] ())

19:03 dreish: hiredman: What, the part about how they don't nest?

19:04 hiredman: yeah, because by the time you macro is runing #() should all have been read and expanded?

19:04 your

19:04 dreish: hiredman: I was referring to chrisn's statement that macros are unnecessary because you can just require callers to pass you a lambda, which only costs an extra # keystroke.

19:05 That's fine except then you can't use other #()s within it.

19:05 hiredman: ok

19:05 as long as no one on the internet is being wrong

19:06 the non-nesting #() bites me all the time

19:06 dreish: Yo dawg, we heard you liked lambdas ... etc.

19:08 hiredman: clojurebot: haskell?

19:08 clojurebot: Yo dawg, I heard you like Haskell, so I put a lazy thunk inside a lazy thunk so you don't have to compute while you compute.

19:08 karmazilla: too much sugar will give you diabetes. so not trying to nest #() is better for your health

19:08 kotarak: clojurebot: #() is not a replacement for fn

19:08 clojurebot: Roger.

19:09 duck1123: karmazilla: thankfully, that's not an issue

19:09 hiredman: clojurebot's sandbox code is full of thunks and thunk passing

19:17 Chousuke: because it's a very convenient way to wrap stuff around code :)

19:51 chrisn: How do you guys setup your ant clojure compile task?

19:51 Do you use the CLASSPATH environment variable, or do you set it all manually?

19:52 Chouser: I just run 'ant' -- nothing in my CLASSPATH env var

19:53 chrisn: Then is your ant build.xml hardwired to for each target?

19:54 Chouser: oh, you're talking about building things other than clojure itself? yeah, I don't do that. :-)

19:54 chrisn: I guess it seems reduntant for me to specify both clojure in my CLASSPATH and also in my ant task

19:54 yep

20:01 you can do -Dclasspath=$CLASSPATH in your ant invocation and then use that variable inside ant

20:01 Then I have specified where clojure is only once

20:01 finally

20:03 :Chouser did you get your slime/clojure/swank setup worked out?

20:03 I want to update to the latest clojure and contrib but I am a little worried about it

20:16 Chouser: I don't use those either -- perhaps you mean to ask Chousuke (I know it's confusing -- he apologizes)

20:17 chrisn: I decided to risk it

20:17 Now my compilation steps just skip over the clj files

20:17 but not certain my build setup isn't messed up

20:20 it was my build setup

20:21 Would you happen to know a command from java that will use the system-specific command to open up a file?

20:21 On mac, for instance, you call open

20:21 I am not certain what you use on linux or windows.

20:23 pjb3: When using proxy to extend a class, how do you define a constructor?

20:24 Chouser: chrisn: I don't appear to be doing you much good -- I'm not even sure what you're talking about. Not 'slurp' I suppose?

20:24 chrisn: no, I mean in the editor appropriate for that file :)>

20:24 for instance, I have glslv and glslf files bound to the mac text editor

20:24 RSchulz: Yo, pjb3, you met my friend Bruce earlier today?

20:24 Chouser: pjb3: proxy returns a new instance, so there's no need or opportunity to provide a constructor

20:24 chrisn: from the command line, if I call "open wave.glslv" it opens them in my text editor

20:25 pjb3: RSchulz: I did!

20:25 Chouser: chrisn: ah! but you mean from within java not on the command line?

20:25 chrisn: yep

20:25 RSchulz: Cool.He's a great guy

20:25 chrisn: I just don't know java's system calls very well

20:25 pjb3: RSchulz: Yeah, I think we had a good time

20:25 chrisn: in C I would might try "system"

20:25 Chouser: chrisn: sorry, no I don't. :-/ I saw some code that opened a web browser though, if that helps at all...

20:26 RSchulz: Good. I think between his Java work and his long experience with Lisp, he'd be an asset in the community.

20:26 chrisn: that code is in contrib, correct?

20:26 for javadoc stuff, right?

20:26 Chouser: chrisn: http://paste.lisp.org/display/61362 perhaps in contrib as well

20:26 oh, no, that's not right

20:26 pjb3: Chouser: Oh I see, any initialization I would do in a ctor I could just do to the object after proxy returns it

20:27 Chouser: pjb3: sure

20:27 pjb3: Except for calling private methods

20:27 chrisn: :Chouser, what about classes that have to have constructor arguments?

20:27 this happens all the time in swing, for instance.

20:27 Chouser: proxy lets you pass values to the superclass' constructor

20:28 but I don't think anything in proxy lets you get to private members of the superclass

20:28 nor protected members, I think.

20:29 pjb3: Chouser: Ok, so hopefully I don't need to do that :)

20:30 Chouser: pjb3: right. though even in Java I don't think you can get to the private members of your superclass, can you? So protecteds are the only thing different.

20:31 pjb3: Chouser: yes, put you can define an anonymous class that extends some other class, with a ctor that accesses private things in there

20:31 if that makes an sense

20:31 Chouser: hm, ok. I know very little Java. Certainly none of this newfangled inline anonymous class stuff.

20:32 chrisn: well, I think I found the code I was looking for, to cause your native browser to open a particular page. ...but it's in elisp. :-P

20:32 chrisn: I am fine with that

20:33 Does it shell out, or is it an emacs-specific command

20:33 ?

20:33 Chouser: emacs-specific, I think. Toward the bottom of this page: http://bc.tech.coop/blog/081120.html

20:35 chrisn: He is using a swing html pane, it looks like to me.

20:35 Not general to any file

20:41 RSchulz: pjb3: bsseely_ is among us.

20:42 pjb3: bsseely_: Welcome!

20:42 bsseely_: hey!

20:42 Paul, right?

20:42 pjb3: bsseely_: Yup

20:42 I'm working on Keith's fahernheit/celsius program

20:42 bsseely_: cool, making progress?

20:43 pjb3: Yeah, learning about swing, I haven't really used it much

20:44 bsseely_: I've used it some

21:09 TDSmith: hi

21:11 I've been playing with clojure recently- there are some things I really like about it, but...

21:11 It seems like a moving target- a lot of the code snippets I'm finding online don't work with the newest version.

21:12 That's natural, with a new language, but I'm wondering if there are some examples that are kept in sync with the newest version?

21:12 Chousuke: "yes"

21:12 but if you ask me where, then I can't answer :/

21:12 TDSmith: I've never been very good at reading docs- I like code samples beter ;)

21:12 heh

21:12 OK ;)

21:13 Chousuke: the documentation is pretty... scattered.

21:13 the clojure book betas maybe?

21:13 arbscht: some code is typically updated quickly, such as compojure and swank-clojure

21:13 and there is clojure itself

21:13 TDSmith: Yeah, well- like I said, I understaznd why that is the case.

21:13 Chousuke: yeah.

21:13 though 1.0 shouldn't be too far away

21:14 things are already stabilising.

21:14 arbscht: by clojure, I mean clojure-contrib, too

21:14 TDSmith: Cool.. actually I really like what I've seen of it so far.

21:15 I'm generally more partial to Lisp-2s, but...

21:16 Clojure looks to me like it might turn into a lisp that would be a real alternatice to CL for real work.

21:16 RSchulz: What does a Lisp-2 really get you?

21:17 TDSmith: Hmm- I'm not saying that it's a better design, necessarily- just that I'm more comfortable with it.

21:18 bsseely_: Lisp-2 has been claimed to be better for macros

21:18 RSchulz: I think it's more important that symbols be separated from names of storage locations, as Clojure does it.

21:18 TDSmith: Well, it makes hygiene.. different a least...

21:19 RSchulz: Vive la differance!

21:19 TDSmith: Sure- I

21:19 'm not really craxcking on lisp-1s...

21:19 I'm just a lot more used to lisp-2s

21:20 Chousuke: I don't think clojure macros have hygiene problems.

21:20 TDSmith: I've never really been able to wrap my head arounf hygienic macros in scheme, though I'll admit that I haven't tried very hard.

21:21 Chousuke: I don't even know how they work

21:21 clojure macros look like CL macros, ` is just slightly different :)   

21:22 and as far as I can tell, it's harder to shoot yourself in the foot than with CL :/

21:22 bogolisk: Hi, I'm not trying to troll, I'm just curious about clojure (well I like functional language). What's the difference between lisp (CL) and clojure?

21:22 Chousuke: in what regard?

21:22 RSchulz: Isn't it the case that Clojure's syntax quote (backquote) namespace-qualifies the symbols it encountersj part of that?

21:22 TDSmith: Hmm- well I want to be careful in what I say because I have just recently started to look azat clojure but...

21:23 bogolisk: and what are the advantages of clojure over scheme?

21:23 Chousuke: bogolisk: how about access to a HUGE library of existing code.

21:23 TDSmith: it did seem to me that the macros work a bit differently than in CL because of the hygiene issue.

21:23 And at first glance I think that, all other things being equal I preferred the CL syntax, but...

21:23 bogolisk: Chousuke: oh, so the main difference is the interaction with java libraries?

21:24 Chousuke: that's just a bonus.

21:24 TDSmith: that's as very small nit to pick.

21:24 RSchulz: Well... What would you have to do in a Clojure macro to capture a symbol from the environment in which it is appplied?

21:24 That's the question, right?

21:24 Chousuke: RSchulz: you have to do ~' I think

21:25 it's pretty difficult to accidentally capture symbols :/

21:25 RSchulz: Yes, but that would work only for a symbol given as an argument.

21:25 Chousuke: '~foo too.

21:25 RSchulz: Presumably the user of the macro wants that connection, so it's not really "capture," is it?

21:25 Chousuke: well it's capture, but intentional

21:25 unintentional capture is the evil thing.

21:26 RSchulz: Presumably.

21:26 Chousuke: I can't think of a situation where that happens :/

21:26 RSchulz: If you just inadvertently use a symbol in a Clojure macro expansion, it will be qualified to the namespace of the _macro_, not that of its invocation.

21:26 ... Of the macro _definition_, that is.

21:27 But CL macros do nothing to protect you from inadvertant capture. That's the whole "hygiene" problem, right?

21:27 chrisn: :bogolisk I am not sure this answers your question, but I am using clojure because it (and F#) are the only really interesting languages I might be able to use on a daily basis.

21:28 I guess I am just a little burnt on java, c, c++, and c#.

21:28 Chousuke: RSchulz: I'm not sure.

21:28 chrisn: I don't feel I could use scheme at work

21:28 bogolisk: I'm still trying to see where it's different from other Lispies

21:28 chrisn: ah

21:28 different question

21:28 Chousuke: RSchulz: I don't see why a Lisp-2 is any better from a hygiene perspective than a lisp-1

21:28 RSchulz: Chousuke: That's my understanding.

21:28 No, that's a separate issue, I think.

21:28 chrisn: And there are uses for un-hygienic macros

21:29 People always freak out about hygene. There is always gensym

21:29 it just isn't a huge deal...

21:29 Chousuke: what's the point in lisp-2 anyway? /:

21:29 RSchulz: The fact that every symbol, no matter how it enters your program, is a potential locus of a binding is a stark contrast with Clojure, at leatst.

21:29 Chousuke: someone educate me. I'm ignorant.

21:30 TDSmith: Hmm- but I think that clojure's macros are different from CL's precisely because of that difference- so it must be significant to some degree, mustn't it?

21:30 RSchulz: bsseely_: Help us out here. You're experienced with Lisp-2s.

21:30 Chousuke: TDSmith: it's rather significant, yeah.

21:30 chrisn: Yeah, some people really hate unhygienic macros. I personally think they are sometimes pretty cool.

21:30 TDSmith: I have to admit that I like the Lisp-1 syntax for function invocation.

21:30 Chousuke: TDSmith: clojure's macros are every bit as powerful as CL's, but you're less likely to accidentally make a badly behaving macro.

21:31 TDSmith: Yeah, I wasn't suggesting they were less powerful.

21:31 bsseely_: sorry, I haven't been following the thread...

21:31 chrisn: :Chousuke I am not certain that is true

21:31 finding my example of crazy non-hygienic macro now

21:32 RSchulz: We're trying to untangle the Lisp-1 / Lisp-2 and hygienic / unhygienic macros...

21:32 Chousuke: macros in clojure don't have to be hygienic, do they?

21:32 TDSmith: Though I have to admit that being equivalent in power seem like a rather low bar to set- not that I'm suggesting that clojure doesn't clear highher bars than that, of course,

21:32 Chousuke: you can capture and introduce all the names you want, it's just not easy to do accidentally.

21:32 TDSmith: I used to think that syntax wqasn't very important...

21:32 RSchulz: Chousuke: It's pretty hard to unintentionally capture a variable from the invocation environment, isn't it? (In Clojure).

21:33 Chousuke: yeah

21:33 it's not too difficult to intentionally do it htough.

21:33 chrisn: how do you capture intentionally?

21:33 TDSmith: Anyway I'm not setting out to criticize Clojure's macros here...

21:33 RSchulz: Is there more to the "hygiene" issue than that? (Inadvertent variable capture, i.e.)

21:33 Chousuke: I think you need to use ~'varnametocapture

21:34 TDSmith: I don't know enough about Clojure to be able to do that.

21:35 I did just note some cases where the macro facility does seem constrained by the fact that it's a lisp-1.

21:35 dreish: Can you give an example?

21:35 RSchulz: Actually, I don't think the Lisp-1 / Lisp-2 issues really intersects with the hygienic macros issue. Does it?

21:36 TDSmith: Hmm- well I think I can find a post by Rich Hickey top a mailing list explaining that that's the case...

21:36 Chousuke: something like `(let [~'varname 1] stuff) will expand to (let [varname 1] stuff) that would capture a name.

21:36 TDSmith: You do have to be a bit more careful about capture in a lisp-1.

21:36 RSchulz: Is syntax-unquote an inverse of plain quote?

21:36 Chousuke: just `(let [varname 1]) becomes (clojure.core/let [user/varname 1]) which is an error

21:37 so you can't really accidentally capture things.

21:37 chrisn: ah. That error made me think it was impossible

21:37 Paul Graham's On Lisp, chapter 14 talks about anaphoric macros

21:37 dreish: TDSmith: How do you have to be careful about capture in Clojure? It seems to me you have to go out of your way to _get_ variable capture.

21:37 chrisn: Those rely on capture to work.

21:37 TDSmith: Exactly ;)

21:37 Chousuke: chrisn: anaphoric?

21:38 RSchulz: "Backward referencing."

21:38 Chousuke: can you show a small example and I'll try to make a clojure version of it.

21:38 chrisn: thanks, I would have had to look it up

21:38 TDSmith: Capture is sometimes useful.

21:38 chrisn: On Lisp is free

21:38 download the pdf, check out chapter 14.

21:38 Chousuke: yeah, but I don't want to search it right now :D

21:38 dreish: TDSmith: Useful enough you'd be willing to type ~' where needed?

21:38 chrisn: ok, hold on

21:38 TDSmith: Probably ;)

21:39 dreish: Well, there you go. Problem solved.

21:39 TDSmith: Anyway I didn't claim that it was an issue of great importance...

21:40 Chousuke: anyway, there's more to clojure than the novel syntax-quote

21:40 dreish: I think it is pretty important, if you think macros are a good thing. I think Clojure has an excellent solution to the problem.

21:40 Chousuke: the idea that lists are not the core of lisp is something that should not be forgotten :)

21:40 RSchulz: Macros? Are they still around?

21:40 TDSmith: Are macros still around?

21:40 chrisn: in his example you need to be able to refer to a variable in the macro from code the macro is expanding

21:41 TDSmith: Is that the question?

21:41 RSchulz: chrisn: Then that variable should be an argument to the macro invocation.

21:41 Chousuke: chrisn: that is possible.

21:41 chrisn: no, it is a specially named variable

21:41 TDSmith: I'm fairly sure that even when I don't write macros I do reference a few occasionally ;)

21:41 Chousuke: chrisn: the proxy macro I think binds "this" to be used in the proxy code.

21:41 TDSmith: but maybe I misunderstood you there.

21:42 chrisn: Ah!

21:42 you are right

21:42 that would do it

21:43 http://paste.lisp.org/display/73035

21:44 I love lisp :).

21:45 dreish: if-let is similar, but you pick the name.

21:45 RSchulz: (doc aif)

21:45 Chousuke: (defmacro aif [condition & body] `(let [~'it condition] ~@body))

21:45 oops

21:45 ~condition

21:46 and, er.

21:46 dreish: Need an if in there somewhere.

21:46 Chousuke: add (if ~'it

21:46 RSchulz: Wait... Is (aif ...) in Clojure?

21:46 dreish: RSchulz: I don't see it. Closest thing is if-let.

21:46 chrisn: so the ~' is the magic

21:47 dreish: (defmacro aif [condition & body] `(if-let [~'it ~condition] ~@body) ; Maybe that would work.

21:47 RSchulz: chrisn: I think you should paste only things that are self-contained, given Clojure core (and, possibly, Cloure Contrib)'

21:47 Chousuke: chrisn: (aif 2 it) -> 2 :)

21:47 RSchulz: Otherwise, it's not possible to interpret them.

21:47 Chousuke: in my repl here :P

21:47 let's see

21:48 RSchulz: clojurebot: You there?

21:48 dreish: I think mine works too.

21:48 RSchulz: Clojurebot is off-line!

21:48 Chousuke: oh boo.

21:48 chrisn: RShulz: that was an example from On Lisp, I didn't think it was possible on clojure

21:48 RSchulz: So is hiredman.

21:48 We're alone...

21:48 Define "possible!"

21:48 Chousuke: I wanted to demonstrate that macro with clojurebot

21:49 RSchulz: (Turing completeness and all...)

21:49 Chousuke: because I know magics to define macros with clojurebot!

21:49 chrisn: well, literally. I couldn't figure out how to capture a variable without an error

21:49 Chousuke: chrisn: that is a good thing :)

21:49 chrisn: it means it's not likely to happen by accident

21:50 chrisn: Oh, I never did it by accident before ;). I always mean it when I confuse people

21:50 RSchulz: Great. Just what we need. The "Obfucated Clojure" contest!

21:50 As if it's not hard enough to decipher without the attempt to obfuscate...

21:50 Chousuke: anyway (defmacro aif [condition & body] `(let [~'it ~condition] (if ~'it ~@body))) works

21:51 TDSmith: meh..

21:51 anyway I wasn't suggesting that a lisp-1 or a lisp-2 was absolutely better.

21:52 RSchulz: Each are absolutely better than the other.

21:52 dreish: TDSmith: You're a rare person, then.

21:52 Chousuke: Right. I don't care about that for now: what does being a lisp-2 get you?

21:52 RSchulz: And the universe shall collapse upon itself.

21:52 Chousuke: except having to use funcall to call functions.

21:52 TDSmith: well- I suppose that that is equivalent to what I said...

21:53 RSchulz: Chousuke: _That_ is the question. What's the virtue of a Lisp-2?

21:53 TDSmith: Yeah.. actually my first lisp was scheme (though many people don't accept that as a lisp)...

21:53 dreish: Chouser: I think the biggest advantage is that it's familiar for people who are familiar with Lisp-2.

21:53 Chousuke: and being able to have functions and variables with the same names. Which I don't consider a good thing.

21:53 TDSmith: I remember thinking funcall wazs just terrible...

21:54 But that was a long time ago ;)

21:54 RSchulz: All you need is "apply" and "eval"!

21:54 (Or so some book cover told me.)

21:54 TDSmith: Hmm...

21:54 all you need is lambda

21:54 dreish: I thought you didn't need eval? You can write it in terms of the seven primitives.

21:54 RSchulz: Defining a thing is not all there is!

21:55 It's better to replace one thing with seven? Occam is turning over in his grave!

21:55 TDSmith: Let him ;)

21:55 dreish: Even with eval, you'll still need the other seven, so I think that's eight.

21:56 Chousuke: you can write everything with lambda alone I guess

21:56 but that's going to be horrible.

21:56 TDSmith: The onluy way to evaluate whetehr or not it is better to replace one thing with seven is to try it.

21:56 Chousuke: particularly if you want to do arithmetic :D

21:56 dreish: Like a Turing machine? Numbers are represented by how many levels of lambda nesting you return?

21:56 chrisn: http://groups.google.com/group/clojure/browse_thread/thread/27912d9dcaec2f24

21:57 If I had seen this, I never would have talked about anaphorisms

21:57 TDSmith: Exactly- Lisp actually comes from that idea.

21:57 karmazilla: functions that implement methods for a gen-class... how do I get at the "this" reference?

21:57 TDSmith: But of course...

21:57 Chousuke: ah, that's the thread where I wrote about macros

21:57 I should re-read what I wrote to refresh my memory :/

21:57 Chouser: karmazilla: first arg of each method defn

21:58 karmazilla: roger

21:58 RSchulz: Chousuke: You're Jarkko?

21:58 TDSmith: Anyway that's another good reason to ignore arguments about equivalent power...

21:58 chrisn: Chousuke does sound like Jarkko Oranen

21:58 ...

21:59 Chousuke: RSchulz: yeah.

21:59 RSchulz: Well, then... Make up your mind...

21:59 TDSmith: Alonzo Church came up with a formalism that is equivalent to.. well, lots of things... well before there were actually computers.

22:00 Chousuke: anyway

22:00 I should be sleeping.

22:00 RSchulz: Yeah, well that equivlance is not a reason for us to write in assembly or some other very-low-level language.

22:00 TDSmith: I agree ;)

22:01 Syntax matters.

22:01 RSchulz: I have a hard enough time expressing myself in first-order-logic, which I have to do in my theorem-proving work.

22:01 chrisn: I am not sure syntax does, but ease of abstraction *definitely* does

22:01 Chousuke: rather than that, the SICP gurus would say that the tools of abstraction matter

22:01 RSchulz: I consider FOL the assembly of declarative languages.

22:01 TDSmith: well- like I said- when I was young I thought syntax was unimportant.. but...

22:01 Chousuke: ASM has rather crappy tools for abstraction

22:01 ... why did I make that an acrony,

22:01 anyway.

22:02 RSchulz: Sweet dreams!

22:02 TDSmith: ASM has beautiful tools for abstraction...

22:02 the best..

22:02 Chousuke: yeah. good night. or morning.

22:02 RSchulz: All of which exist in your mind...

22:02 TDSmith: it has lousy tools for defining syntax.

22:02 RSchulz: Well, Chousuke may need sleep, but I need dinner.

22:02 chrisn: If you love asm's abstraction systems, check out Factor

22:02 RSchulz: See ya' all later.

22:03 chrisn: It really does have good abstraction systems; but you are still manipulating the stack so you do a lot of nip dip slip etc.

22:03 Chousuke: TDSmith: defining syntax is just a tool for abstraction :)

22:04 TDSmith: Sure...

22:04 It's _all_ equivalent, after all...

22:05 \]If you're smart enough you don't need abstraction.

22:05 Unfortunately people are never smart enough to be able to do without it ;)

22:05 chrisn: that is an odd stance.

22:05 TDSmith: Really?

22:05 chrisn: learning works by forming abstractions

22:06 The ease of creating new abstractions tends to be a limiting factor in learning any non-trivial system

22:06 TDSmith: Hmm- well I'm talking about computation, not learning...

22:06 chrisn: I know. The thing is, you mind can only handle a fixed number of things at once.

22:06 period

22:07 Chousuke: TDSmith: I mean syntactic abstraction is just another form of abstraction.

22:07 chrisn: And it isn't that high for anyone.

22:07 Chousuke: and the number of different abstraction tools and how "easy" they are to use determines the power of a language.

22:07 chrisn: That is the religion that I subscribe to, yes

22:08 Not sure I could prove it in any substantial way

22:08 Chousuke: the lisp macro system is an amazingly powerful syntactic abstraction system.

22:08 but not the only one

22:08 there's the C preprocessor, for once.

22:08 -e

22:08 er

22:08 -c

22:08 or C++ templates.

22:08 chrisn: Well, any compiler is a syntactic abstraction system

22:08 a macro is just an extension of a compiler.

22:09 Chousuke: well, yeah, their "lisp" is just an implementation detail :/

22:09 chrisn: bingo

22:10 Chousuke: I like to think that all compilers have a lisp at the core because code represented as a data structure is a kind of a lisp

22:10 TDSmith: right- your mind can only handle a limited number of things...

22:10 that's what I'm saying...

22:10 abstractions address insufficiencies in human cognition.

22:11 chrisn: hmm. That is one way to look at it

22:11 More likely they define human cognition

22:11 clojurebot online?

22:11 hiredman: power outage

22:11 TDSmith: At any rate... the argument that things are of "equivalent powere" is ...

22:12 *power

22:12 I mean writing code into adress space one byte at a time is just as powerful... trivially.

22:12 hiredman: nope, the server it runs on is still offline

22:13 chrisn: yep. And now I see why you said "if you were smart enough..."

22:13 TDSmith: Exactly- I didn't mean you specifically...

22:13 chrisn: The other limiting factor is how much can one person type

22:13 TDSmith: Hmm...

22:13 chrisn: I know (and I knew then, too :) )

22:14 TDSmith: I think if you were smart enough that would cease to be a limiting factor....

22:14 chrisn: Because you would write LISP in assembly.

22:14 And then just program in lisp

22:15 TDSmith: No- because you would write software that wrote your software for you, and retire to a beach in the caribbean.

22:16 chrisn: Hmm, if you goal is to live your life on a beach you can do that now, but I see what you mean.

22:16 TDSmith: well that's a hard phiosophical question... what should we do if we eventually make things that are much higher achievers than we are?

22:17 But the point I am making is actually abiut syntax...

22:17 chrisn: Well, I personally believe that most of the first world has everything materially a human could ever need and they would be better off working on themselves as individuals than producing more shit.

22:17 but back to syntax...

22:18 TDSmith: Hmm- I have a diferent belief- I believe that human wants are unlimited.

22:18 but back to syntax...

22:18 chrisn: you can only eat so much.

22:18 TDSmith: Sure.. but my wants are not limited to food.

22:18 hiredman: I am an endless gaping maw of desire

22:18 *shrug*

22:18 TDSmith: exactly.. me too

22:18 chrisn: Well, I bet a lot of your wants are driven by your ego. Address that and you would not want much.

22:19 Mine are almost entirely driven by mine...

22:19 hiredman: so, speaking of clojure

22:19 TDSmith: Hmm- I understand that idea under current circumstances...

22:19 hiredman: I was thinking, I hate writing php

22:20 TDSmith: Anyway, the point is that good notation matters.

22:20 chrisn: yep, so hiredman, how do you launch a process that can open a file using the program registered with the system in a cross platform manner?

22:20 hiredman: so I should write a register machine in php, then write a compiler in clojure (that compiles some kind of lisp) and targets the register machine

22:20 chrisn: why are you dealing with php?

22:20 hiredman: website I have responsibility for, and webhost I have no control over

22:21 chrisn: they don't use java on the web host?

22:21 no tomcat or anything like that?

22:21 TDSmith: meh- I have written some php for money. Evil language, IMHO.

22:21 hiredman: uh, I doubt it

22:21 they still only run php4

22:21 chrisn: where are you?

22:22 TDSmith: that is what I wrote in- wass a few years ago.

22:22 hiredman: in 2003 apparently

22:22 chrisn: in some technology time vortex?

22:22 heh

22:22 TDSmith: the most confused reference semantics I have ever seen...

22:22 chrisn: no kidding

22:22 hiredman: I found this tool that dumps ast for php in some xml form

22:22 chrisn: can it convert back?

22:23 hiredman: but for a 13 character php file, the AST is over 3000 characters

22:23 chrisn: it claims too

22:23 chrisn: did you 13 character php file include another 3000 character php file?

22:23 hiredman: no

22:24 it was something like <?php $x; ?>

22:24 the simplest I could think of

22:24 chrisn: How fast do the 3000 characters grow?

22:24 Did you try a range of files, or just one?

22:24 hiredman: just the one

22:24 chrisn: It could always output the same header or something

22:25 hiredman: that is very possible

22:25 I could not get the tool to go the other way, xml -> php

22:25 chrisn: oh hm.

22:25 hiredman: it claimed to have been built without xml support, but had no problem dumping xml

22:25 anyway

22:27 chrisn: My buddy wrote a template processor for clojure

22:27 hiredman: I started working on something that just generates php code directly, all of which is really a waste, I should just do the leg work to get the site moved to a different host

22:27 chrisn: You could write a php code generator

22:28 Best solution by far

22:28 hiredman: yeah, it reads a file full of (defn foo [] bar) and outputs a bunch of function foo () { bar; }

22:29 chrisn: using the clojure reader?

22:29 hiredman: yes

22:30 chrisn: Feel like running a demo I wrote?

22:30 Its opengl

22:30 and shaders

22:30 and you can edit the shaders

22:31 hiredman: actually, I don't have a working jvm on this machine

22:31 chrisn: good god man

22:31 hiredman: it was on a harddrive that died

22:32 and I have not replaced it

22:32 TDSmith: hmm- yeah.. generating php code is tricky because it is not very structured

22:32 hiredman: Yes

22:32 I cheat, I have a (literal "") that just dumps a literal string into the php code output

22:33 TDSmith: yeah.. well it's one of those things you can do if you're "smart enough" ;)

22:34 chrisn: lol

22:35 hiredman: ugh, figuring out when to put a semicolon

22:37 TDSmith: syntax matters.

22:39 If for no other reason... if you _have_ to generate lisp as a string for some reason, at least it's regular.

22:39 hiredman: well lisp is basically an ast

22:40 TDSmith: I always like to tell people that it's "pre-parsed".. basically the same idea.

22:40 hiredman: when they invented lisp, the plan was to add syntax later, but they wanted to starting writing code in it asap

22:40 no time for syntax

22:41 TDSmith: And it turned out good ;)

22:41 But I have to say that things like Lisp 1.5 don't look attractive to me.

22:42 hiredman: http://en.wikipedia.org/wiki/M-expression

22:42 TDSmith: But that's what great about Lisp... it evolves.

22:42 Yep, I am familiar with that idea

22:42 hiredman: interesting the use of square brackets

22:42 TDSmith: Actually Lisp was more of an accident than that...

22:42 hiredman: almost like that hot new language all the buzz is about

22:43 TDSmith: I don't think McCarthy ever meant that his formalism ought to be implemented.

22:44 Anyway- Ivory soap was an accident too...

22:44 and it floats ;)

22:46 But it is certainly a lot easier to work with lisp that with other languages because it is "pre-parsed"

22:47 Seems o striker the write balance between "If you were smart enough" and "You can't possibly be that dumb"

22:47 chrisn: I would think lisp-php would be a lot easier than php-lisp

22:47 TDSmith: Hmm- yes.

22:48 But both are impossible beyond a small subset.

22:48 chrisn: impossible?

22:48 that seems rather strong

22:48 TDSmith: Err- unless you're smart enough ;)

22:48 I mean practically.

22:49 chrisn: I would say, if you could write an irc bot that dynamically compiles clojure and returns the result.

22:49 You might just be able to write lisp-php

22:49 hiredman: uh

22:50 it just, you know, (eval (read))

22:50 TDSmith: hmm... what?

22:50 hiredman: the difficulty is in the sandboxing

22:51 man, I really wish clojurebot was back up

22:51 TDSmith: The problem with this is that read is not likely to like PHP...

22:51 You can't write a meta-circular evaluator for PHP in LISP, generally...

22:51 chrisn: but php does have eval

22:51 hiredman: TDSmith: oh no, Iwas talking about the irc bot

22:52 TDSmith: ah. I see..

22:52 sorry ;)

22:52 chrisn: why not write a lisp interpreter in php?

22:52 * hiredman watches ssh timeout over and over again

22:53 TDSmith: PHP's eval is basicsally crippled because...

22:53 hiredman: chrisn: that is not a bad idea

22:53 TDSmith: Err- why would you?

22:54 anyway php is just strings.

22:54 but it ios not evn copnsistrently just strings...\

22:54 err- spelling

22:55 hiredman: it would be easier

22:55 TDSmith: ?

22:55 hiredman: a lisp interpreter in php

22:55 so you just feed it lisp

22:55 TDSmith: hmm...

22:56 That's a terrible idea.

22:56 hiredman: I bet it would be far easier then generating php

22:56 TDSmith: I'm sure it would ;)

22:56 hiredman: (says the guy who was writing a php generator at 3am last night)

22:57 TDSmith: Hmm-

22:57 chrisn: at least you were using your time productively...

22:57 TDSmith: you do see that macros are just a means of writing lisp generators, right?

22:59 This gets obscured by backquote notation in CL, but...

23:00 The point is tht you can deal with the language on the level of symbols when generating shit...

23:00 PHP is just no homoiconic enough to get a marriage license.

23:01 hiredman: as of right now http://gist.github.com/43001 goes into the compiler and http://gist.github.com/43002 comes out

23:02 which is not exactly valid php

23:02 there is at least one missing semi-colon

23:03 TDSmith: hmm- doesn't look like PHP to me ;)

23:03 hiredman: well, should be run through a pretty printer or something

23:03 TDSmith: meh...

23:03 ericlavigne: Why do you want to create PHP code?

23:04 chrisn: hiredman: you should use a template language to specify the pieces of php

23:04 TDSmith: the problem is that you are embedding so much information into these ugly unstructured srtings.

23:04 But I understnad...

23:04 chrisn: So that you can just do essentially lambda replacement. It would be a ton easier.

23:04 TDSmith: the answer is likely- I have to interface to PHP...

23:05 hiredman: chrisn: interesting

23:05 danlarkin: TDSmith: use some sort of RPC (rest, soap, xml-rpc) ... don't generate code, it will be the biggest headache ever

23:05 TDSmith: hrrm- what?

23:06 hiredman: right now, I have a list of forms like (if ) where there is a specific function that knows how to translate that form in to php

23:06 TDSmith: Yes, that is my point....

23:06 it is unfortunate that you have to do that, but...

23:06 chrisn: right. I might read in a file that looked like "if ( $condition ) { $stuff }"

23:07 hiredman: the actual translator is a multimethod that dispatchs on first

23:07 TDSmith: basically lisp falls down in that case, to some dewgree...

23:07 chrisn: That part wouldn't change.

23:07 Chouser: did you look at clojurescript at all?

23:07 chrisn: This would just help you get the semicolons right

23:07 hiredman: Chouser: nope

23:07 TDSmith: the big wingwith lisp is being able to deal with code in a level that is not azbout characters and strings.

23:07 chrisn: Actually, not sure it helps a ton coming from lisp.

23:08 Chouser: hiredman: translates clojure to javascript. might be informative to you. ...or possibly not. :-)

23:08 chrisn: I generated a ton of c++ code once using python

23:08 the code templates were key

23:08 hiredman: TDSmith: well, I deal with the lisp code as a data structure, and feed it through some funtions, which output strings

23:09 chrisn: I think an interpreter is the simplest way to go.

23:09 hiredman: maybe

23:09 chrisn: Full translation to php is really going to hurt.

23:10 hiredman: really, the simplest thing, is just to figure out how to get away from this horrible webhost

23:10 but that has nothing to do with clojure

23:11 and is not something I can do at 3am

23:11 ericlavigne: this is all about a webhost? no need for PHP libraries?

23:12 hiredman: the webhost of a website I made the mistake of volunteering to look after only offers php4

23:12 ericlavigne: VPS rental is not so expensive as the time spent creating a PHP generator :-(

23:13 hiredman: :P

23:13 I have a webserver, I could move it to, I would not even need to rent a VPS

23:14 ericlavigne: oh, but you have existing code for the site in PHP?

23:14 hiredman: wow, there are two clojure groups on facebook

23:14 yessir

23:14 * ericlavigne goes to find the facebook clojure groups and join

23:16 danlarkin: ditto!

23:19 ericlavigne: A search for Clojure also turned up the LispNYC facebook group.

23:21 hiredman: yeah

23:27 TDSmith: why do you have this horrible webhost?

23:28 linode is like $30.00 a month and you can run what you want.

23:28 hiredman: it is somebody else's fault

23:28 TDSmith: wwwww

23:28 ;)

23:29 ericlavigne: perhaps follow the RPC suggestion given earlier, with the Lisp part running on your own server

23:30 hiredman: heh

23:30 that would be cute

23:36 Nafai: I pay $19.95 formy Linode

23:37 384 MB of RAM, 12 GIG of storage, 100 GIG (or maybe it's 200) of transfer

23:37 danlarkin: Nafai: that's not a bad deal

23:38 Nafai: Yeah, pretty nice

23:38 I'm IRCing from it right now

23:40 hiredman: I know a guy who does IT for a fish processing plant, he has a freebsd box shoved in the corner somewhere for me

23:42 $0 a month

23:42 except sometimes the power goes out and clojurebot vanishes

23:43 chrisn: Nafai: - do you have a terminal based irc client

23:44 Nafai: chrisn: Yeah, I'm using irssi + screen. But I have also used bip and an ssh tunnel to connect to it from a graphical client from my desktop

23:45 http://www.travishartwell.net/blog/2006/04/20_1810

23:46 chrisn: that is a damn sophisticated chat setup.

23:47 Nafai: Been working well for me for almost 3 years now

23:48 chrisn: Essentially you run a proxy connected 100% of the time and then you access the proxy from wherever you want?

23:49 Nafai: Yup

23:49 And since I use an ssh tunnel to access it, it's protected

23:49 And I can be connected from multiple places

23:49 at the same time

23:49 * hiredman just uses screen and irssi

23:50 chrisn: So when you want to spend time in multiple places at the same time, you can be connected from every one of them?

23:51 Nafai: Heh. Yes.

23:52 chrisn: Do you think you will be able to use clojure professionally?

23:53 Nafai: Me? Not in the near future.

23:53 chrisn: I hope that I can either use clojure or F# some time soon.

23:54 Nafai: What do you do currently?

23:54 chrisn: I am a senior dev tech for NVIDIA

23:55 Nafai: Cool

23:55 chrisn: I run a team of developers doing projects to help NVIDIA hit niche markets.

23:55 hiredman: Oh, REALLY

23:55 chrisn: I have been trying to push for a more functional language for CUDA with no success.

23:55 yep

23:56 hiredman: interesting

23:56 danlarkin: patch the JVM to use the GPU :)

23:56 chrisn: You can right now

23:56 Nafai: I think functional programming would fit well with that

23:56 chrisn: jogl has glsl support

23:56 It will partially

23:57 I wrote a small demo in clojure where you can edit the glsl files and watch the graphics change.

23:57 Nafai: Cool

23:57 danlarkin: Ooo

23:57 that's neat

23:58 chrisn: I need to refactor the code and come up with a non-stupid name, but when that is done I will announce it on the mailing list.

Logging service provided by n01se.net