Search found 226 matches

by edgar-rft
Fri May 22, 2015 2:41 am
Forum: Common Lisp
Topic: Lisp for trimming/breakine a polyline or Line
Replies: 2
Views: 10130

Re: Lisp for trimming/breakine a polyline or Line

What please is a polyline? There is no built-in concept of a polyline in Common Lisp. I do not think that anybody can answer your question as long as you do not explain what you are talking about. I' sorry, but 'Im no a mind reader and my glass ball is on holidays.

- edgar
by edgar-rft
Wed May 20, 2015 10:04 am
Forum: Homework
Topic: my-union (Touretzky / exercise 8.52.)
Replies: 4
Views: 14041

Re: my-union (Touretzky / exercise 8.52.)

I had worked with several other programming languages before and started learning Lisp with David Tourtzky's Gentle Introduction , but found it "too basic" (what is not true, but I didn't realized it at that time). Then I read Peter Seibel's Practical Common Lisp , David Lamkin's Sucessful...
by edgar-rft
Sat May 16, 2015 1:55 am
Forum: Homework
Topic: my-union (Touretzky / exercise 8.52.)
Replies: 4
Views: 14041

Re: my-union (Touretzky / exercise 8.52.)

The difference is subtle and not visible on the first view, but APPEND makes copies of all of its arguments, except of its last argument. For the last argument the elements are copied by the recursive function from the y-list. The result is a list that is completely independent from the structure of...
by edgar-rft
Fri May 15, 2015 5:09 pm
Forum: Common Lisp
Topic: Establishing a condition handler at the REPL
Replies: 2
Views: 8678

Re: Establishing a condition handler at the REPL

Is it possible to establish a condition handler at the REPL in such a way that it can handle conditions that occur at the REPL? Only if the condition handler is established before the REPL is started. For example, some Common Lisp implementations provide command-line arguments or implementation-spe...
by edgar-rft
Sat Apr 18, 2015 9:30 am
Forum: Common Lisp
Topic: Creating a hash of hashes
Replies: 6
Views: 17382

Re: Creating a hash of hashes

Setting the value of a sub-hashtable: (setf (gethash sub-key (gethash master-key master-table)) sub-value) Using multi-dimensional hashtables leads to code that nobody understands. How can I create a string from a symbol (how can I get its "name"...) ? By using SYMBOL-NAME ... - edgar
by edgar-rft
Sat Apr 11, 2015 2:11 am
Forum: Common Lisp
Topic: Conditional branching with more then one line of code
Replies: 3
Views: 10564

Re: Conditional branching with more then one line of code

See PROGN and use it like this:

Code: Select all

(if (test-form ...)
    (progn
      (first-then-form ...)
      (second-then-form ...))
    (progn
      (first-else-form ...)
      (second-else-form ...)))
by edgar-rft
Wed Apr 08, 2015 11:50 pm
Forum: Common Lisp
Topic: SBCL: List of format control directives
Replies: 3
Views: 10571

Re: SBCL: List of format control directives

HYPERSPEC is (sorry) not something I would like to call "readable"... The Hyperspec is formatted to be read with Emacs-w3m , not with Firefox. The format controls in the Hyperspec are in Chapter 22.3: Formatted Output and sub-chapters, linked near the bottom of that page. Common Lisp the ...
by edgar-rft
Tue Apr 07, 2015 3:11 pm
Forum: Common Lisp
Topic: SBCL: Cutting a string into subsequent pieces
Replies: 6
Views: 15623

Re: SBCL: Cutting a string into subsequent pieces

What is the advantage for the "." in between the offsets? (1 . 2) needs only half the memory of (1 2) (cons 1 2) => (1 . 2) (car '(1 . 2)) => 1 (cdr '(1 . 2)) => 2 +-----+-----+ | 1 | 2 | +-----+-----+ (1 . 2) is one cons cell in memory = two memory locations (list 1 2) == (cons 1 (cons 2...
by edgar-rft
Mon Apr 06, 2015 9:29 pm
Forum: Common Lisp
Topic: SBCL: Cutting a string into subsequent pieces
Replies: 6
Views: 15623

Re: SBCL: Cutting a string into subsequent pieces

...and another one: Look at Common Lisp's PARSE-INTEGER function if you want to transform the numerical strings into integer numbers.

- edgar
by edgar-rft
Mon Apr 06, 2015 6:17 pm
Forum: Common Lisp
Topic: SBCL: Cutting a string into subsequent pieces
Replies: 6
Views: 15623

Re: SBCL: Cutting a string into subsequent pieces

Helper function that returns a substring from START to STOP with leading and trailing whitespace removed, or NIL if no such token is specified in the line, either because the substring between START and STOP contains only whitespace, or the START of the substring is beyond the END of the line: (defu...