You don't need to store it. Either the right subtree of a node is deeper, or the left one is. So return the greater of the two.Minato wrote:the problem is that i cannot use the setq function,and I can't figure out how to store the value of the deepest level found at a certain moment
Search found 148 matches
- Mon Nov 09, 2009 11:12 pm
- Forum: Common Lisp
- Topic: Number of levels in a tree
- Replies: 15
- Views: 19064
Re: Number of levels in a tree
- Thu Oct 29, 2009 9:28 pm
- Forum: Common Lisp
- Topic: Need some help..
- Replies: 17
- Views: 17558
Re: Need some help..
i mean like this (+ (* 2 3) (/ 8 2)), or more complex ones, i wonder if there is a function that test for alpha-numeric elements, for example : if not alpha-numeric remove from list => ((2 3)(8 2)) and then to aply the nth element to return the variable that i look, but for this i will look into my...
- Wed Sep 30, 2009 8:03 pm
- Forum: Common Lisp
- Topic: Parens again, grumble grumble: an idea for manual notation
- Replies: 4
- Views: 5485
Re: Parens again, grumble grumble: an idea for manual notation
You could also use alternate types of brackets.
- Sat Aug 22, 2009 10:31 am
- Forum: Common Lisp
- Topic: How to modify a function the way I need?
- Replies: 2
- Views: 4152
Re: How to modify a function the way I need?
Transforming it into valid Lisp code is a good start: (mufunc (LAMBDA (x) (>= x 0)) ‘(1 0 -2 3 0 -4 5)) –> (@ 1 0 -2 @ 3 0 -4 @ 5) (mufunc #‘EVENP ‘(1 0 -2 3 0 -4 5)) –> (1 @ 0 @ -2 3 @ 0 @ -4 5) Other than that, it's simple enough. Just add a parameter for the test function and funcall it...
- Tue Aug 04, 2009 1:43 pm
- Forum: Common Lisp
- Topic: need help with lispworks
- Replies: 17
- Views: 32725
Re: need help with lispworks
Can anyone explain me please how to make a program work inside LispWorks, what's the procedure for it or how to make a stand alone *.exe file? Is this a distribution requirement, or habit? I ask because many people get hung up on the way they did things in C, and you seem like you may be new to Lisp.
- Thu Jul 30, 2009 1:49 pm
- Forum: Common Lisp
- Topic: In need of user-friendly Lisp interpreter
- Replies: 12
- Views: 20911
Re: In need of user-friendly CL interpreter
Of the four, I have had most success w/ Visual Lisp (or VLisp for short). It highlights commands, parentheses, etc. Poplog and Ufasoft Lisp Studio are both very primitive (virtually just cmd prompts) and I have difficulty using them. GNU CLisp is a bit more manageable, but I still have difficulty u...
- Sun Jul 26, 2009 2:22 pm
- Forum: Common Lisp
- Topic: using labels in macros
- Replies: 5
- Views: 11540
Re: using labels in macros
Yeah, this definitely doesn't call for a macro. The reason it's getting confusing is precisely because you're attempting to use a macro for a function's job. And you want APPLY to pass through your argument list to a recursive call of the function. Personally, I'd drop the &rest and just pass a ...
- Wed Jul 22, 2009 12:30 am
- Forum: Common Lisp
- Topic: Where to start?
- Replies: 20
- Views: 44777
Re: Where to start?
The arcane terminology (frame, window, point, buffer), non-standard keybindings, kill ring, undo system, buffer model, configuration system, etc. Learning Emacs was one of the most painful things I can remember doing. I think it was worth it but I also understand when non-masochistic people don't w...
- Tue Jul 21, 2009 10:19 am
- Forum: Common Lisp
- Topic: Where to start?
- Replies: 20
- Views: 44777
Re: Where to start?
As already mentioned, emacs is the almost only choice for Lisp programming (at the moment, at least). I don't think that's strictly accurate. You *can* write Lisp code with any editor you like, cutting and pasting to the REPL. Although newbies especially will probably be less productive in this mod...
- Mon Jul 20, 2009 8:19 pm
- Forum: Common Lisp
- Topic: Where to start?
- Replies: 20
- Views: 44777
Re: Where to start?
The issue I'm having is I want a basic setup to learn and be able to create some programs in lisp or common lisp but I do not want to use an editor like emacs or vim as I simply prefer a simple text editor like Gedit or Jedit. Might as well get into Emacs now. Spend a few months with Lisp and you'l...