Search found 104 matches

by hsmyers
Tue Mar 18, 2008 7:52 pm
Forum: newLISP newS
Topic: Idiomatic code
Replies: 6
Views: 2568

Code with suggestions incorporated: (define (parse-move n g) (let (s (get-move n g)) (if (= 2 (length s)) (_parse-move s)))) (define (_parse-move s) (filter on-board? (catch (if (black-to-move? n) (let (lst (list (next-diagl s)(next-diagr s)(next-row s))) (if (= "6" (row s)) (append lst (list (next-...
by hsmyers
Tue Mar 18, 2008 7:38 pm
Forum: newLISP newS
Topic: Idiomatic code
Replies: 6
Views: 2568

cormullion: You are right your revision is much clearer and certainly less prone to error.

Lutz: I'd say that I knew that nil was returned as value of missing second clause except that I forgot ;)
by hsmyers
Tue Mar 18, 2008 7:30 pm
Forum: newLISP newS
Topic: Idiomatic code
Replies: 6
Views: 2568

Jeff: No matter how much I stare at letex (which I keep reading as LaTeX for some reason) I don't see what you are getting at.

Note that I did see that the (eval nil) in the posted code is not necessary!
by hsmyers
Tue Mar 18, 2008 6:51 pm
Forum: newLISP newS
Topic: Idiomatic code
Replies: 6
Views: 2568

Idiomatic code

In every language there is an idiomatic way of expressing the more common patterns. One of the things I am looking for is a more elegant (not to mention more efficient) way of returning values from a function or portion of a function (very nearly the same thing...) Consider: (define (parse-move n g)...
by hsmyers
Tue Mar 18, 2008 4:53 pm
Forum: newLISP newS
Topic: Unclosed tag in manual
Replies: 0
Views: 1679

Unclosed tag in manual

In the html for net-send : <a NAME="net-send"></a> <h2><span class="function">net-send</span></h2> <b>syntax: (net-send <em>int-socket</em> <em>str-buffer</em> [<em>int-num-bytes</em>])</b> <p> Sends the contents of <em>str-buffer</em> on the connection specified by <em>int-socket</em>. If <em>int-n...
by hsmyers
Tue Mar 18, 2008 4:37 pm
Forum: newLISP newS
Topic: Thread about Newlisp and Mathematica on comp.lang.lisp
Replies: 5
Views: 3166

Perhaps the reason they are not foaming at the mouth over newLISP is that they are foaming at the mouth over their notions of 'IP', .h files and algorithms. I've seen similar nonsense in weaving groups fretting over whether or not a weave pattern is IP...
by hsmyers
Tue Mar 18, 2008 2:11 am
Forum: newLISP newS
Topic: Question about recursion...
Replies: 7
Views: 2793

No, I mean the part about let-binding...
by hsmyers
Mon Mar 17, 2008 9:24 pm
Forum: newLISP newS
Topic: development release newLISP v.9.3.4
Replies: 7
Views: 3246

And just when I've convereted everything to assox!! Oh well, I've got bigger tables to fry...
by hsmyers
Mon Mar 17, 2008 9:18 pm
Forum: newLISP newS
Topic: Question about recursion...
Replies: 7
Views: 2793

Using a "helper" function is a common design pattern. They allow the use of another function as an iterator. You can define the helper function in a let-binding if you want to keep it hidden (let ((helper (lambda ...)))...). They are also often used when an accumulator argument is required in order...
by hsmyers
Mon Mar 17, 2008 3:52 am
Forum: newLISP newS
Topic: Question about recursion...
Replies: 7
Views: 2793

I call fen-parse from the repl but... Think of fen-parse as an ignition--- once started fen-parse-helper does the recursion. What I'd like is a single routine that calls itself without the need to split across two functions. I think I'm nearly there, I just don't see the pattern well enough to imple...
by hsmyers
Sun Mar 16, 2008 3:07 am
Forum: newLISP newS
Topic: Question about recursion...
Replies: 7
Views: 2793

Question about recursion...

Given this code: (constant 'FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR") (set 'file-list '( ("a8" "b8" "c8" "d8" "e8" "f8" "g8" "h8") ("a7" "b7" "c7" "d7" "e7" "f7" "g7" "h7") ("a6" "b6" "c6" "d6" "e6" "f6" "g6" "h6") ("a5" "b5" "c5" "d5" "e5" "f5" "g5" "h5") ("a4" "b4" "c4" "d4" "e4" "f4" "g4...
by hsmyers
Tue Mar 11, 2008 4:22 pm
Forum: newLISP newS
Topic: Like slime?
Replies: 14
Views: 5373

Damn! It's a good thing that I actually like emacs ;) Otherwise I'd be in a world of hurt. I dislike the newLISP java interface for a variety of reasons and can leverage emacs over it, Common Lisp and Scheme. I like your approach, I'll try it shortly...

--hsm
by hsmyers
Sat Mar 08, 2008 9:57 am
Forum: newLISP newS
Topic: faster dictionary?
Replies: 4
Views: 1849

Much thanks for data and info about time function. Should have known something like that would exist--- when I saw it in the function list I blanked on it thinking yet another time of day routine. Bad me!

--hsm
p.s. you meant:

Code: Select all

(board "a1" '("r" "w" "w"))
yes?
by hsmyers
Sat Mar 08, 2008 3:22 am
Forum: newLISP newS
Topic: faster dictionary?
Replies: 4
Views: 1849

faster dictionary?

Which is faster(just curious, not optimizing); a dictionary built like: (set 'board '( ("a1" ("r" "w")) ("b1" ("n" "w")) ("c1" ("b" "w")) ("d1" ("q" "w")) ("e1" ("k" "w")) ("f1" ("b" "w")) ("g1" ("n" "w")) ("h1" ("r" "w")))) or using the context with a custom function like: (board "a1" (list "r" "w"...
by hsmyers
Fri Mar 07, 2008 9:27 pm
Forum: newLISP newS
Topic: core lisp functions?
Replies: 3
Views: 1724

So all of the functions in the manual could be considered core or primitive functions?

--hsm
by hsmyers
Fri Mar 07, 2008 9:03 pm
Forum: newLISP newS
Topic: core lisp functions?
Replies: 3
Views: 1724

core lisp functions?

Is there a list of newLISP functions not written in newLISP?

--hsm
by hsmyers
Thu Feb 28, 2008 7:39 pm
Forum: newLISP newS
Topic: Suggested changes for newLISPDoc
Replies: 12
Views: 4319

Cyril you are correct about \<hr>! I plead lack of sleep while coding ;) I've begun adding the necessary material to a .stx file for EditPlus that will do the skeleton framework for me, both the @syntax material and @example. As I use it over time I'll manage text replacement for the functions I use...
by hsmyers
Thu Feb 28, 2008 5:50 pm
Forum: newLISP newS
Topic: Suggested changes for newLISPDoc
Replies: 12
Views: 4319

Good idea, all things being equal I have a preference for 'before a function'-- no reason really just seems right. I balance that by having the example after the function. Have you thought of adding the colorized code?

--hsm
by hsmyers
Thu Feb 28, 2008 5:21 pm
Forum: newLISP newS
Topic: Suggested changes for newLISPDoc
Replies: 12
Views: 4319

After all of these years I still have no idea of how to encourage documentation. Even when it is built into the language as in Perl and POD (plain old documentation) I've seen programmers unaware of what was at their fingertips. Thankfully CPAN generally has excellent documentation. One of the reaso...
by hsmyers
Thu Feb 28, 2008 3:43 pm
Forum: newLISP newS
Topic: Suggested changes for newLISPDoc
Replies: 12
Views: 4319

Ah! Trust me to trip on a typo. Yes that would certainly explain your result and bad eyesight would explain me not noticing my result!! The underscore is there because that is what is generated for each function: <p></p><center>- § -</center><p></p> <a name="_piece"></a><h3><font color=#CC0000>...
by hsmyers
Thu Feb 28, 2008 2:28 pm
Forum: newLISP newS
Topic: Suggested changes for newLISPDoc
Replies: 12
Views: 4319

Interesting... The see-also tag works on my machine running W2k with FireFox. I didn't think to test for other combinations. The placement of the one line conversion is immediately after the similar conversion for @return. I found that otherwise all I got was @see-also as text including the value(s)...
by hsmyers
Thu Feb 28, 2008 9:41 am
Forum: newLISP newS
Topic: Suggested changes for newLISPDoc
Replies: 12
Views: 4319

Suggested changes for newLISPDoc

I'd like to suggest some small changes for newLISPDoc. The are: Remove the restrictions on <h1> - <h4>, i.e. these lines: h1, h2, h3, h4 { font-family: Georgia, Times New Roman, Times, serif; font-size: 110%; } Add <hr> to the approved list: (replace "<hr>" text "[hr]") (replace "</hr>" text "[/hr]"...
by hsmyers
Sun Feb 24, 2008 11:38 pm
Forum: newLISP newS
Topic: Like slime?
Replies: 14
Views: 5373

Like slime?

Does the vi package for newLISP work like slime+vi?
How about the emacs package for newLISP?

--hsm
by hsmyers
Fri Feb 22, 2008 11:12 am
Forum: newLISP newS
Topic: value expected in function??
Replies: 2
Views: 1434

Found the problem! Can't use a parameter with the same name as a function (duh!); note the use of 'side' as both. If I change either the parameter's name or the function's name then the code works as intended. Had it been a snake I'd have been dead! Corrected looks like: (define (find-king which-sid...
by hsmyers
Fri Feb 22, 2008 12:09 am
Forum: newLISP newS
Topic: value expected in function??
Replies: 2
Views: 1434

value expected in function??

I've written myself into a problem. The result after (board:find-king "w") is: ... candidate is: f8 candidate is: f7 candidate is: f6 candidate is: f5 candidate is: f4 candidate is: f3 candidate is: f2 candidate is: f1 candidate is: e8 value expected in function = : square called from user defined f...