Re: Example of using ANTLR from Clojure?
I don't know anything about it, but counterclockwise uses antlr. http://groups.google.com/group/clojuredev-devel/browse_thread/thread/1428233ef12b6231 -Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: maplocalleader vimclojure
Hi, Am 03.09.2009 um 23:01 schrieb Bokeh Sensei: Really, the question is, what should we assume the user should know/ doesn't know/shouldn't know. Yes. This can be a problem. What should be clear to everyone: VimClojure is not intended to hide the complexity of Vim in any form. If you don't know Clojure *and* don't know Vim, you should start with an editor you are already familiar with or do some thorough Vim tutorial first. I just assume that people know what C-x means. This is just the little Vim 101. Similar to Java with the Classpath etc. However I agree (and the recent discussions shows this): the documentation on where the border is between VC and Vim or Java is not very clear. Also some FAQ with the most asked things (eg. the ~- shellism in the Classpath) can be included. For instance, there might be some implementations details that may be important when installing, but likely to change as VimClojure matures. So, instead of adding more to the documentation, which could further confuse the user, maybe we could try this: - gather all the necessary installation steps, in the right order (done! in your head at least) - ask someone to write a single test for each step, and bunch 'em up in a bash script - notify the user when that step has failed. For instance, a typical question I had, but could not verify, is : is my classpath correct? Oh, yeah, that tilde thing... An experienced Java user might laugh at this, but a beginner, or a casual user would think differently. Adding more and more information is certainly not very useful if done without thought. The existing documentation should be refactored and improved. Justin Johnson currently works on a Windows Installer, I on a Mac OS X package. I hope that this will simplify the setup. Some check script might also be of use. However, there is also some notion in this idea, which I don't like! It treats the user as a child. I expect some sense of responsibility on the user side. I honestly didn't expect that the version number in the name of a jar can cause a problem. Especially since these are also things, I can't necessarily influence... For users new to Vim and Java, such a checker might be of help but you should be wary not to start relying on it. We understand how much energy you put into this, so instead of having you write tests, maybe someone else could do it. I would love to, for the little stuff I know. I'm always open to idea, suggestions and (of course) patches. ;P Another, perhaps stupid sounding point :) I want to make, is I think a Vim+VimClojure+NailGun+Clojure self-contained box would work great. All three would be so small a footprint (1/10th of Netbeans...), I don't care for the redundancy of installs if I can install them and get going in a few clicks. This is already in work minus the Vim part. I don't want to include Vim because of several reasons: - VC is not advocating Vim as an editor, although I believe it's one of the best out there. If you don't have it (and don't know it) install Vim manually and get used to it. It's sufficiently complex to be a significant obstacle if you want to learn Vim and Clojure at the same time. - Building Vim on Windows and (sometimes) on Mac can be headache. I don't want to hunt down such troubles, in particular if I have only limited access to Windows machines. - I'm not sure, I want to blow up the package size by a some orders of magnitude. Vim has long lost its light weight... Vielen Danken! Bitte! :) Nichts zu danken. Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature
Re: Another Clojure Box - Version 1.4
I tried again following your checklist. My response is inline. Be sure that: - the REPL it's working fine (if it let you work normally then it's fine). I am not sure if I have found the REPL in the ACB yet. Is it the WinCommand Clojure 1.0 tab you are talking about? How do I setup ACB the first time? - the folder \bin\scite\tools\SendCommand have write/read permissions. It is Windows 32-bit and I haven't ever set any permission on any folder. The file permissions seem to be fine. - BE SURE that ACB it's in the root of a unit (C: or D: or something like that). I have been reported that this version don't work fine inside folders (I'll be fixing that for the next version) Thanks, that support would be great. I had put it in a deeper folder earlier but I moved it to C:\ after reading this. It still does not work. Let me know if it's work!!! I am not able to get it to work at all. I suspect there is some first- time setup required for ACB that I am not aware of. Nevertheless, I love SciTE and use it everyday. It would be great to be able to use SciTE for Clojure development. ClojureBox (not ACB) puts me slightly off due to Emacs (it's just me.) Regards, Shantanu --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: maplocalleader vimclojure
Hi, Am 04.09.2009 um 00:00 schrieb ronen: Im also not getting Clojure when calling :nmap, n NL* /+.\{-1,}+CRc/+/eCR n \gp * :GitPullRebaseCR n \gc * :GitCommitCR n \gA * :GitAdd cfileCR n \ga * :GitAddCR n \gl * :GitLogCR n \gs * :GitStatusCR n \gD * :GitDiff --cachedCR n \gd * :GitDiffCR n \C:call CapitalizeCenterAndMoveDown()CR bpEsc:bpCR bnEsc:bnCR n gxPlugNetrwBrowseX sta)Esc^i(Esc$:wCR n PlugNetrwBrowseX * :call netrw#NetrwBrowseX(expand(cWORD),0) CR M-Upgk M-Down gj That means that the ftplugin is not executed correctly for some reason. Can you zip me a small source tree, where this happens and send it to me? Which exact version of contrib should be used? 2.1.2 was tested with revision 919 of the old subversion repo, but the 1.0-compatible branch of the git repo should also work. The most difficult point is the move of c.c.stacktrace into core. Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature
Starting swank separately and connecting to it works almost but no REPL
Hi! I am trying to start swank separately so that I can connect to it from a separate emacs instance. It works almost all the way but I never get a REPL. Here are the details: Shell: $ java -cp /home/mathias/tmp/clojure-1.0/clojure-1.0.0.jar:/home/ mathias/clj/swank-clojure clojure.lang.Repl Clojure: user= (require 'swank.swank) user= (swank.swank/ignore-protocol-version 2009-05-17) user= (swank.swank/start-server /tmp/slime03 :port 4005 :encoding utf-8) Connection opened on local port 4005 In emacs -Q: (add-to-list 'load-path ~/clj/slime) (require 'slime) (slime-setup) M-x slime-connect RET RET In the *Messages* buffer I can see this: Connecting to Swank on port 4005.. [2 times] Connected. Hack and be merry! I can then enter slime-mode and for example eval (+ 1 2) in a buffer and I get as reply 3 in the echo area. So, all seems to be setup properly and working. But, I get no REPL. Why? I have tried with clojure 1.0 as well as the most recent one. I use Emacs 23.1. Slime and swank-clojure are also the most recent versions. /Mathias --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Starting swank separately and connecting to it works almost but no REPL
Hi Mathias, This wouldn't just be because SLIME no longer includes the REPL by default, would it? Does adding: (require 'slime-fancy) to your emacs setup help at all? Cheers, Mark Mathias Dahl mathias.d...@gmail.com writes: Hi! I am trying to start swank separately so that I can connect to it from a separate emacs instance. It works almost all the way but I never get a REPL. Here are the details: [...] In emacs -Q: (add-to-list 'load-path ~/clj/slime) (require 'slime) (slime-setup) M-x slime-connect RET RET In the *Messages* buffer I can see this: Connecting to Swank on port 4005.. [2 times] Connected. Hack and be merry! I can then enter slime-mode and for example eval (+ 1 2) in a buffer and I get as reply 3 in the echo area. So, all seems to be setup properly and working. But, I get no REPL. Why? -- Mark Triggs mark.h.tri...@gmail.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Starting swank separately and connecting to it works almost but no REPL
This wouldn't just be because SLIME no longer includes the REPL by default, would it? Yes it would indeed :) Does adding: (require 'slime-fancy) to your emacs setup help at all? No (because the contrib dir was not in my load-path I assume), but the following works: (slime-setup '(slime-fancy)) Thanks! /Mathias --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
STM implementation questions
I am digging somewhat into Clojure internals for a talk I'm doing. Now I've reached the LockingTransaction class, and have a few questions, I hope someone can answer. In some of the Clojure presentations it says that Readers never impede writers/readers, writers never impede readers. What does the word impede mean in this context? At first, before reading the code, I thought it meant that, e.g., a read-only transaction, R, can never be retried, even if a concurrent writing transaction, W, changes a ref that is read later by the R. But that is not the case; see e.g., http://groups.google.com/group/clojure/browse_frm/thread/e9b56115929fd199/f3ae6306214a0b0d I see that LockingTransaction.doGet may mark a fault and retry. So what exactly *is* meant by never impedes? 2) All the refs in a program are controlled by the same STM system. Suppose you have two disjoint sets of refs, A and B, in a program, and suppose that all transactions only touches either A or B. Would there be any value in having two STM instances controlling A and B, e.g., by labling each ref with 'A' or 'B.' It would mean that transactions are sourcing readPoints from distict sources and thus less synchronization (although the overhead for AtomicLong is pretty low, this might matter for many-core situations). /Karl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Fixing production systems on-the-fly
Not Clojure specific, the Spring framework has refreshable beans support which enables partial code swap on production systems (http:// tiny.cc/3zctU), its much more limited than Erlang but still might proove to be useful. On Sep 4, 9:30 pm, tmountain tinymount...@gmail.com wrote: I just put together some example code to demonstrate hot updates with Clojure. http://paste.lisp.org/display/86576 It allows you to connect to a REPL via port 12345 and dynamically update things as necessary. To address the issue of updating multiple definitions at once, you'd do something like the following (after modifying main.clj): tra...@travis-desktop:~$ nc localhost 12345 clojure.core= (require 'main :reload) Right now the main thread simply prints message in a loop, but I've tried changing main.clj to modify both the print-hello function and value of message, and it worked great. You can also connect to the repl and do something like the following, but it doesn't provide the same safety as the seemingly atomic require function does. clojure.core= (ns main) nil main= (def message hola) #'main/message -Travis On Sep 4, 4:22 am, Krukow karl.kru...@gmail.com wrote: I was thinking about the capability of changing production systems on the fly. E.g. by having an accessible repl in a running production system. If you have a bug in a function, you can fix it by re-def'ing it - that is great. However, suppose you want to do a system upgrade where you want to change several things. Now you could just re-def each var one at a time, but this might produce an inconsistent program in the interval where you have re-def'ed some but not all vars. This first thing you would want is sort-of a atomic update of all vars, similarly to what is possible with refs. Is this possible somehow? If not are there any techniques or best practices for these system upgrades? /Karl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Fixing production systems on-the-fly
Not Clojure specific, the Spring framework has refreshable beans support which enables partial code swap on production systems (http:// tiny.cc/3zctU), its much more limited than Erlang but still might proove to be useful. On Sep 4, 9:30 pm, tmountain tinymount...@gmail.com wrote: I just put together some example code to demonstrate hot updates with Clojure. http://paste.lisp.org/display/86576 It allows you to connect to a REPL via port 12345 and dynamically update things as necessary. To address the issue of updating multiple definitions at once, you'd do something like the following (after modifying main.clj): tra...@travis-desktop:~$ nc localhost 12345 clojure.core= (require 'main :reload) Right now the main thread simply prints message in a loop, but I've tried changing main.clj to modify both the print-hello function and value of message, and it worked great. You can also connect to the repl and do something like the following, but it doesn't provide the same safety as the seemingly atomic require function does. clojure.core= (ns main) nil main= (def message hola) #'main/message -Travis On Sep 4, 4:22 am, Krukow karl.kru...@gmail.com wrote: I was thinking about the capability of changing production systems on the fly. E.g. by having an accessible repl in a running production system. If you have a bug in a function, you can fix it by re-def'ing it - that is great. However, suppose you want to do a system upgrade where you want to change several things. Now you could just re-def each var one at a time, but this might produce an inconsistent program in the interval where you have re-def'ed some but not all vars. This first thing you would want is sort-of a atomic update of all vars, similarly to what is possible with refs. Is this possible somehow? If not are there any techniques or best practices for these system upgrades? /Karl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: maplocalleader vimclojure
Ok, iv done two steps, iv cleared my .vim started from scratch (i guess that i had some old version laying around there) iv noticed an error in my classpath (iv added clojure jar twice instead of clojure- contrib), The main thing that i would add to the docs is a trouble shooting section that consist of common user mistakes how to check them possible fixes, I think that the installation procedure can be further automated (as mentioned before me). Im willing to do a small screen cast that shows how simple it is to install some usage functionality load it up to Youtube (if you are interested). Thank you for your patience hard work Ronen On Sep 5, 11:03 am, Meikel Brandmeyer m...@kotka.de wrote: Hi, Am 04.09.2009 um 00:00 schrieb ronen: Im also not getting Clojure when calling :nmap, n NL * /+.\{-1,}+CRc/+/eCR n \gp * :GitPullRebaseCR n \gc * :GitCommitCR n \gA * :GitAdd cfileCR n \ga * :GitAddCR n \gl * :GitLogCR n \gs * :GitStatusCR n \gD * :GitDiff --cachedCR n \gd * :GitDiffCR n \C :call CapitalizeCenterAndMoveDown()CR bp Esc:bpCR bn Esc:bnCR n gx PlugNetrwBrowseX st a)Esc^i(Esc$:wCR n PlugNetrwBrowseX * :call netrw#NetrwBrowseX(expand(cWORD),0) CR M-Up gk M-Down gj That means that the ftplugin is not executed correctly for some reason. Can you zip me a small source tree, where this happens and send it to me? Which exact version of contrib should be used? 2.1.2 was tested with revision 919 of the old subversion repo, but the 1.0-compatible branch of the git repo should also work. The most difficult point is the move of c.c.stacktrace into core. Sincerely Meikel smime.p7s 2KViewDownload --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: STM implementation questions
On Sat, Sep 5, 2009 at 9:30 AM, Krukowkarl.kru...@gmail.com wrote: I am digging somewhat into Clojure internals for a talk I'm doing. Now I've reached the LockingTransaction class, and have a few questions, I hope someone can answer. I have lots of detail on this in my article at http://ociweb.com/mark/stm/article.html. In some of the Clojure presentations it says that Readers never impede writers/readers, writers never impede readers. What does the word impede mean in this context? I'd say it means block as in wait until the other finishes. At first, before reading the code, I thought it meant that, e.g., a read-only transaction, R, can never be retried, even if a concurrent writing transaction, W, changes a ref that is read later by the R. But that is not the case; see e.g., http://groups.google.com/group/clojure/browse_frm/thread/e9b56115929fd199/f3ae6306214a0b0d A transaction A that only reads Refs won't have to wait for a transaction B that writes the same Refs to complete in order for it to do its work. It is possible though that transaction A will have to retry. This happens if the history chain for a Ref that is being read within transaction A doesn't contain a value that was committed before transaction A started. And that can happen if a number of transactions committed changes to the Ref since transaction A started. How many commits would their have to be? It depends on the current length of the history chain for the Ref being read. See my article for more detail on how the history chain grows. I see that LockingTransaction.doGet may mark a fault and retry. Right. A fault is the situation I described above when a transaction tries to read a Ref, but its history chain doesn't contain a value that was committed before the current transaction try began. So what exactly *is* meant by never impedes? Doesn't block. 2) All the refs in a program are controlled by the same STM system. Suppose you have two disjoint sets of refs, A and B, in a program, and suppose that all transactions only touches either A or B. Would there be any value in having two STM instances controlling A and B, e.g., by labling each ref with 'A' or 'B.' It would mean that transactions are sourcing readPoints from distict sources and thus less synchronization (although the overhead for AtomicLong is pretty low, this might matter for many-core situations). I can't see how this would help. There is very little synchronization now. The current STM seems pretty optimized. For example, each Ref keeps track of its own history. The transactions keep track of changes they have made to Refs that haven't been committed yet. Search for overhead in my article to see a detailed description of the overhead introduced by Clojure STM. Even though there are a lot of steps involved, I think the overhead is pretty minimal. Also, see the article description of the lock field in the Ref class for a description of all the ways that locks are used by Clojure STM (http://java.ociweb.com/mark/stm/article.html#lock-field). Almost all the locks are acquired and only held for a brief period of time, not for the duration of a transaction. -- R. Mark Volkmann Object Computing, Inc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: STM implementation questions
On Sep 5, 10:30 am, Krukow karl.kru...@gmail.com wrote: I am digging somewhat into Clojure internals for a talk I'm doing. Now I've reached the LockingTransaction class, and have a few questions, I hope someone can answer. In some of the Clojure presentations it says that Readers never impede writers/readers, writers never impede readers. What does the word impede mean in this context? At first, before reading the code, I thought it meant that, e.g., a read-only transaction, R, can never be retried, even if a concurrent writing transaction, W, changes a ref that is read later by the R. But that is not the case; see e.g., http://groups.google.com/group/clojure/browse_frm/thread/e9b56115929f... I see that LockingTransaction.doGet may mark a fault and retry. So what exactly *is* meant by never impedes? Given sufficient history, readers will not be retried due to the activity of writers. It is true that while history is being dynamically acquired there may be retries. Unless you have some pathological transaction relationships, that history acquisition will occur in a small amount of time, and thus is being ignored as would a constant factor. Perhaps 'never' is too strong a term, but history acquisition is somewhat of an implementation detail. If that build-up phase is an actual problem, you now have :min-history to mitigate it. 2) All the refs in a program are controlled by the same STM system. Suppose you have two disjoint sets of refs, A and B, in a program, and suppose that all transactions only touches either A or B. Would there be any value in having two STM instances controlling A and B, e.g., by labling each ref with 'A' or 'B.' It would mean that transactions are sourcing readPoints from distict sources and thus less synchronization (although the overhead for AtomicLong is pretty low, this might matter for many-core situations). There is potential for a 'separate worlds' design, but the devil is in the details of allocation of refs to worlds. While the single shared CAS is a theoretical bottleneck, I'd have to see it become an actual bottleneck before introducing that complexity. Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Confusion with namespaces and SLIME
I have the same problem and I have the latest version of all involved components. I run Emacs 23.1 on Ubuntu. Any ideas on how to resolve it? The trick of using `ns' and `use' separately does not seem to solve the problem for me. It feels like there are two or even more environments behind the scenes, having their own opinions on the state of affair of things, like in which namespace I am in. Any pointers to where I should start if I want to debug this? The internal workings of slime is very deep and it is hard to understand it. /Mathias On Jul 28, 4:19 pm, Daniel Janus nath...@gmail.com wrote: The following steps should show the problem I'm having: [...] This sequence works perfectly well for me withSLIME2009-07-15, clojure-mode 8c333628bf507749dd78b312333130b00e6ec06f, swank-clojure 6cd3057d48e00da485cdf43b2b170816e5187c40, Emacs 22.2.1 (on Ubuntu 9.04), and both Clojure 1.0.0 and current git. Perhaps you should try upgrading your setup? Best, Daniel Janus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Dynamically Changing Functions in Compiled Code
I am trying to add clojure code to an eclipse plugin. To do so, the code i compiled into class files via the clojure-dev plugin. I have a generate class, ParenMatcher, which i use ever so often. This class has a function which i would like to change dynamically while debugging it. In other words, If an error is thrown inside it, i would like to change it instead of closing the plugin and restarting all over again! I've tried recompiling while the plugin is running, but that doesn't work. Any ideas how to do this code hot swapping? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Confusion with namespaces and SLIME
Okay, one of my usual habits seems to be to answer my own questions... I figured this out. In the quest to get emacs talking to a separately started swank-server I made a too light emacs setup and totally skipped the swank-clojure.el and swank-clojure-autoload.el files. In them was the solution. In swank-clojure-autoload.el a hook is added to clojure-mode. That hook (swank-clojure-slime-mode-hook), among other things, sets up a value for slime-find-buffer-package-function, which, as you can guess from the name, sets up a function that will find the package of the current file/buffer. My mistake was to not load those two elisp files but also, in one setup where I did load the, to not load clojure-mode so that the hook was run. So, I made two convenience commands that I can use depending on if I want to start a swank-server from emacs or to use one started externally (outside emacs) and connect to that. Assuming emacs -Q and all the latest versions of the included components (here is a good guide: http://riddell.us/tutorial/slime_swank/slime_swank.html) placed under ~/clj, this works for me: (defvar clojure-stuff-path ~/clj Where all cool Clojure stuff lies.) (defun slime-clojure-internal-swank () (interactive) (add-to-list 'load-path (concat clojure-stuff-path /clojure-mode)) (add-to-list 'load-path (concat clojure-stuff-path /swank- clojure)) (require 'swank-clojure-autoload) (require 'clojure-mode) (clojure-slime-config clojure-stuff-path) (slime)) (defun slime-clojure-external-swank () (interactive) (add-to-list 'load-path (concat clojure-stuff-path /clojure-mode)) (add-to-list 'load-path (concat clojure-stuff-path /swank- clojure)) (add-to-list 'load-path (concat clojure-stuff-path /slime)) (require 'swank-clojure-autoload) (require 'clojure-mode) (clojure-slime-config clojure-stuff-path ) ;; The order of the line above and below is important (require 'slime) (slime-setup '(slime-fancy)) (call-interactively 'slime-connect)) Hope this can help someone. /Mathias On Sep 5, 9:09 pm, Mathias Dahl mathias.d...@gmail.com wrote: I have the same problem and I have the latest version of all involved components. I run Emacs 23.1 on Ubuntu. Any ideas on how to resolve it? The trick of using `ns' and `use' separately does not seem to solve the problem for me. It feels like there are two or even more environments behind the scenes, having their own opinions on the state of affair of things, like in which namespace I am in. Any pointers to where I should start if I want to debug this? The internal workings of slime is very deep and it is hard to understand it. /Mathias On Jul 28, 4:19 pm, Daniel Janus nath...@gmail.com wrote: The following steps should show the problem I'm having: [...] This sequence works perfectly well for me withSLIME2009-07-15, clojure-mode 8c333628bf507749dd78b312333130b00e6ec06f, swank-clojure 6cd3057d48e00da485cdf43b2b170816e5187c40, Emacs 22.2.1 (on Ubuntu 9.04), and both Clojure 1.0.0 and current git. Perhaps you should try upgrading your setup? Best, Daniel Janus --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: STM implementation questions
On Sep 5, 8:18 pm, Rich Hickey richhic...@gmail.com wrote: Given sufficient history, readers will not be retried due to the activity of writers. It is true that while history is being dynamically acquired there may be retries. Unless you have some pathological transaction relationships, that history acquisition will occur in a small amount of time, and thus is being ignored as would a constant factor. Perhaps 'never' is too strong a term, but history acquisition is somewhat of an implementation detail. If that build-up phase is an actual problem, you now have :min-history to mitigate it. Ok - thanks for the clarification, and :min-history seems a very practical tool. There is potential for a 'separate worlds' design, but the devil is in the details of allocation of refs to worlds. While the single shared CAS is a theoretical bottleneck, I'd have to see it become an actual bottleneck before introducing that complexity. Yes, I understand. Perhaps it may become another knob of the STM system if there is a convincing use-case, e.g. (ref {} :min-history 42 :world :x) /K /Karl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: STM implementation questions
On Sep 5, 6:55 pm, Mark Volkmann r.mark.volkm...@gmail.com wrote: I have lots of detail on this in my article athttp://ociweb.com/mark/stm/article.html. Yes, it's bookmarked in the TO READ group :-) I just want to be precise in my presentation. I'd say it means block as in wait until the other finishes. But writers blocking readers, and readers/writers blocking writers is certainly possible with the ReadWriteLocks, although (as you also point out) locks are only hold very briefly. snip I can't see how this would help. There is very little synchronization now. The current STM seems pretty optimized. Yes, don't get me wrong - I think it is a wonderful model and implementation. I was just looking for any possible optimizations. /Karl --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: STM implementation questions
On Sat, Sep 5, 2009 at 5:30 PM, Krukowkarl.kru...@gmail.com wrote: On Sep 5, 8:18 pm, Rich Hickey richhic...@gmail.com wrote: Given sufficient history, readers will not be retried due to the activity of writers. It is true that while history is being dynamically acquired there may be retries. Unless you have some pathological transaction relationships, that history acquisition will occur in a small amount of time, and thus is being ignored as would a constant factor. Perhaps 'never' is too strong a term, but history acquisition is somewhat of an implementation detail. If that build-up phase is an actual problem, you now have :min-history to mitigate it. Ok - thanks for the clarification, and :min-history seems a very practical tool. There is potential for a 'separate worlds' design, but the devil is in the details of allocation of refs to worlds. While the single shared CAS is a theoretical bottleneck, I'd have to see it become an actual bottleneck before introducing that complexity. Yes, I understand. Perhaps it may become another knob of the STM system if there is a convincing use-case, e.g. (ref {} :min-history 42 :world :x) As I said, devil's in the details. Any name-based scheme that would have transactions looking up STM instances by name would just introduce another bottleneck (the name-to-STM-instance map). Rich --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Dynamically Changing Functions in Compiled Code
gen-class generates a stub java class that dispatches to clojure functions, you can re-def the clojure functions that back the stubbed out class. On Sat, Sep 5, 2009 at 12:10 PM, Gorsals...@tewebs.com wrote: I am trying to add clojure code to an eclipse plugin. To do so, the code i compiled into class files via the clojure-dev plugin. I have a generate class, ParenMatcher, which i use ever so often. This class has a function which i would like to change dynamically while debugging it. In other words, If an error is thrown inside it, i would like to change it instead of closing the plugin and restarting all over again! I've tried recompiling while the plugin is running, but that doesn't work. Any ideas how to do this code hot swapping? -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
RE: Dynamically Changing Functions in Compiled Code
How is this supposed to work? I use AOT compilation to produce the class files, and I have tried to recompile the functions but it doesn't appear to have an effect. I'm including the clojure as class files, are you saying that all I have to do is recompile the clojure functions? Of course, I have to admit, when I compile something I only know how to compile the whole namespace not just the functions. I guess what I'm saying is that I have no idea how to use the REPL with a running eclipse plugin which has clojure code in it. So I can't simply redef it... -Original Message- From: clojure@googlegroups.com [mailto:cloj...@googlegroups.com] On Behalf Of Kevin Downey Sent: Saturday, September 05, 2009 7:46 PM To: clojure@googlegroups.com Subject: Re: Dynamically Changing Functions in Compiled Code gen-class generates a stub java class that dispatches to clojure functions, you can re-def the clojure functions that back the stubbed out class. On Sat, Sep 5, 2009 at 12:10 PM, Gorsals...@tewebs.com wrote: I am trying to add clojure code to an eclipse plugin. To do so, the code i compiled into class files via the clojure-dev plugin. I have a generate class, ParenMatcher, which i use ever so often. This class has a function which i would like to change dynamically while debugging it. In other words, If an error is thrown inside it, i would like to change it instead of closing the plugin and restarting all over again! I've tried recompiling while the plugin is running, but that doesn't work. Any ideas how to do this code hot swapping? -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---
Re: Dynamically Changing Functions in Compiled Code
http://gist.github.com/163140 for example this code creates a repl on port 4445 you can interact with via telnet. so you would have the plugin evaluate this code (to start the repl) you can then telnet in, and past new definitions for the functions On Sat, Sep 5, 2009 at 8:23 PM, Seth Burleighs...@tewebs.com wrote: How is this supposed to work? I use AOT compilation to produce the class files, and I have tried to recompile the functions but it doesn't appear to have an effect. I'm including the clojure as class files, are you saying that all I have to do is recompile the clojure functions? Of course, I have to admit, when I compile something I only know how to compile the whole namespace not just the functions. I guess what I'm saying is that I have no idea how to use the REPL with a running eclipse plugin which has clojure code in it. So I can't simply redef it... -Original Message- From: clojure@googlegroups.com [mailto:cloj...@googlegroups.com] On Behalf Of Kevin Downey Sent: Saturday, September 05, 2009 7:46 PM To: clojure@googlegroups.com Subject: Re: Dynamically Changing Functions in Compiled Code gen-class generates a stub java class that dispatches to clojure functions, you can re-def the clojure functions that back the stubbed out class. On Sat, Sep 5, 2009 at 12:10 PM, Gorsals...@tewebs.com wrote: I am trying to add clojure code to an eclipse plugin. To do so, the code i compiled into class files via the clojure-dev plugin. I have a generate class, ParenMatcher, which i use ever so often. This class has a function which i would like to change dynamically while debugging it. In other words, If an error is thrown inside it, i would like to change it instead of closing the plugin and restarting all over again! I've tried recompiling while the plugin is running, but that doesn't work. Any ideas how to do this code hot swapping? -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~--~~~~--~~--~--~---