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
Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


wolffenstein posted:

Always assume it will go into production, because it almost always will.

The lesser-known corollary of "Development is Production."

Adbot
ADBOT LOVES YOU

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Volmarias posted:

Awful app is making it impossible to output & lt; without spaces. Even tried replacing & with & amp; :eng99:

Whoops, I'm on it.

Very surprised not to see the app come up earlier in this thread.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

pokeyman posted:

Whoops, I'm on it.

Very surprised not to see the app come up earlier in this thread.

I have no idea what the internals look like but I think it's pretty well designed as an end user.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

That Turkey Story posted:

There's #elif in the C and C++ preprocessor.

Programming Perl posted:

Note also that "elif" is "file" spelled backward. Only Algol-ers would want a keyword that was the same as another word spelled backward.

ymgve
Jan 2, 2004


:dukedog:
Offensive Clock
We have elseif, elsif and elif. Does any languages use eif?

Squimmy
Aug 7, 2012

ymgve posted:

We have elseif, elsif and elif. Does any languages use eif?

What about elf?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



ymgve posted:

We have elseif, elsif and elif. Does any languages use eif?

What about the other direction?

otherwise, alternatively, ???

Zhentar
Sep 28, 2003

Brilliant Master Genius

ymgve posted:

We have elseif, elsif and elif. Does any languages use eif?

in MUMPS, e if is a syntactically valid else if (although the style is a bit unusual).

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

Munkeymon posted:

What about the other direction?

otherwise, alternatively, ???

XSLT's equivalent for select/case/default is choose/when/otherwise.

ozymandOS
Jun 9, 2004
edit: nevermind, I am dumb

kitten smoothie
Dec 29, 2001

Zhentar posted:

in MUMPS, e if is a syntactically valid else if (although the style is a bit unusual).

I haven't written in MUMPS but from what I've seen of it, everything looks a bit unusual.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Munkeymon posted:

What about the other direction?

otherwise, alternatively, ???

perl has unless

Perl code:
die unless ($keepgoing);

Scaevolus
Apr 16, 2007

pokeyman posted:

Very surprised not to see the app come up earlier in this thread.
The main Awful horror is how it maxes out the CPU sometimes when you switch away from it.

Kilson
Jan 16, 2003

I EAT LITTLE CHILDREN FOR BREAKFAST !!11!!1!!!!111!

pokeyman posted:

Very surprised not to see the app come up earlier in this thread.

The app got stuck in some sort of loop the other day for me, where it would continually try to refresh whatever forum I was viewing, and it couldn't understand the page counts. Even rebooting the phone didn't fix it, I had to uninstall the app and reinstall for it to work properly again.

Shugojin
Sep 6, 2007

THE TAIL THAT BURNS TWICE AS BRIGHT...


Scaevolus posted:

The main Awful horror is how it maxes out the CPU sometimes when you switch away from it.

I dunno, my favorite story like that is the time I was testing Songbird and just watched it memory leak away at about a megabyte/second. I think I got bored watching it and killed it at around 2 gigs used.

Xerophyte
Mar 17, 2008

This space intentionally left blank

Munkeymon posted:

What about the other direction?

otherwise, alternatively, ???
In Haskell it's idiomatic to use otherwise for what's basically else:
code:
even n
  | n `rem` 2 == 0 = True
  | otherwise      = False
Well, even = (0 ==) . (flip rem 2) is arguably more idiomatic but nevermind...

The clauses after the '|'s are evaluated in sequence and the first clause that evaluates to True has its branch taken, so it's functionally (:v:) equivalent to an if .. else if .. else chain. otherwise is literally defined as otherwise = True.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Volmarias posted:

I have no idea what the internals look like but I think it's pretty well designed as an end user.

The prefix on everything is "Awful", so you get AwfulTheme, AwfulURL, AwfulAppDelegate.... It's fun to start a new file with such low expectations of quality.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Xerophyte posted:

In Haskell it's idiomatic to use otherwise for what's basically else:
code:
even n
  | n `rem` 2 == 0 = True
  | otherwise      = False
Well, even = (0 ==) . (flip rem 2) is arguably more idiomatic but nevermind...

The clauses after the '|'s are evaluated in sequence and the first clause that evaluates to True has its branch taken, so it's functionally (:v:) equivalent to an if .. else if .. else chain. otherwise is literally defined as otherwise = True.

I really need to finish that Haskell tutorial - I can almost read that second one.

e: Get the first one just fine, though. I fond that idiom very intuitive for whatever reason.

Munkeymon fucked around with this message at 22:48 on Mar 8, 2013

Zombywuf
Mar 29, 2008

Munkeymon posted:

I really need to finish that Haskell tutorial - I can almost read that second one.

If you feel it's getting to easy for you try Agda.

I mean, it's really cool but :psyduck:
code:
infix 4 _≟_

_≟_ : Decidable {A = ℕ} _≡_
zero  ≟ zero   = yes refl
suc m ≟ suc n  with m ≟ n
suc m ≟ suc .m | yes refl = yes refl
suc m ≟ suc n  | no prf   = no (prf ∘ PropEq.cong pred)
zero  ≟ suc n  = no λ()
suc m ≟ zero   = no λ()

≤-pred : ∀ {m n} → suc m ≤ suc n → m ≤ n
≤-pred (s≤s m≤n) = m≤n

_≤?_ : Decidable _≤_
zero  ≤? _     = yes z≤n
suc m ≤? zero  = no λ()
suc m ≤? suc n with m ≤? n
...            | yes m≤n = yes (s≤s m≤n)
...            | no  m≰n = no  (m≰n ∘ ≤-pred)
(this is basically so you can do elsif in Agda (for natural numbers))

EDIT: Damnit Radium! tbh it's no clearer with the original characters though: http://www.cse.chalmers.se/~nad/repos/lib/src/Data/Nat.agda

Zombywuf fucked around with this message at 20:08 on Mar 8, 2013

Xerophyte
Mar 17, 2008

This space intentionally left blank

Zombywuf posted:

If you feel it's getting to easy for you try Agda.

I mean, it's really cool but :psyduck:

If anyone actually wants to try to learn Agda then a: I pity you and b: I feel I should point out that the standard library does come in a hyperlinked version that makes checking out what the assorted squigglies in it actually do somewhat easier. On the tutorial side there's Brutal [Meta]Introduction to Dependent Types in Agda which is pretty current -- I think most of the examples even compile.

Note: consider not trying to learn Agda.

ninjeff
Jan 19, 2004

Zombywuf posted:

If you feel it's getting to easy for you try Agda.

I mean, it's really cool but :psyduck:
code:
infix 4 _≟_

_≟_ : Decidable {A = ℕ} _≡_
zero  ≟ zero   = yes refl
suc m ≟ suc n  with m ≟ n
suc m ≟ suc .m | yes refl = yes refl
suc m ≟ suc n  | no prf   = no (prf ∘ PropEq.cong pred)
zero  ≟ suc n  = no λ()
suc m ≟ zero   = no λ()

≤-pred : ∀ {m n} → suc m ≤ suc n → m ≤ n
≤-pred (s≤s m≤n) = m≤n

_≤?_ : Decidable _≤_
zero  ≤? _     = yes z≤n
suc m ≤? zero  = no λ()
suc m ≤? suc n with m ≤? n
...            | yes m≤n = yes (s≤s m≤n)
...            | no  m≰n = no  (m≰n ∘ ≤-pred)
(this is basically so you can do elsif in Agda (for natural numbers))

EDIT: Damnit Radium! tbh it's no clearer with the original characters though: http://www.cse.chalmers.se/~nad/repos/lib/src/Data/Nat.agda

I can feel the software engineering principles oozing off the page into my brain :lsd:

Jonnty
Aug 2, 2007

The enemy has become a flaming star!

ninjeff posted:

I can feel the software engineering principles oozing off the page into my brain :lsd:

Are you getting it mixed up with Ada?

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

Carthag posted:

perl has unless

Perl code:
die unless ($keepgoing);

Logo also has unless.

Factor defines the combinator if like ( true-quot false-quot flag -- ), and then has derived combinators when and unless for times that you only need a behavior for one "half".

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

ultramiraculous posted:

The prefix on everything is "Awful", so you get AwfulTheme, AwfulURL, AwfulAppDelegate.... It's fun to start a new file with such low expectations of quality.

I guess that's the Smurf Naming Convention in the wild.

Captain Capacitor
Jan 21, 2008

The code you say?

prefect posted:

Note also that "elif" is "file" spelled backward. Only Algol-ers would want a keyword that was the same as another word spelled backward.

Well bash has "case" and "esac", "if" and "fi"...

Deus Rex
Mar 5, 2005

Captain Capacitor posted:

Well bash has "case" and "esac", "if" and "fi"...

which, crazy enough came from ALGOL 68

http://programmers.stackexchange.com/questions/152453/are-backwards-terminators-for-if-and-case-unique-to-shell-scripting

quiggy
Aug 7, 2010

[in Russian] Oof.


Also the symbolic math program Maple has do/od and for/rof. I think it's got one or two more that haven't been mentioned too but I don't often write proper scripts in it.

qntm
Jun 17, 2009

Carthag posted:

perl has unless

Perl code:
die unless ($keepgoing);

Perl even has unless { ... } else { ... } although thankfully there is no elsunless. Yet.

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

Xerophyte posted:

In Haskell it's idiomatic to use otherwise for what's basically else:
code:
even n
  | n `rem` 2 == 0 = True
  | otherwise      = False
Well, even = (0 ==) . (flip rem 2) is arguably more idiomatic but nevermind...

I'm not a fan of flip in this context, if you're taking a section anyway you might as well write it as even = (0 ==) . (`rem` 2)

Volte
Oct 4, 2004

woosh woosh
Maybe instead of trying to be ultra clever you should just write even n = n `rem` 2 == 0 like a normal person.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



qntm posted:

Perl even has unless { ... } else { ... } although thankfully there is no elsunless. Yet.

Mix in some lazy eval in the conditionals and that'll make a mighty fine horror indeed.

Opinion Haver
Apr 9, 2007

Volte posted:

Maybe instead of trying to be ultra clever you should just write even n = n `rem` 2 == 0 like a normal person.

But my pointfree style!

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

qntm posted:

Perl even has unless { ... } else { ... } although thankfully there is no elsunless. Yet.

Well, there's unless ( ... ) { ... } elsif ( ... ) { ... } else { ... } which is arguably worse because now we're mixing positive and negated conditionals.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
All of Perl's alternative conditionals are horrors and people who use them are bad.

Shugojin
Sep 6, 2007

THE TAIL THAT BURNS TWICE AS BRIGHT...


The entirety of Numerical Recipes in C and how they didn't completely port it from Numerical Recipes in FORTRAN so every single loving bit of array math starts at 1 instead of 0 so you need to constantly shift so that it accesses what you want :suicide:

fritz
Jul 26, 2003

Shugojin posted:

The entirety of Numerical Recipes in C and how they didn't completely port it from Numerical Recipes in FORTRAN so every single loving bit of array math starts at 1 instead of 0 so you need to constantly shift so that it accesses what you want :suicide:

I think the entirety of Numerical Recipes, period.
http://www.stat.uchicago.edu/~lekheng/courses/302/wnnr/nr.html
http://www.lysator.liu.se/c/num-recipes-in-c.html

ninjeff
Jan 19, 2004

Jonnty posted:

Are you getting it mixed up with Ada?

Yes I am. That's the real horrorsoftware engineering principles at work.

uncleTomOfFinland
May 25, 2008

http://forums.somethingawful.com/showthread.php?threadid=3536634&userid=0&perpage=40&pagenumber=118#post413259167
Why are people talking about goddamn network routing protocols with regards to Sim city AI. :psyduck:

Deus Rex
Mar 5, 2005

yaoi prophet posted:

But my pointless style!

Adbot
ADBOT LOVES YOU

weird
Jun 4, 2012

by zen death robot

Internet Janitor posted:

Logo also has unless.

Factor defines the combinator if like ( true-quot false-quot flag -- ), and then has derived combinators when and unless for times that you only need a behavior for one "half".

Common Lisp has when and unless defined as trivial macros:
code:
CL-USER> (macroexpand '(when something do stuff))
(IF SOMETHING
    (PROGN DO STUFF)
    NIL)

CL-USER> (macroexpand '(unless something-else do other stuff))
(IF SOMETHING-ELSE
    NIL
    (PROGN DO OTHER STUFF)) 
It also has otherwise for the default option in a case expression.

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