Re: Evaluation confusion

2017-04-01 Thread Alexander Burger
On Sat, Apr 01, 2017 at 03:00:05PM +0200, Joh-Tob Schäg wrote: > > So "abc" is less than "abd", and also less than 'abd' (internal symbol). > > ​... as long as the symbols are not bound to other values.​ This has nothing to do with the values. We are talking here about comparing *symbols*. If

Re: Evaluation confusion

2017-04-01 Thread Christopher Howard
I expect my code so far will hardly impress you, but you can view it here at http://git.savannah.nongnu.org/cgit/picolisp-nb.git/tree/text-adventure When the game is (mostly) complete I'll probably fork it out to a separate project. On 04/01/2017 04:11 AM, Joh-Tob Schäg wrote: > @Christopher

Re: Evaluation confusion

2017-04-01 Thread Alexander Burger
On Sat, Apr 01, 2017 at 04:04:32AM -0800, Christopher Howard wrote: > Additional question: Should I expect any weird behavior with transient > symbols and the '< or '> operators? E.g. (assuming the symbols have not > been assigned strange values) is it true that "abc" will always be less > than

Re: Evaluation confusion

2017-04-01 Thread Alexander Burger
On Sat, Apr 01, 2017 at 03:56:08AM -0800, Christopher Howard wrote: > tree as the primary data structure for managing game data. I wrote my > own AA Tree implementation (with guidance from Wikipedia). I see the idx > and balance functions in PicoLisp reference, but my concern is I don't > see how

Re: Evaluation confusion

2017-04-01 Thread Joh-Tob Schäg
No that is not true. : (setq "ABC" 3) -> 3 : "ABC" -> 3 : (setq "ABD" 2) -> 2 : (> "ABC" "ABD") -> T But it is always true if the transient symbols do not refer to themselves. See Comparing in the docs. > Numbers are comparable by their numeric value, strings by their name, and > lists

Re: Evaluation confusion

2017-04-01 Thread Christopher Howard
Additional question: Should I expect any weird behavior with transient symbols and the '< or '> operators? E.g. (assuming the symbols have not been assigned strange values) is it true that "abc" will always be less than "abd" regardless of the scope of the transient symbols? On 04/01/2017 03:56

Re: Evaluation confusion

2017-04-01 Thread Christopher Howard
Ah, okay. Somehow in my mind I had reversed the meaning of "==" and "=". @Joh-Tob: I am writing a text-adventure game, using a balanced binary tree as the primary data structure for managing game data. I wrote my own AA Tree implementation (with guidance from Wikipedia). I see the idx and balance

Re: Evaluation confusion

2017-04-01 Thread Alexander Burger
Hi Christopher, > : (aa-search '(("threshold" (("long-description" "You stand in front of > a wooden door, reputed to be the home of one Dr. Theobold. The door has > a small keyhole.") NIL NIL 1)) NIL NIL 1) "threshold") > -> ("threshold" ... > However, if I run this command, I get a different

Re: Evaluation confusion

2017-04-01 Thread Joh-Tob Schäg
You seem to want to implement a search binary tree. Take a look at 'idx it already does that for you. A possible source of the trouble could be related to 'cadr in '(pp 'rooms). Also what project are you working on? (Just curious) 2017-04-01 7:46 GMT+02:00 Christopher Howard

Evaluation confusion

2017-03-31 Thread Christopher Howard
Hi list, I'm a little confused at a bug in my code. I have this procedure 'rooms that returns some data: : (rooms) -> (("threshold" (("long-description" "You stand in front of a wooden door, reputed to be the home of one Dr. Theobold. The door has a small keyhole.") NIL NIL 1)) NIL NIL 1) Now,