COBOL

Please compose all posts in Emacs.

Moderators: phlip, Moderators General, Prelates

COBOL

Postby btiffin » Mon Feb 06, 2012 7:32 am UTC

I'm a fan. opencobol.add1tocobol.com

It really is the greatest thing since sliced strings.
Code: Select all
OCOBOL >>SOURCE FORMAT IS FIXED
      *> ***************************************************************
      *> Purpose:   Demonstrate libguile bf interactions
      *> Tectonics: cobc -x -lguile-2.0 derps.cob
      *> ***************************************************************
       identification division.
       program-id. derps.

       data division.
       working-storage section.
       77 derps pic x(124) value
           "+++++ +++++ [ > +++++ ++ > +++++ +++ > + <<< - ] >" &
      -    " -- .  + .  > ++ .  -- .  > .  > , [ <<< - . + .  " &
      -    "> ++ .  -- .  > .  > - ]".

       77 scm-result usage pointer.

      *> ***************************************************************
       procedure division.

       call "scm_init_guile" end-call

      *> eval-string in bf context, res is unspecified
       call "scm_c_eval_string"
           using function concatenate(
               "(use-modules (ice-9 eval-string))"
               '(define derps "' derps '")'
               "(define res (eval-string derps #:lang 'brainfuck))"
               low-value)
           returning scm-result
           on exception display function exception-location end-display
       end-call
     
       goback.
       end program derps.

which runs as
Code: Select all
$ cobc -x derps.cob -lguile-2.0
$ ./derps
DERP
^E
DERP
DERP
DERP
DERP
DERP
$

COBOL in charge of Guile, running brainf**k code, all for the DERP.

COBOL rules. Admit it, it won a long time ago, still winning. :wink:

Cheers,
Brian
btiffin
 
Posts: 6
Joined: Sun Feb 05, 2012 3:49 am UTC

Re: COBOL

Postby TylerGriffiths » Mon Jun 11, 2012 10:03 pm UTC

The chance that I'd use COBOL is a SNOBOL's chance in hell...
TylerGriffiths
 
Posts: 1
Joined: Wed Apr 11, 2012 1:17 pm UTC


Return to Religious Wars

Who is online

Users browsing this forum: No registered users and 3 guests