Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Your fave variable

Name: Anonymous 2010-03-31 9:46

I'll start

var dickie

Name: Anonymous 2010-03-31 9:47

This seems familiar.

Name: Anonymous 2010-03-31 9:50

$_

Name: Anonymous 2010-03-31 10:18

I recall that guy who named variables after pokemon.
Hope he doesn't have emotional relationships with them.

Name: Anonymous 2010-03-31 10:42

>>4
He probably cries whenever he has to free a pikachu.

Name: Anonymous 2010-03-31 11:43


int i;
char c;
float f;
void *ptr;
//and so on

Name: Anonymous 2010-03-31 12:04

int i = 0, j = 0;
They're my favorite looping buddies.

Name: Anonymous 2010-03-31 12:12

Whenever I write object methods in Perl, I always name the object $o.
But when I fake object methods in C, it's always k. I don't remember why.

Name: Anonymous 2010-03-31 12:13

z and w, they don't get enough love.

Name: Anonymous 2010-03-31 12:58

long anus;

Name: Anonymous 2010-03-31 13:07

int dicks;
char *dicks;

etc...

Name: Anonymous 2010-03-31 13:28

Common variable names that I use are: x function string list, where x is usually the only argument of a lambda which is passed around (mapping/reducing/...), and function and string are arguments of the implied type.

Not unlike code like this:

(mapcar #'(lambda (x)
            (unless (predp x)
              (with-stuff
                  (do-something x))))
        list)

Maybe I should instead use a reader macro like [* _ 3] to represent (lambda (x) (* x 3), but I'm not sure it's worth it as I already have a handy keychord to make a new lambda for me.

Name: Anonymous 2010-03-31 13:37

I am a Haskellonian, so I only name my variables /[a-z]'*/. My favourite is x''.

Name: Anonymous 2010-03-31 13:45

>>12
Why use a reader macro and not just a normal macro like Scheme's cut[1]?

--references--
1. http://srfi.schemers.org/srfi-26/srfi-26.html

Name: Anonymous 2010-03-31 16:57

>>14
I don't usually use non-standard reader macros much, although I've written quite some fancy ones as exercises. The reason is because it usually makes one's code look unidiomatic and maybe even strange to someone not used to your reader macros and that macro characters themselves carry a large cost (like syntax in general does). Since it's usually possible to do almost everything(but not everything - for example fine-tweaking symbol interning behaviour without reader macros can be harder) using normal macros, I usually reach for a normal macro before I dare reach for a reader macro (and if I ever do write a reader macro, I usually have it expand into a macro or function call anyway).

The whole [_ ...] thing is actually a suggestion I saw on a certain someone's who still needs to gives us a certain CROMA Lisp's blog.

As for cut. I have to say it looks rather cool. I may use it instead of the usual rcurry/lcurry that I tend to use for such situations. Implementing it in CL also seems reasonably simple to me, altough some slight adjustments need to be made to account for Lisp-2'ness of CL (for example (cut <> a b) would need to be made into a (lambda (g) (funcall g a b)), but this special treatment shouldn't be terribly hard to implement).

Name: Anonymous 2010-03-31 17:11

The whole [_ ...] thing is actually a suggestion I saw on a certain someone's who still needs to gives us a certain CROMA Lisp's blog.
It also appears to be in arc
from http://ycombinator.com/arc/tut.txt

Since functions of one argument are so often used in Lisp programs,
Arc has a special notation for them.  [... _ ...]  is an abbreviation
for (fn (_) (... _ ...)).  So our first map example could have been
written

arc> (map [+ _ 10] '(1 2 3))
(11 12 13)

Name: Anonymous 2010-03-31 17:25

In C and C-like languages, I prefer to name iterator variables as int x, y, etc; as opposed to the PIG DISGUSTING int i, j, etc;

Name: Anonymous 2010-03-31 19:38

when I have to do php stuff

[code]
$thick = array();
//fill array

foreach($thick as $abrick) {
    //
}

Name: Anonymous 2010-03-31 20:02

>>4
I am now doing this for every program assignment

Name: Anonymous 2010-03-31 20:17

[bp-2]

Name: Anonymous 2010-03-31 20:28

>>16
Well then. If it's in Arc, we know it's a bad idea.

Name: Anonymous 2010-03-31 21:56

>>17
I think you need to stick to C_PLOX_PLOX

Name: Anonymous 2010-03-31 22:18

Name: Anonymous 2010-03-31 22:52

static int once = 1;

used like this:
if (once) {
    doSomething();
    once = 0;
}

my real favorite is int i;

Name: Anonymous 2010-03-31 23:37

Name: Anonymous 2010-04-01 1:17

>>25
You misfired a little.

Name: Anonymous 2010-04-01 5:21

My favorite variables are those with names which are completely perpendicular to what they are actually doing.

Name: Anonymous 2010-04-01 8:12

>>26
MISFIRE MY ANUS

Name: Anonymous 2010-04-01 9:53

>>27
And orthogonal?

Name: Anonymous 2010-04-01 15:07

>>27
Like car and cdr!

Name: Anonymous 2011-02-03 6:51


Don't change these.
Name: Email:
Entire Thread Thread List