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

Pages: 1-

Summer of GOTO

Name: Anonymous 2009-08-19 4:26

Name: Anonymous 2009-08-19 4:30

It would be cooler if they implementated continuations or coroutines instead.

Name: Anonymous 2009-08-19 4:31

It would be cooler if Anonymous learned what sage actually meant.

Name: Anonymous 2009-08-19 4:48

>>3
Fuck you, dipshit.

Name: Anonymous 2009-08-19 5:27

Should've named it Eternal September of GOTO.

Name: Anonymous 2009-08-19 5:32

GOTO in Haskell, what do you think?

Name: Anonymous 2009-08-19 8:29

>>6
They already have a continuation monad, don't they?
>>1
I agree with this idea wholeheartedly, goto gets too bad a wrap just because people know they name of, but don't appear to have read, the 'goto considered harmful' paper

Name: Anonymous 2009-08-19 14:43

if you need to use a GOTO, urdoinitrong
seriously, start over

Name: Anonymous 2009-08-19 14:58

>>8
There's a few legitimate cases of goto usage in C, mostly for performance reasons (exiting nested loops, error handling/cleanup without exceptions). They are very legitimate reasons as a goto is usually just assembled as a jump, while exceptions can be very costly and sometimes even require a context switch.

I once wrote a small tool to bruteforce some crypto keys, the choice was between a goto and a conditional which gets executed each time during a couple of nested loops. Using a goto resulted in a major speedup.

Using goto in high level languages is usually the wrong thing to do. If you need to use a goto, you probably need to rewrite parts of the function or your language is in need of better constructs. Some languages with powerful macro systems allow you to write new constructs, and using goto's as part of such macros is fine as the code is abstracted away into a new operator. Not using a goto when designing such iteration macros could even be considered a bad idea if you're using an inefficient way to express the constructs through other higher level constructs as your new consturct could be used often and may even bog down the program if used extensively and originally designed wrongly. I'm also aware that a reasonable good compiler may(and probably does) exist which optimizes so well that you wouldn't have to use a single goto in your macros.

Name: Anonymous 2009-08-19 15:25

int c = getch();

goto (1000 + c);

Name: Anonymous 2009-08-19 16:01

>>7
They already have a continuation monad, don't they?
import soul lolololol XD

Argh, haskellers are just the pythonistas of fp.

Name: Anonymous 2009-08-20 17:04

goto: PROG_TOP_THREAD

Name: Anonymous 2009-08-20 17:23

this code will not be run

Name: =+=*=F=R=O=Z=E=N==V=O=I=D=*=+= !frozEn/KIg 2009-08-21 5:02

goto is typically fastest, and lowest level conditional(computed goto) construct.
Arguing against goto is as silly as arguing against inline assembly.
 People can abuse both, its not reason to outlaw them, just a mindless(similar to `think of the children', but children here are programmers) reaction to problem from wrong angle(use-case vs design) by formula "lets outlaw X, because X can be used by Y to create Z",


_____________________________________
http://bayimg.com/image/aadbjaace.jpg
Velox Et Astrum gamedev forum: http://etastrum.phpbb3now.com
Science is the tool of the Western mind and with it more doors can be opened than with bare hands. It is part and parcel of our knowledge and obscures our insight only when it holds that the understanding given by it is the only kind there is.

Name: Anonymous 2009-08-21 12:46

>>14
Are you fucking retarded?  It's one thing to use low level optimization in certain parts of your code, but it's another thing to use a construct that will completely break the structure of a high level language.

Name: Anonymous 2009-08-21 12:56

>>15
[b][u][i]Please stop responding to invisible teenage posters!!![i][/u][/b]

Name: Anonymous 2009-08-21 12:56

>>15

This is why, for best results, pay close attention to what FV says and then do the exact opposite.

Name: Anonymous 2009-08-21 12:57

>>16 BBCode Failure: Retry (y/n/cocks)?

Name: Anonymous 2009-08-21 15:36

Post >>16 in thread 1250670402 contains a BBCode failure: [b][u][i]Please stop responding to invisible teenage posters!!![i][/u][/b].
   [Condition of type BBCODE-FAILURE]

Restarts:
 0: [RETRY-WITH-A-NEW-POST] Try posting again after correcting your post.
 1: [GRAB-DICK] *grabs dick*
 2: [LEAVE-PROG] Leave /prog/
 3: [RETRY] Retry SLIME interactive evaluation request.
 4: [ABORT] Return to SLIME's top level.
 5: [ABORT] Abort
 6: [CLOSE-CONNECTION] Close SLIME connection
 7: [ABORT] Exit debugger, returning to top level.


Backtrace:
  0: (|/prog/-post| 16 1250670402
"[b][u][i]Please stop responding to invisible teenage posters!!![i][/u][/b]")
  1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (|/prog/-post| 16 1250670402
"class=eop>[b][u][i]Please stop responding to invisible teenage posters!!![i][/u][/b]") #<NULL-LEXENV>)
  2: ((LAMBDA ()))
  3: (SWANK::CALL-WITH-RETRY-RESTART "Retry SLIME interactive evaluation request." #<CLOSURE (LAMBDA #) {242C4065}>)
  4: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CLOSURE (LAMBDA #) {242C404D}>)
 --more--

OR in another conforming implementation:

*** - Post >>16 in thread 1250670402 contains a BBCode failure:

      class=eop>[b][u][i]Please stop responding to invisible teenage
      posters!!![i]
[/u][/b].
The following restarts are available:
RETRY-WITH-A-NEW-POST :R1 Try posting again after correcting your post.
GRAB-DICK      :R2      *grabs dick*
LEAVE-PROG     :R3      Leave /prog/
ABORT          :R4      Abort main loop
Break 1 [5]>


Toy code:

[code]
(define-condition bbcode-failure
  (error)
  ((original :initarg :original :reader get-original)
   (poster   :initarg :poster   :reader get-poster)
   (thread   :initarg :thread   :reader get-thread))
  (:report (lambda (condition stream)
         (format stream "Post >>~A in thread ~A contains a BBCode failure: ~A."
             (get-poster condition)
             (get-thread condition)
             (get-original condition)))))


(defvar *poster* 16)
(defun post-to-prog (new-post)
  (declare (ignore new-post)))

(defun grab-dick ()
  (with-dick-grabbed *poster*
    (perform-side-effects)))

(defun leave-prog (poster)
  (perform-clean-up poster)
  (exit))

(defun |bbcode-fail-/prog/-post| (post-number thread s)
  (restart-case
      (error 'bbcode-failure
         :poster post-number
         :original s
         :thread thread)
    (retry-with-a-new-post (new-post)
      :report "Try posting again after correcting your post."
      (post-to-prog new-post))
    (grab-dick ()
      :report "*grabs dick*"
      (grab-dick))
    (leave-prog ()
      :report "Leave /prog/"
      (leave-prog *poster*))))


(|bbcode-fail-/prog/-post| *poster* 1250670402 "[b][u][i]Please stop responding to invisible teenage posters!!![i][/u][/b]")
[/code]

Name: Anonymous 2009-08-21 15:39

Post >>19 in thread 1250670402 contains a BBCode failure: ....
   [Condition of type BBCODE-FAILURE]

Restarts:
 0: [RETRY-WITH-A-NEW-POST] Try posting again after correcting your post.
 1: [GRAB-DICK] *grabs dick*
 2: [LEAVE-PROG] Leave /prog/
 3: [RETRY] Retry SLIME interactive evaluation request.
 4: [ABORT] Return to SLIME's top level.
 5: [ABORT] Abort
 --more--

Backtrace:
  0: (|bbcode-fail-/prog/-post| 19 1250670402 "...")
  1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (|bbcode-fail-/prog/-post| 19 1250670402 "...") #<NULL-LEXENV>)
  2: ((LAMBDA ()))


... Fuck me.

Name: Anonymous 2009-08-21 16:12

Post >>20 in thread 1250670402 contains a GAY: ....
   [Condition of type GAY]

Restarts:
 0: [GRAB-DICK] *grabs dick*

Name: Anonymous 2009-08-22 8:21

>>16
Please rewrite your broken post-filtering script.

Name: Anonymous 2009-08-22 8:48

Name: Anonymous 2011-02-03 4:31

<

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