I don't think we've received this question before, but try starting them on separate ports and use apache or nginx rewrite rules to map say <site>/blog to the new port. Do you already use apache or nginx to hide the port in the url?
The list of stories on the frontpage is generated by the function topstories. That's where you'll want to join a sticky post, either hardcoded or saved in a separate file like the arc/news/topstories file.
Disabling comments seems a little more involved. You'll need to add an attribute (say allowcomments) to the item deftem, and then check for it in:
a) displaying the commentlink in display-story, and
b) comments-active, which is checked before displaying the comment-form
Ok, great, thanks for reply! I'm still really new to arc so, to be honest, it doesn't really make sense without looking at the actual. Hopefully, later today/this week, I will have some time to sit down and really look into things. Once I get something functioning I will definitely send a pull request.
Lisp In Summer Projects hasn't made a list available that I know of. Certainly they will announce the winners; I don't know if they'll announce all the projects. Hopefully.
Yup! I looked for it a bit, couldn't find it, tried to post the top-level website, got caught by the dup detector, and ended up posting the thread that brought it back to my attention :)
Yeah these are good suggestions. The "address already in use" error suggests that you might have multiple copies of arc running, so that you're making changes to the wrong copy. Use the commands 'ps' and 'kill' to look for the other copies and stop them.
I used the command
ps aux | grep 'news.arc'
and it returned only one copy running, but I suspect that's not right.
And your comment about multiple copies also got me thinking that from the main Arc directory to go into the Arc prompt maybe I shouldn't have been using
$ mzscheme -f as.scm
Was I supposed to use that just once to run news.arc for the first time?
Assuming you're using 'GNU screen' you also have the option to re-attach to an existing session using the 'screen -r' command. Using 'screen -ls' will list out all the sessions should you not be sure, or have more than one.
That aside, most developers will do development changes on a local machine where they need not attach/reattach and this way you wouldn't need to troubleshoot your code and the host environment at the same time.
Then you create a stable deployment process. eg. Backup the old code, drop in the new code, re-attach to the existing session and either load your changes or restart the program if you're ok with some nominal downtime.
Did you mean in some other language? It's easy to build a test harness, it's usually the first thing I do with a new language, and invariably just a few lines of code.
(It's not a normal C++ project. I use readable diff directives inside :(..) to add the test harness to the skeleton program at https://github.com/akkartik/wart/blob/cc70d66ee6/literate/00.... But now that this is done, any function I write with 'test_' is automatically run in test mode. Look at the makefile to see how I do that with minimal code.)
Anyways, tell me what language and I'm sure we can get you quickly past this hurdle.
Honestly, there are some fiddly bits about the unit test framework I don't like, but mainly I wanted to write one.
I actually applied with it for Lisp In Summer Projects (http://lispinsummerprojects.org/), which is why I haven't announced it -- you're supposed to do the work yourself, without help. And people here like to help out and post code. :-p
Luckily, at this point it's got the main features I want, so I can actually use it.
Sweet. I had been wanting to play around with the unit test code too -- i'm excited to see what you've put together.
The oauth utility is also for the LISP contest -- we'll see how far I get over the next few weeks.
Either way I'm planning on uploading a few bits and pieces to Anarki or my own repos over the next couple of weeks. (spent some time on anarki's web.arc, the state machine stuff, oauth, some lazy evaluation stuff, etc...)
Please let me know what you think -- email in profile, comment here, open bitbucket tickets, find me on the street^1, etc.
[1] Actually, after writing this, I read your profile, and found you're in Hacker School. I'm in nyc too -- we should meet up sometime. Shoot me an email.
That makes sense :) I'd love to hear more about what's fiddly about the existing version (I have different versions at http://github.com/akkartik/arc, etc.) and why you need the features (suites, nested suites, failure messages, anything else?)
I'm going to have to go to bed soon, as I need to wake up in eight hours and twenty minutes, and I've promised myself I'm going to try to sleep enough, for once.
So I'll just explain what, in my mind, is the biggest difference -- how I want to use it. To run the anarki test-iso test, you execute the entire `(test-iso ..)` sexp. If you want to run a bunch of tests, you have to execute all the sexps.
That's kind of a hassle. Especially if you find a bug, have a bunch of tests that fail, then change a small thing in the function, and want to re-run all the tests.
In my unit-test.arc, all you have to do is call `(run-suites suite-name)`, and it'll run as many tests as you've got in `suite-name`. You don't have to copy a bunch of sexps into the repl or reload the file (and what if you want to run a subset of a file? You can't). Also -- and this is one of the features I'm currently working on (https://bitbucket.org/zck/unit-test.arc/issue/21/after-runni...), what if you run one hundred tests at once? Do you really want to parse -- with your eyes, like a bloody scribe -- every single line of output to find the seven tests that broke? And when you then make a fix, you're not going to want to parse them again, so you'll only run the seven that failed before. So if you broke something else, you won't find that out.
So, what falls out of my desire to run a set of tests easily and repeatably, and have summarized output? Some sort of grouping, with a single point of entry to run the tests -- that is to say, test suites.
Please correct me if I've missed any feature of Anarki's test framework. I did read its code and try it, but I didn't look into other files for supporting functionality.
Thanks! You're absolutely right, I've had every single one of these problems, I just never focused on them. But I'd often comment out a bunch of tests in the middle of debugging just one.
The issue is with automaton; you're trying to use a macro (mkrule) like a function with map1. Did you turn mkrule into [mkrule _] because you got this error?
Can't coerce #(tagged mac #<procedure: mkrule>) fn
Simply using square brackets isn't going to fix that.
---
In general, creating macro helpers for macros is harder to debug. Instead create function helpers to create the right code as a list and invoke it within the top-level macro to turn it into code. Here mkrule should probably be a function.
(This is what people usually mean when they say *don't overuse macros". And then the dictum gradually gets over-generalized into "macros bad" and finally, "lisp? blub blub.")
Good error reporting is pretty disagreeable to me, lol. :-p
I think Arc's main advantages over Scheme, once all the Arc-like naming conventions and macros are in place, are setforms, defcall (not in pg's Arc), and the ssyntaxes (a:b c), a.b, and a!b. Going by the examples, Rark has setforms, and its ability to unwrap data structures using function calls indicates defcall wouldn't be hard to add if it isn't there already, but I don't see anything about ssyntax. I've been meaning to download and run Rark to see if ssyntax support is actually there after all.
The abstract "Scheme" I'm talking about might have a certain advantage over Racket, but I might just be doing it wrong: Is possible to write a macro and use it in the same file? I've had to break my utilities into three files just to have multiple layers of macros. I'm interested in seeing whether Rark makes this any easier.
It's currently missing extensible setforms, but all the standard ssyntax and brackets should work. They're detected and expanded (awkwardly right now) at the reader level.
It's hard to say since Arc doesn't have a formal spec. The end goal is for everything to just work like it would in pg's Arc. I'm slowly working toward that goal.
Right now, Arc s-exp editing macros are straight-up unsupported. In addition to pattern matching, you have to explicitly break hygiene with leak and bind:
BTW, a friend mentioned that APL does indeed have an 'english' mode as a debugging aid. Perhaps it's indicative that people are using the more concise notation in spite of the availability of alternatives.