|
#31
|
|
|
|
|
On Oct 9, 12:23 pm, Scott Burson <FSet> wrote:
[..] > Fifth, I would be concerned that using very wide nodes might make > updates of small collections a lot more expensive. This would be > interesting to measure. Maybe it's not a big deal. > > And finally, I expect FSet could be improved further. For instance, I > have seen a paper claiming that functional red/black trees have better > rebalancing performance than the weight-balanced trees I used. (Of > course, rebalancing is an issue only in update, not in access.) > > -- Scott The data structures Clojure uses are persistent variants of Bagwell's hash array mapped tries [1]. They are suitable for maps and sets, effectively acting as very shallow tree-based hash tables. Binary search is not used at each node, instead a constant time bitmap lookup is used. I've found them to be substantially faster than binary trees. Rich [1] http://en.wikipedia.org/wiki/Hash_array_mapped_trie |
|
|
|
#32
|
|
|
|
|
On Oct 9, 6:21 pm, Rich Hickey <richhic> wrote:
> The data structures Clojure uses are persistent variants of Bagwell's > hash array mapped tries [1]. They are suitable for maps and sets, > effectively acting as very shallow tree-based hash tables. Binary > search is not used at each node, instead a constant time bitmap lookup > is used. I've found them to be substantially faster than binary trees. Ah, very interesting! Thanks for the link! I suppose at some point I should try implementing HAMTs in CL and seeing how they compare. I'm afraid it won't happen soon -- too much else to do. -- Scott |
|
#33
|
|
|
|
|
Scott Burson <FSet.SLB> writes:
> On Oct 9, 6:21Â pm, Rich Hickey <richhic> wrote: >> The data structures Clojure uses are persistent variants of Bagwell's >> hash array mapped tries [1]. They are suitable for maps and sets, >> effectively acting as very shallow tree-based hash tables. Binary >> search is not used at each node, instead a constant time bitmap lookup >> is used. I've found them to be substantially faster than binary trees. > > Ah, very interesting! Thanks for the link! > > I suppose at some point I should try implementing HAMTs in CL and > seeing how they compare. I'm afraid it won't happen soon -- too much > else to do. Thanks everyone for the interesting conversation -- Scott, Rich, and everyone else. Lisp claims to be designed in such a way that it can be extended to provide features not provided by the primitives. This idea, a very good one, is a bit of an esoteric concept to understand. The immediately obvious syntactic examples are great and certainly good enough to get someone new to the language moving forward in their studies, but they don't really provide the concrete application that leads to a deeper understanding. F-set looks like a great example of the extensibility of CL. Of my limited exposure to all the CL code in the world so far, F-set is certainly a piece of code every newbie lisper should grok. It makes the esoteric concept of extensibility concrete. Looking over it and trying it out has certainly opened my eyes a little. |
|
#34
|
|
|
|
|
On Oct 10, 9:04 am, J Kenneth King <ja> wrote:
> FSet looks like a great example of the extensibility of CL. Of my > limited exposure to all the CL code in the world so far, FSet is > certainly a piece of code every newbie lisper should grok. A very nice endorsement -- thanks! I agree, of course :) I think the new tutorial I'm writing should make it easier to get going with FSet. Should be done... well, maybe this weekend, maybe a couple of weeks yet. > It makes > the esoteric concept of extensibility concrete. Looking over it and > trying it out has certainly opened my eyes a little. What in particular has stood out for you? -- Scott |
|
#35
|
|
|
|
|
On 8 Okt., 01:46, Sacha <n> wrote:
> > Need to define a function before calling it. Or just its name, but still > that's not very friendly. > I don't see this point discussed, so just to clear up the matter, no, you don't have to. > (map (fn [x] (+ x 1)) '(1 2 3)) (2 3 4) Even cooler, it works on all sequences: > (map (fn [x] (+ x 1)) [1 2 3]) (2 3 4) And you can even use the shorthand: > (map #(+ % 1) '(1 2 3)) (2 3 4) > Documentation is skinny, a lot is missing, no examples, no central index. Couldn't agree with you more there. Well, it's a new language, give it time. Regards, |
|
#36
|
|
|
|
|
Michel Salim wrote:
> On 8 Okt., 01:46, Sacha <n> wrote: > I don't see this point discussed, so just to clear up the matter, no, > you don't have to. > > (2 3 4) > > Even cooler, it works on all sequences: > > (2 3 4) > > And you can even use the shorthand: > > (2 3 4) He probably meant this: CL-USER 1 > (mapcar #'f '(1 2 3)) Error: Undefined function F in form (FUNCTION F). 1 (continue) Take the function definition of another function name. 2 Try to take the function definition of F again. 3 Return a value from the call to (FUNCTION F). 4 Set the function definition of F to another function. 5 (abort) Return to level 0. 6 Return to top loop level 0. Type :b for backtrace, :c <option number> to proceed, or :? for other options CL-USER 2 : 1 > (defun f (x) (+ x 1)) F CL-USER 3 : 1 > :c 2 (2 3 4) Pascal |
|
#37
|
|
|
|
|
J Kenneth King ha scritto:
> Clojure An interesting related article: http://briancarper.net/2008/10/31/qt4-in-lisp/ -PM |
|
#38
|
|
|
|
|
Pascal Costanza wrote:
> Michel Salim wrote: >> On 8 Okt., 01:46, Sacha <n> wrote: >>> Need to define a function before calling it. Or just its name, but still >>> that's not very friendly. >>> >> I don't see this point discussed, so just to clear up the matter, no, >> you don't have to. >> > He probably meant this: Actually no, I mean this : cara.users> (defn atest-function-1 [] (atest-function-2)) java.lang.Exception: Unable to resolve symbol: atest-function-2 in this context cara.users> (defn atest-function-2 [] 1) #=(var cara.users/atest-function-2) cara.users> (defn atest-function-1 [] (atest-function-2)) #=(var cara.users/atest-function-1) cara.users> (atest-function-1) 1 So for mutually recursive functions, you would need to def the symbol atest-function-2 before defining atest-function-1. Like this : cara.users> (def test1) #=(var cara.users/test1) cara.users> (defn test2 [] (test1)) #=(var cara.users/test2) cara.users> (defn test1 [] (test2)) #=(var cara.users/test1) Err don't run this of course =) Sacha |
|
#39
|
|
|
|
|
Sacha wrote:
> Pascal Costanza wrote: >> Michel Salim wrote: >>> On 8 Okt., 01:46, Sacha <n> wrote: >>>> Need to define a function before calling it. Or just its name, but >>>> still >>>> that's not very friendly. >>>> >>> I don't see this point discussed, so just to clear up the matter, no, >>> you don't have to. >>> >> He probably meant this: > > Actually no, I mean this : Er, right. I had your example in mind, but screwed up when writing it down. ;) Pascal |
|
#40
|
|
|
|
|
pls.mrjm writes:
> J Kenneth King ha scritto: >> Clojure > > An interesting related article: > > [..] > > -PM Says Lisp in the title, then talks about clojure! :p Pretty cool that clojure by virtue of its implementation gets trivial access to libraries such as Qt. It's a strong selling feature. AFAIK, gui programming in Lisp is still a pain. If I am dead wrong, someone please tell me. I'd love to have something that is (at least conceptually, but hopefully practically) cross-platform. I'm most of the way through PCL and am loving the language. |
|
#41
|
|
|
|
|
On 3 Nov, 17:26, J Kenneth King <ja> wrote:
> AFAIK, gui programming in Lisp is still a pain. You sure did hear of Ltk, didn't you? I never tried it myself, but (as they say) it seems good enough for most situations. -PM |
|
#42
|
|
|
|
|
pls.mrjm wrote:
> On 3 Nov, 17:26, J Kenneth King <ja> wrote: > >>AFAIK, gui programming in Lisp is still a pain. >> You sure did hear of Ltk, didn't you? > I never tried it myself, but (as they say) it seems good enough for > most situations. It is, as is Cells-Gtk, Celtk, and Cello tho the latter two make you want it. Of course no one is allowed to mention Lispworks, that is a commercial product, RMS would not be pleased. hth,kt |
|
|
|
|
| Similar Threads | |
| Clojure It is my sad duty to report here that some of the core clojure maintainers, and the clojure Google Group, are experiencing ... difficulties. These difficulties appear to... |
|
| ABCL and Clojure A couple of people wrote to me about porting Qi II to Clojure. What are the specific gains/losses in using ABCL versus Clojure? We've had several goes with ABCL without... |
|
| Get registered for the new community at https://community.dynamics Within the next few weeks you will begin to see the Microsoft Dynamics Community pages located at [..], moving to a new location at [..]. We are making this move in an effort... |
|
| Problem community community edition build 90 I've downloaded previous versions ok (including 89), but build 90 will not download. I'm trying to get the single DVD segment (sol-nv-b90-x86-dev.iso) on Solaris x86. I'm... |
|
| Delphi Community Many Times Stronger Than C++ Community There was a posting I read in this newsgroup about a week back, where some guy made a comment about he was surprised the Delphi community still existed and had not passed... |
|
|
All times are GMT. The time now is 11:18 PM. | Privacy Policy
|