There’s absolutely no advertising on reddit. Why and what would it take for us to begin seeing ads on reddit?
AO: There’s absolutely no advertising on our front page, but our comments pages do have Federated Media ads. We heart FM.
Well, the no ads on the frontpage is no longer true, but I guess that one well-placed ad is better than a bunch of annoying floats / popover banners. Reddit has been making a profit for a while now.
It's the start of a new project for me (and hopefully later on a postdoc position on the topic). The idea is to build some kind of smart animals in an artificial world, without having to design them, or run through countless of iterations with genetic algorithms to get one.
With a good basic structure, they should be able to get smart on their own ;).
In ruby the lack of a ! at the end of a method isn't a guarantee that a function changes (caught me a few times by surprise). It is just used to distinguish between a state-changing version and nonstate-changing version. The reason for that was to limit the number of !! in your code.
Ugh, as lojic pointed out (thanks for that :)), some sleep-deprived errors in this post. The more correct version:
In ruby, the lack of a ! at the end of a method isn't a guarantee that a function doesn't modiefy state.
And you're right about (+ counter 1). Blindly remembered the example I got in the ruby forum when I was surprised that some method modified state without a warning !.
I've a function that binds a list of lists to to variable 'world', and a function that prints out this world.
(def makeworld (x)
(let z nil
(repeat x (= z (cons nil z)))
(repeat x (= z (map [cons nil _] z)))
(= world z)))
(def show ()
(each x world
(each y x
(pr (if (is y nil) #\. y) #\space))
(pr #\linefeed)))
The world can then be seeded with trees, or shrubs or monsters or whatever. Anyway, as the world is a list of lists, it functions as a two-dimensional array.
If in arc I want to access a point in this two-dimensional list / array, I need to enter ((world 0) 3), and the basic question was how to change arc (macrowise) to make (world 0 3) be equivalent to ((world 0) 3). I already worked around it by now.
To answer your question: you're assuming that there is a list called 'list', and in my initial example I described a function that took the name of the list as first argument.
The problem with multiple values being subsequent accesses is it would also interfere with a useful syntax (not actually in Arc, but I mean insofar as deciding which it should mean), and that's subsequence indexing. It's been discussed all over the place, e.g. http://arclanguage.org/item?id=449
With the assumption that one of them takes that syntax, what should be used for the other? How about (seq '(0 3 ...)) or (seq (0 3 ...))? It would similarly be fitting for any number of arguments, be they dimensions or indices, though I would vouch to use the list for n-dimensional indexing as the case of subsequences seems more common. Plus the use of a list distinguishes the one type of access from the other without having to go (...((seq 0) 3) ...).
Not that any of this helps your problem. Just something I noticed.
Oh, I get it. No, this is not something you can do with macrology because there is no room for a macro in your desired syntax (where you just want the list itself and the index values). As you say, if you'll make room for another token it can just be a function (which would be fun to generalize to N dimensions). As for making ((list (list 42)) 0 0) return 42, I think you need to is suggest it as a (very reasonable) enhancement to Arc.
simplicity. I want (and I think I've seen enough examples of code now to write a macro to do so).. I want to be able to say / think / write this:
(if (calculation gives wanted result) (assign calculation to variable)).
saying / thinking / writing your version just puts the language in the way of what I want to write down.. and even though the difference is minimal, all these little kind of things can add up and obfuscate your code.
(store calculation as variable
(if (variable gives wanted result) (assign calculation to another variable))
General idea of the post was just to try and find bits and pieces where the language can be smoothened.