Search found 17 matches

by santiago
Tue Feb 19, 2013 9:11 am
Forum: Common Lisp
Topic: Reading a line using chars
Replies: 3
Views: 6885

Re: Reading a line using chars

Hi, The problem is that I need to read a char, not read-line. I think, Read-line fails because can't find Return. I've checked this: (def$method (tty-dialog-mixin :babylon-read-string) (&optional special-keys) (setq X 0) (setf exit "") (loop while (<= X 0) do (let ((char1 (read-char *s...
by santiago
Tue Feb 19, 2013 2:09 am
Forum: Common Lisp
Topic: Reading a line using chars
Replies: 3
Views: 6885

Reading a line using chars

Hi, I have this function to read a line using chars. I'm reading chars, because I'm trying to communicate Lisp and Java using sockets and chars. (def$method (tty-dialog-mixin :babylon-read-string) (&optional special-keys) (setq X 0) (setf exit "") (loop while (<= X 0) do (let ((char1 (...
by santiago
Wed Feb 06, 2013 8:42 am
Forum: Common Lisp
Topic: convert char to symbol
Replies: 17
Views: 25885

Re: convert char to symbol

sylwester works fine !!

This is what I need

Thanks
by santiago
Mon Feb 04, 2013 11:03 am
Forum: Common Lisp
Topic: convert char to symbol
Replies: 17
Views: 25885

Re: convert char to symbol

Hi, I need to return the literal or the symbol of a character... I can't return a char, because I return #\ and I can't return a string, because I return "". In this function: (defun return-a-char() (let ((mychar (read-char *standard-input*))) (format t "~:c" mychar) ) ) If I ent...
by santiago
Mon Feb 04, 2013 9:02 am
Forum: Common Lisp
Topic: convert char to symbol
Replies: 17
Views: 25885

Re: convert char to symbol

Hi. Something like that I need is using the format function: (defun working-chars () (let ((mychar (read-char *standard-input*))) (format t "~:c" mychar) ) ) But this print in the standard-output, the y character that I need, but I don't want to print to the output, I want to return the my...
by santiago
Mon Feb 04, 2013 8:10 am
Forum: Common Lisp
Topic: convert char to symbol
Replies: 17
Views: 25885

Re: convert char to symbol

Hi, I have this function that works fine with Java: (defun char1() (let ((mychar (read-char *standard-input*))) 'y ) ) But I need transform this function to return 'y (as a symbol), but using a variable (mychar). If I try to return mychar, I obtain #\y, and If I try to return a string, I obtain &quo...
by santiago
Sun Feb 03, 2013 10:55 am
Forum: Common Lisp
Topic: convert char to symbol
Replies: 17
Views: 25885

Re: convert char to symbol

Hi,

But I need that #\C is a variable, not a literal

Thanks
by santiago
Fri Feb 01, 2013 6:46 am
Forum: Common Lisp
Topic: convert char to symbol
Replies: 17
Views: 25885

Re: convert char to symbol

I Call the function like this: char-to-symbol(char)

Thanks
by santiago
Fri Feb 01, 2013 4:47 am
Forum: Common Lisp
Topic: convert char to symbol
Replies: 17
Views: 25885

Re: convert char to symbol

Hi,

When I try to execute this function: char-to-symbol, appears this error

APPLY: too few arguments given to CHAR

What this mean?

Thanks
by santiago
Thu Jan 31, 2013 8:40 am
Forum: Common Lisp
Topic: convert char to symbol
Replies: 17
Views: 25885

convert char to symbol

Hi, Related to this other post http://lispforum.com/viewtopic.php?f=2&t=4091 If have this function: (defun char1() (let ((mychar (read-char *standard-input*))) 'y ) ) always return: Y This other function: (defun char2() (let ((mychar (read-char *standard-input*))) mychar ) ) always return: #\y (...