(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".
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
Worst case, you can run `M-x shell`, then inside the shell window, run `racket -f as.scm` . I assume you want to get SLIME working with Arc? I've never bothered.
If I'm confused, how do you run clisp/sbcl/ccl in Emacs?
Hi
Thanks for your reply.
Yes I want get slime working with Arc...
I run clisp/sbcl/ccl in Emacs as follow:
1-Using lispBox or lisp-cabinet.(with slime and quicklisp)
2.Using emacs with my own .emacs configuration.(with slime)
ly
I do keep meaning to get SLIME set up, but haven't actually tried yet. If you list what problems you run into, people will be able to help you more easily.
You know, every once in a while I consider setting up slime, or at least looking at it, but I've never used slime before and I don't really know what it offers.
What are your favorite features of slime, and why would I want to use it over just emacs + arc.el + repl-in-shell?
Hi
As there is no slime support for Arc I tried to load
arc.el to emacs but, it failed with this message:
arc.el:411:30:Error: Required feature `cl-macs' was not provided.
Hi
I'm using emacs Emacs 23.3.1 and cl-macs.el is installed.
I type arc-mode and I get Arc in the menu, but when i choose Run inferior-arc error message:error: Required feature `cl-macs' was not provide.
Thanks
What is arc.el? There's no arc-mode for Emacs that I know of. What are you expecting to happen when you type M-x arc ? Where did you get arc.el?
I wrote up instructions on how to get SLIME working with Arc, but I don't have a Windows box to test on. Can you translate the directions to Windows, and then see if it works for you? http://arclanguage.org/item?id=14998 Notably, you don't start SLIME by typing M-x arc-mode; you start it by typing M-x slime .
Ah. This isn't SLIME. As akkartik said, it's likely that no one here uses it. If you want to try SLIME, follow my instructions here: http://arclanguage.org/item?id=14998
I definitely use arc.el on a regular basis, though I won't claim to be familiar with the finer points of its capabilities. As far as I'm concerned, it offers reasonable highlighting and indentation for arc code; I haven't tried to get it to do much else. For most of my lisp editing needs, I rely on paredit.
What exactly are you asking? Are you looking for help learning Arc, or is this a discussion on how to help people learn Arc? Do you want sample programs for anything specific?
Personally, I'm put off by the Leading Caps Style of Writing Unless it's a Headline, but that doesn't mean it performs worse than the alternative.
It could be cool, especially if you make a landing page specifically for the campaign. You link the Arc tutorial at the top of tryarc.org, but if you had a page that was tailored at Arc newbies, that would be a much better user experience. For example, have a special REPL that prompted the user to type something, and then recognized when they did it: "To add 1 and 7, type (+ 1 7). Now you try:"
Thanks for the feedback. The caps style is actually my present split test. I have caps and non-caps variations running for each of my 6 ads right now and will see in a few weeks how their performance compares.
I think a tailored landing page is a great idea. I worry about it not being clear enough how to get started for the people who click through.
Fair enough on the caps issue. I can't argue with "if it works better...", even if I don't like it personally.
Who do you want to target with this campaign? People learning programming for the first time, people learning a Lisp for the first time, or Lispers new to Clojure (and Arc)? You'll require very different instruction pages for each group. I'd be happy to help you write something, if you're interested. I'm sure many of us here would be.
I'd love to get some collaboration from the community here.
I agree 100% about different group requiring different landing pages. Both of the ones you mentioned are good targets, I think. I'll do more keyword research to help dissect the audiences.
The beginning programmers' page is easiest, because pg's tutorial already targets them:
"This is a brief tutorial on Arc. It's intended for readers with
little programming experience and no Lisp experience. It is thus
also an introduction to Lisp."
All we have to do is put the tutorial in an iFrame next to the REPL, as thaddeus suggested. [1] I can take care of this one. (Eventually it would be cool to have an interactive tutorial though, as you suggested.)
Can I get your input on a page that targets a Lisper who's new to Arc? They can be coming from the Lisp dialect of your choice.
And what other audiences would you consider? Maybe people new to Lisp but coming from other programming experience, such as Ruby or JavaScript?
I noticed within your feedback forum there were suggestions for REPL window size changes (for both bigger and smaller) and I got to thinking that when I wrote PetroEnergyNews (http://petroenergynews.ca/map ... which has a similar bounding box look to it) I did a bunch of experimenting with different systems, different monitors and different screen resolutions before coming up with the following optimal combinations:
where the defaults were also the best suited to the iPad.
If you would like you can create an account on PetroEnergyNews then go to the user preferences to select the various combinations to get a feel for these sizes.
The "Widest" by "Tallest" setting is perfect for my 27 inch iMac screen :)
Anyways hopefully this info is helpful/useful.
[edit:
1. oops, that's only the map inset window, so it doesn't include the top and bottom bars, but still they should be easy to guesstimate at about 24px each.
2. I guess the width really doesn't matter when you can just set to 100%, but it may help with the height settings?]
Fyi, your other comment on this thread (http://arclanguage.org/item?id=14886) is dead. It was obviously a valid post, but it apparently tripped the detector.
I took some sample code from my solution to Project Euler #21. This function determines whether the argument n is an amicable number -- that is, if you add up all its divisors, you get a number, and then you take that number and add its divisors, and you get n. The lowest amicable pair is (220, 284). Anyway, the code:
(def amicable (n)
(let step (sum-divisors n)
(and (isnt n step)
(is n
(sum-divisors (sum-divisors n))))))
I don't see it as a win. The function call is taken out of the first position, and placed later in the line. This puts undue importance on the first argument. Unlike Java, Ruby, and Python, you don't even have object orientation (read: single dispatch) to make that first argument actually more important. I prefer the function to be first, as that's the most important thing in the line of code. It tells me what's going on, and how to read the line. With functions being second in the line, I have to parse more of the line before getting a grip on the overall meaning of the line.
When nesting tables in Arc, you write something like this:
((nested-table user-id) name)
How would this look in new-syntax?
name.user-id.nested-table()()
or
name.(user-id.nested-table())()
or
(user-id.nested-table() name)
Right now in Arc, you can do this:
nested-table.user-id.name
It seems cleaner, at least for this example.
What do you see as the advantages of this syntax, beyond the fact that people will kneejerk less to Lisp style? Can you show us some code that looks better written in new-style?
I agree overall, but... I will note that object orientation is possible, for instance with my "object.arc" library[1]. However, I don't use the "." syntax for that either... for instance, this in JavaScript:
foo.bar(qux);
Would be this, with my library:
(foo<-bar qux)
However, it may be cool to be able to write "foo.bar(qux)" with my library instead. I've also considered a pretty radical idea, having every function dispatch to a method on an object. So this:
(car foo)
Would translate to this, automatically:
(foo<-car)
In any case, I agree that with functional style, I prefer Arc's syntax. But assuming somebody were to write/use an OOP library for Arc, I can see why they would prefer a more traditional syntax.
I think, ideally, Arc should allow you to change the syntax, on a file-by-file (expression-by-expression?) basis. Then the default could be what it is right now, but still allow people to write with whatever syntax they want. Arc isn't there yet, but I think that's a nice ideal to strive for.
With sweet expressions, you can write "foo(bar)" rather than "(foo bar)", but it still allows you to use "(foo bar)" when you want to. In other words, it lets you mix-and-match Lisp syntax and more traditional syntax, even within the same file. So you can use whichever one happens to be most readable at the time.
I've been working on how to hit a webpage in arc using the underlying scheme tcp-connect function. This code -- Racket, not Arc -- will hit google, get its source, and print it on standard out:
I've been having trouble getting it all to work in arc by hacking ac.scm with some 'xdefs. I can get 'tcp-connect to read just fine, but 'eof-object doesn't seem to ever return true. I'm going to try this weekend, and I'll see what I can find. Here's the working 'xdef for tcp-connect:
A while ago I tried to get www.google.com using Anarki's web.arc (https://github.com/nex3/arc/blob/master/lib/web.arc). It appended a spurious "?&" to the end of the URL, but once I hacked in a fix to keep that from happening, it worked just fine. (Well, I think I encountered one more issue occasionally: If there's absolutely no response, even headers, 'parse-server-headers blocks forever.)
To read the response body, web.arc just says (tostring (whilet line (readline in) (prn line))). Apparently it there's EOF detection somewhere in this process....
Sorry I'm not providing working code, or even a reliable memory. XD I suppose I'll try things out again tonight and commit any fixes back to Anarki.
Oh, web.arc already worked with Google. Since the last time I tried this, I think Google must have updated to accept http://www.google.com/?&; as a legitimate home page URL.