Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Police Academy III
Nov 4, 2011

trex eaterofcadrs posted:

what v of clojure are you runngin cause


code:
user=> *clojure-version*
{:major 1, :minor 4, :incremental 0, :qualifier nil}
I was hoping I'd found the greatest bug ever :(

Adbot
ADBOT LOVES YOU

Police Academy III
Nov 4, 2011
tiny fart bug update: apparently it's caused by having a file called fart.class in your classpath (which obviously i do since i'm a literal child). i have no idea why defmethod is loading class files but i can't even report it since the clojure bug tracker is down!

Police Academy III
Nov 4, 2011

syntaxrigger posted:

  • means of controlling the working class(joke)

this but for serious

Police Academy III
Nov 4, 2011
speaking of checked exceptions, I ran across this today:

code:
/**
 * Throw even checked exceptions without being required
 * to declare them or catch them. Suggested idiom:
 * <p>
 * <code>throw sneakyThrow( some exception );</code>
 */
static public RuntimeException sneakyThrow(Throwable t) {
    // [url]http://www.mail-archive.com/javaposse@googlegroups.com/msg05984.html[/url]
	if (t == null)
		throw new NullPointerException();
	Util.<RuntimeException>sneakyThrow0(t);
	return null;
}

@SuppressWarnings("unchecked")
static private <T extends Throwable> void sneakyThrow0(Throwable t) throws T {
	throw (T) t;
}

Police Academy III
Nov 4, 2011

Tiny Bug Child posted:

let's. orms are dumb because there is no reliable way to turn a relational structure into an object-oriented one. everyone has probably read the vietnam of computer science already but it's good.

I like how he spends a whole page explaining what happened in vietnam, I might not have gotten his metaphor otherwise.

Police Academy III
Nov 4, 2011

vapid cutlery posted:

only thing i use windows for is games

this, but office + powerpoint sometimes too.

Police Academy III
Nov 4, 2011
Adventures in Clojure Day #420: Clojure has two completely different and largely incompatible systems for doing polymorphism, and the clojure community apparently prefers the less powerful of these. I seem to be the only person who thinks this is weird and dumb.

(also windos is great as a server for me to poop on etc, etc)

Police Academy III
Nov 4, 2011

trex eaterofcadrs posted:

multimethods and protocols?

yeah. i understand a lot of the reasoning behind protocols, but there's no reason they couldn't have added those features into the multimethod system instead of making an entirely new one completely from scratch. also given that you can't specify a superclass in deftype/defrecord, you've pretty much got no way to do inheritance with protocols.

(caring about programming languages itt :rms:)

Police Academy III
Nov 4, 2011

trex eaterofcadrs posted:

for better or worse ( i think better) clojure really tries to keep you from doing abstract/concrete superclass polymorphism at all costs. i actually like defprotocol/deftype myself so i guess i'm one of the dumb ones but i use a lot of spring so maybe that's why i use it so much

man, has the entire clojure community been infected with some sort of memetic virus or something? i think you're a smart guy trex, but polymorphism without inheritance has never been a thing anywhere. the only good reasons that i've seen to use protocols are speed and java interop, neither of which explains why everyone seems to regard multimethods as semi-deprecated or why protocols have to have a completely seperate syntax. they could've just made a special multimethod constructor that used java dispatch behind the scenes, but instead they decided to build an entirely seperate and redundant polymorphism system. i really don't get it

Police Academy III
Nov 4, 2011

vapid cutlery posted:

what the heck is duck typing???

duck typing doesn't force you to use inheritance, but it's still an option. clojure's protocols literally provide you with no way to specify any kind of inheritance. if you want two object to share the same behaviour you literally have to copy/past the same code.

e: literally

Police Academy III
Nov 4, 2011

yeah im trying to quit smoking and everything pisses me right off :argh:

Police Academy III
Nov 4, 2011

vapid cutlery posted:

you said polymorphism without inheritance has never been a thing anywhere

i meant polymorphism without the possibility of inheritance, ok dad?

Police Academy III
Nov 4, 2011
what's ur fav A* variant mine is jump point search

Police Academy III
Nov 4, 2011

Police Academy III
Nov 4, 2011

havelock posted:

tef, thanks for writing what I'm thinking (mostly) since I never got around to it.



Our weedout course was 2nd year and taught in SML. Functional scared off a lot of people. Though I guess the first year course where day 1 was "this course will be using java but we wont be teaching it to you because this is CS not Programming" probably scared some people off, too.

In ours we did hoare logic and finite automata, taught by a prof with a thick finnish accent and a stutter who posted absolutely nothing online.

Police Academy III
Nov 4, 2011

Aleksei Vasiliev posted:

http://holophrasticenterprises.com/
view source

edit: wtf, the page inverted its colors after i posted this. it was white bg black logo before

lol, looks like somebody found out about 1001_cool_fonts.torrent

Police Academy III
Nov 4, 2011

Shinku ABOOKEN posted:

serious post: what makes you guys think the programmer won't just do

case b of
good(butt) => touchit
| _ => ignore

?

"but what if this is used by a moron?" is not really a very good point against anything.

Police Academy III
Nov 4, 2011

Notorious b.s.d. posted:

i learned C as my first language circa age 10 because I had a C book and DJGPP was free. i cannot recommend this path

believe it or not pointers were very easy/obvious

the hard things were bitfields, bitwise ops, and fuckin malloc/free
where does the memory come from !?!?!?

i didn't know about e.g. stack/heap, and the book didn't explain it, so....

'sup learned C as first language buddy :hfive:

Police Academy III
Nov 4, 2011
I'm not sure if I'd call clojure optionally typed since no actual type checking goes on. there's nothing to stop you from doing (def ^int an-int "totally not an int") for example.

e: but seriously optional typing is really the most obvious way to get the best of both worlds and i wish more languages supported it. also actionscript is optionally typed, hilariously enough.

Police Academy III fucked around with this message at 01:29 on Mar 5, 2013

Police Academy III
Nov 4, 2011

abraham linksys posted:

code:
(let [bike-shed (atom (dom-binding/create-dom-map))
      binded-element (.querySelector js/document "#bindable")]
  (reset! bike-shed
          (-> @bike-shed
              (dom-binding/assoc-property! :color "purple")
              (dom-binding/add-dom-bind! :color :#bindable)
              (dom-binding/assoc-property! :color "red")))

idk dick all about DOM stuff, but you really should try to separate the mutable and immutable bits. I'd make pure functions that take and return your dom-map things and then just use swap! with them

edit:

quote:

but while in this case there's a better way to do it, the concept of passing a dereferenced version of your mutable state to a function, then changing that state to the result of the function (which is what the swap! function does) is really common in clojurescript and just feels almost like an abstracted version of object-oriented programming

yeah this, do this. idk what you mean about OOP but the biggest advantage of functional programming imo is not doing super clever map-reduce-filter bs, it's the added simplicity that immutability and pure functions/expressions give you.

Police Academy III fucked around with this message at 19:15 on Mar 8, 2013

Police Academy III
Nov 4, 2011

Win8 Hetro Experie posted:

I should check out rust but every time I try I get misdirected to some other PL with a short name that I can't remember right now

dart? i can't even keep track of these new languages anymore.

(and yet somehow no-one has managed to make a decent c++ replacement even though c++ is shockingly terrible)

Police Academy III
Nov 4, 2011
Lisp's problem is loving lispers. Clojure is the "best" lisp so far and even it is riddled with bad documentation and abandoned projects. Lisp attracts smart lazy people, but I'm starting to think you need overeager jeff atwood reading idiots to answer stupid questions on stackoverflow and make lovely twitter libraries if you want a language to be successful. (srs, I like clojure but I'm becoming less and less hopeful that it'll ever be anything more than a language for people who care too much about languages)

Police Academy III
Nov 4, 2011
The problem with a language that lets you just do whatever the gently caress you want is that you're stuck in a community with a bunch of people who are just doing whatever the gently caress they want.

Police Academy III
Nov 4, 2011

Win8 Hetro Experie posted:

when you're trying to mold your particular problem into the shape of a vertex shader function feeding data into a geometry shader function feeding data back into another vertex shader function which feeds data into a fragment shader function which finally writes the data as colors to a texture and that's just the first pass and it's not even given that you can read from a texture inside your vextex shader functions, I can sympathize if someone would rather just write the whole thing in C

maybe OpenCL is the answer

I used opencl once, it was pretty decent but a lot of boilerplate

Police Academy III
Nov 4, 2011

Mr Dog posted:

if you're using triggers you've made some seriously poor choices in ur life

Never join the infantry.

Police Academy III
Nov 4, 2011
im the :catdrugs:

Police Academy III
Nov 4, 2011

Zombywuf posted:

I quit smoking this weekend. Does it show?

horse mans posted:

haven't had a cigarette in over a month, have had one drink in the past fourteen days, and dealing with a bullshit stressful international move

i'mma champ

I too quit smoking recently. I don't have anything interesting to add, I just want to brag a bit.

Police Academy III
Nov 4, 2011
why oh why is this dongle poo poo in the PL thread and not in the thread specifically created to quarantine this poo poo? somebody start talking about hindley-milner or something

Police Academy III
Nov 4, 2011
checked exceptions would be great if the default behaviour was to just silently annotate your method with the appropriate exceptions instead of bitching and moaning because you had the gall to try to read a keypress without handling the possibility that the user's keyboard suddenly exploded or w/e

Police Academy III
Nov 4, 2011

Shaggar posted:

that's no good cause you need to decide if you want to handle them or not.

yeah, im deciding not to and i don't want the autistic compiler to demand i explicitly tell it every time i don't want to handle KeyBoardIsActuallyAGoatException

Police Academy III
Nov 4, 2011
reminder that java was literally invented by a pedophile: http://en.wikipedia.org/wiki/Patrick_Naughton

Police Academy III
Nov 4, 2011

tef posted:

COMPUTERS

they suck

Police Academy III
Nov 4, 2011
tbh, modern developer offices with free food and sleeping areas and whatnot are basically the equivalent of modern day monasteries where no-one ever leaves, talks, or has sex. just emaciated celibates hunkered over in dark cells expending the entirety of their mental capacity on the proscribed rites of some made-up bullshit rules system.

Police Academy III
Nov 4, 2011

hobbesmaster posted:

you're supposed to use jmp geez

white guys can't jmp

Police Academy III
Nov 4, 2011

Suspicious Dish posted:

no that's not the bad part (though it is bad)

how does assigning to a variable still keep the member variables of the other one around

idk, but I just found out that in python
code:
foo = "what"
def thing(): 
  print foo
thing()
prints "what", but
code:
foo = "what"
def thing():
  print foo
  foo = "nuts"
thing()
throws UnboundLocalError

Police Academy III
Nov 4, 2011

Nomnom Cookie posted:

Have they fixed lua's 1-based indexing yet

have they fixed lua's php-level "do everything but none of it particularly well" arrays yet?

Police Academy III
Nov 4, 2011

Zaxxon posted:

lua's arrays store values or references indexed by number pretty well.

a list is a sequential series of elements indexed by numbers. if you try to insert something into an index that isn't a number it should tell you to gently caress off instead of magically changing into something that sort of works like a list but isn't. if you do that then you're php level stupid.

also dijkstra thinks 1-based indexing sucks:
http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html

Police Academy III
Nov 4, 2011

Toady posted:

lack of control statements like continue and break

hahaha

Police Academy III
Nov 4, 2011
wait a minute, lua has break, it just doesn't have continue. why are you trying to make me look like an idiot toady?

Adbot
ADBOT LOVES YOU

Police Academy III
Nov 4, 2011

I'm as big a lisp dork as anyone, but if you're seriously considering sticking a scripting language into your system to let non-programmers try to program then you should probably go with javascript which at least has a large amount of documentation targeted towards idiots.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply