Hi
I'm new to Arc and to learn it I try to translate common-lisp code to Arc.
I'm using LandOfLisp book.
I had to change some codes as mapcar to map
apply and append to mappend and it workes.
But I can't find a substitute to remove-if-not
function.
Please help...
Thanks
ly
Hi
Thanks.
'keep is good but it does not work with my code as I use a loacl function inside before using 'keep.
So what to use instead of labels or flet in ARC ?
Thanks again
ly
(if (< (rand) 0.5)
(do (prn "No, Mr. Bond, I expect you to die...")
(-- mi6 007)))
Some of your questions may be answered if you read through the tutorial: http://ycombinator.com/arc/tut.txt There's stuff you won't pick up on the first time that you'll want to know later.
>2.find with a :key in Arc
An example in Common Lisp, just to make sure we're talking about the same thing:
As a side note, you asked [2] about getting SLIME set up on Windows. I wrote up a guide on how to set it up on Linux; you can probably plunder it for information about how to set it up on Windows. I also had a few questions about your setup; it's not at all like mine.
[1]Yes, this is just 'when. Shush, it's an example.
Hi zck
Thanks a lot .
Problems of find with :key and progn in Arc solved.
About emacs and Arc still don't work.
I use emacs for common-lisp with lisp-cabinet.
For an editor I use scite which i configured to work with Arc(I had to make write some scripts with AutoIt)
Thanks again
ly
Could you answer my questions in your other thread? http://arclanguage.com/item?id=15002 It's really hard to try to help you without more details than "emacs and Arc still don't work".
Do you refer to the fact that Arc's readline is a bit funky when handling blank lines [and that if you're reading from the terminal, it interprets the input as starting at the end of the s-expression on the current line, so the first character it reads will be the newline], as in:
arc> (n-of 5 (readline))
cheese
is
good
and
blah
("\ncheese" "\nis" "good" "and" "blah")
; SBCL
* (n-of 5 (read-line)) ;n-of isn't standard CL, of course
cheese
is
good
and
("cheese" "" "is" "good" "and")
Or are you talking about the various extra little options you can supply to "read-line", like "eof-error-p" or "recursive-p"? [For reference: http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node195.html] Can you describe precisely what is it that you want read-line to do? (It can then be implemented in terms of primitives like readc and peekc. Documentation: http://files.arcfn.com/doc/io.html)
I think newlines you're entering into your console are \r\n, and you're using a version of 'readline that only supports \n newlines (and treats \r as a normal character). Andrew Wilcox has made a fixed version: http://awwx.ws/readline1
Furthermore, you're reading from stdin, the same stream the commands are read from, so what you're reading actually starts right after the ')' character and includes the same newline you used to enter the command. I think someone here might have made a fix for this too (probably Pauan or aw), but you might be able to work around it like this:
arc> (do (readline) (...now your *actual* stdin-reading code...))
The first (readline) should hopefully get rid of whatever was left over from the input after reading the command.
Hi
readline1 dose not function as read-line in common lisp.
I type (read-line) and and arc is waiting to enter something so I type my string including spaces like:
Hi there.
output is:
"Hi there"
NIL
Thanks
ly
Right, I expect the version I linked you to doesn't behave exactly like Common Lisp's readline. I just hope it can help. :)
I don't fully understand your example. Did you try something like (do (readline) (readline)), like I was talking about? I'm guessing that since Arc's REPL takes commands and other input from the same stream, it's already different from the REPL you're used to, regardless of how readline works.
You can insert links like *this*... http://arclanguage.org/formatdoc
...separate paragraphs like *this*...
...and indent code like *this*:
You can insert links like *this*... http://arclanguage.org/formatdoc
...separate paragraphs like *this*...
...and indent code like *this*:
Please, please, please give us more information when you have a question. If you want a 'readline exactly like Common Lisp's 'read-line, you'll have to write it yourself. If you want specific features, tell us what they are. It's hard to help when we have to guess what you actually want.
Arc code can be terse; English shouldn't be unnecessarily so.
Hi zck
Yes, I mean read-line like common lisp.
As I'm only learning arc, it will be not easy to me to write it, but I will try as i will be more familiar with Arc.
I like arc as it's code is simpler than common-lisp and is more readable.
ly