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

Pages: 1-4041-

/prog/BOL 2012

Name: Anonymous 2012-01-22 12:03

identity is of type for all types A, A to A.
define function identity of x:
   return x.
end.

constant is of type for all types A and B, A to B to A.
define function constant of x of y:
   return x.
end.

define factorial of type int to int of n:
   if n equals 0, then: return 1.
   else: return n times factorial of (n minus 1).
end.

Name: Anonymous 2012-01-22 12:12

What is the need for the full stops?

PIG DISGUSTING!

Name: Anonymous 2012-01-22 12:32

>>2
For MAXIMUM READABILITY!

Name: Anonymous 2012-01-22 15:12

I think INTER/prog/ would be more interesting.

Name: Anonymous 2012-01-22 16:26

MOAR!

Name: Anonymous 2012-01-22 16:28

cobol is the best

Name: Anonymous 2012-01-22 16:35

>>1

Iiiii leiiik it!

Name: Anonymous 2012-01-22 18:23

anii

Name: Anonymous 2012-01-22 20:59

DEFINE FUNCTION CHECK-EM OF POST-NUMBER RETURNING DUBS:
INSPECT TRAILING TWO DIGITS OF POST-NUMBER FOR EQUALITY.
END.

CHECK-EM VARYING POST-NUMBER FROM ONE TO 1,000 BY ONE UNTIL DUBS.

Name: Anonymous 2012-01-22 21:19

>>11
consider them checked!

Name: Anonymous 2012-01-22 21:23

;__;

Name: Anonymous 2012-01-23 0:25

I think the quantity should be a grouping phrase equivalent to parentheses around the next sub-expression.
define factorial of type int to int of n:
   if n equals 0, then: return 1.
   else: return n times factorial of the quantity n minus 1.
end.

Name: Anonymous 2012-01-24 3:32

>>12


define find of type pair of binary tree of pairs of keys and values, and key, to value or nil, of Tree and Key:
  if Tree is nil, then return nil.
  else if: Key is equal to Tree's key, then return Tree's value.
  else if: Key is strictly less than Tree's key, then return find of Tree's left tree and Key.
  else: return find of Tree's right tree and Key.

Name: Anonymous 2012-01-24 3:32


end.

Name: Anonymous 2012-01-24 8:31

>>12
the value of?
return n times factorial of the value of n minus 1.

Name: Anonymous 2012-01-24 16:03

I will never get dubs;-;

Name: Anonymous 2012-01-24 16:08

define factorial of type int to int of n:
   if n equals 0, then:
      return 1.
   else:
      let n accent be n minus 1 in:
         return n times factorial of n accent.
end.

Name: Anonymous 2012-01-24 16:14

>>15
the value of might be good for dereferencing if /prog/BOL has pointers or references

Name: Anonymous 2012-01-24 16:37

>>18
Let's make a box of type, with the value of being the unbox operator.
the result of is parens.

Name: Anonymous 2012-01-24 22:48

>>18

how about value at for dereferencing a pointer?

Name: Anonymous 2012-01-24 22:52

>>17


let n prime be seven times n,
    n double prime be the square of n prime, and
    n triple prime be the n primeth root of n double prime,
    in the following:
  return the subtraction of n triple prime and n double prime.
end.

Name: sage 2012-01-25 0:10

Why do I like this syntax? I hate myself.

Name: Anonymous 2012-01-25 0:19

>>17
I'm having trouble understanding the syntax. What would a function with two parameters look like? Say,

float foo(int a, float b)
{
    return 2.0 * b + a;
}

Name: Anonymous 2012-01-25 0:46

>>23

/foo { 2.0 mul add } def

Push the symbol, foo. Push the following subroutine: push 2.0, the multiple them, then add them. Define them.

Name: Anonymous 2012-01-25 0:57

>>23
define foo of type int and float to float of a and b:
   return 2 times b plus a.
end

Maybe integer and binary could be integer types and real and computational could be floating-point types to make it more COBOL like. I think as 'type' would be a good syntax for casts, like b as integer.

Name: Anonymous 2012-01-25 1:06

>>23

Let's see...


foo is of type int and float to float.
define function foo of a and b:
  return the addition of the multiplication of two point oh and b and a.
end.

?

foo is of type int and float to float.
define function foo of a and b:
  let two b be the multiplication of two point oh and b, in the following:
    return the addition of two b and a.
end.

?

foo is of type int and float to float.
define function foo of a and b:
  return the multiplication of two point oh and b, followed by an addition by a.
end.

?

Name: Anonymous 2012-01-25 1:11

dot product is of type for all types satisfying multiplication and addition A, ordered collection of A and ordered collection of A to A:
define function dot product of X and Y:
  reduce using addition of map using multiplication of X and Y.
end.

Name: Anonymous 2012-01-25 1:23

>>25-27
sum of ...
reduce using addition of ...
... plus ...
... added to ...
addition of ... by ...
addition of ... to ...
addition of ... and ...
result of the addition of ...
augend of ...
add ... to ...
add ... to ... giving ...
add ... and ... giving ...

Name: Anonymous 2012-01-25 1:24

>>25
If it wasn't for the punctuation I think the syntax looks really nice, no symbols to be found. I know this is a joke in verbosity but looks really clean to me for some reason.


define foo of type int and float to float of a and b
  return 2 times b plus a
end
[code]

But I guess when you compare it to something like
[code]
def foo(a int, b int) int
  2*b+a
end


It starts to look a bit ridiculous.

Name: Anonymous 2012-01-25 1:25

>>29
(In that the latter you don't have to really read from left-to-right, you can digest it just by looking at the shape of the code, and the former you actually have to read.)

Name: Anonymous 2012-01-25 2:09

>>30

yeah but reading is fun. I could see this being nice for functional stuff, but not so much for imperative. Or if it was imperative, it would be much more statementy, like:


Increment a.
Set b to b times b times a.
Set a to a plus b.
Goto Start.

Name: Anonymous 2012-01-25 2:51

>>31
This thread has made me smile. To be honest I find the syntax of languages like applescript somewhat appealing. Have any of you seen SK8? (The defunct project that steve jobs killed off). Scripts look like PLAIN ENGLISH as well.

Name: Anonymous 2012-01-25 3:07

CHECK MY DUBS!

Name: Anonymous 2012-01-25 4:45

Checked his dubs

Name: Anonymous 2012-01-25 6:06

              JJJJJJJJJJJEEEEEEEEEEEEEEEEEEEEEEWWWWWWWW                           WWWWWWWW   SSSSSSSSSSSSSSS
              J:::::::::JE::::::::::::::::::::EW::::::W                           W::::::W SS:::::::::::::::S
              J:::::::::JE::::::::::::::::::::EW::::::W                           W::::::WS:::::SSSSSS::::::S
              JJ:::::::JJEE::::::EEEEEEEEE::::EW::::::W                           W::::::WS:::::S     SSSSSSS
                J:::::J    E:::::E       EEEEEE W:::::W           WWWWW           W:::::W S:::::S          
                J:::::J    E:::::E               W:::::W         W:::::W         W:::::W  S:::::S          
                J:::::J    E::::::EEEEEEEEEE      W:::::W       W:::::::W       W:::::W    S::::SSSS       
                J:::::j    E:::::::::::::::E       W:::::W     W:::::::::W     W:::::W      SS::::::SSSSS  
                J:::::J    E:::::::::::::::E        W:::::W   W:::::W:::::W   W:::::W         SSS::::::::SS
    JJJJJJJ     J:::::J    E::::::EEEEEEEEEE         W:::::W W:::::W W:::::W W:::::W             SSSSSS::::S
    J:::::J     J:::::J    E:::::E                    W:::::W:::::W   W:::::W:::::W                   S:::::S
    J::::::J   J::::::J    E:::::E       EEEEEE        W:::::::::W     W:::::::::W                    S:::::S
    J:::::::JJJ:::::::J  EE::::::EEEEEEEE:::::E         W:::::::W       W:::::::W         SSSSSSS     S:::::S
     JJ:::::::::::::JJ   E::::::::::::::::::::E          W:::::W         W:::::W          S::::::SSSSSS:::::S
       JJ:::::::::JJ     E::::::::::::::::::::E           W:::W           W:::W           S:::::::::::::::SS
         JJJJJJJJJ       EEEEEEEEEEEEEEEEEEEEEE            WWW             WWW             SSSSSSSSSSSSSSS 

Name: Anonymous 2012-01-25 6:17

              JJJJJJJJJJJEEEEEEEEEEEEEEEEEEEEEEWWWWWWWW                           WWWWWWWW   SSSSSSSSSSSSSSS
              J:::::::::JE::::::::::::::::::::EW::::::W                           W::::::W SS:::::::::::::::S
              J:::::::::JE::::::::::::::::::::EW::::::W                           W::::::WS:::::SSSSSS::::::S
              JJ:::::::JJEE::::::EEEEEEEEE::::EW::::::W                           W::::::WS:::::S     SSSSSSS
                J:::::J    E:::::E       EEEEEE W:::::W           WWWWW           W:::::W S:::::S          
                J:::::J    E:::::E               W:::::W         W:::::W         W:::::W  S:::::S          
                J:::::J    E::::::EEEEEEEEEE      W:::::W       W:::::::W       W:::::W    S::::SSSS       
                J:::::j    E:::::::::::::::E       W:::::W     W:::::::::W     W:::::W      SS::::::SSSSS  
                J:::::J    E:::::::::::::::E        W:::::W   W:::::W:::::W   W:::::W         SSS::::::::SS
    JJJJJJJ     J:::::J    E::::::EEEEEEEEEE         W:::::W W:::::W W:::::W W:::::W             SSSSSS::::S
    J:::::J     J:::::J    E:::::E                    W:::::W:::::W   W:::::W:::::W                   S:::::S
    J::::::J   J::::::J    E:::::E       EEEEEE        W:::::::::W     W:::::::::W                    S:::::S
    J:::::::JJJ:::::::J  EE::::::EEEEEEEE:::::E         W:::::::W       W:::::::W         SSSSSSS     S:::::S
     JJ:::::::::::::JJ   E::::::::::::::::::::E          W:::::W         W:::::W          S::::::SSSSSS:::::S
       JJ:::::::::JJ     E::::::::::::::::::::E           W:::W           W:::W           S:::::::::::::::SS
         JJJJJJJJJ       EEEEEEEEEEEEEEEEEEEEEE            WWW             WWW             SSSSSSSSSSSSSSS 

Name: Anonymous 2012-01-25 6:17

              JJJJJJJJJJJEEEEEEEEEEEEEEEEEEEEEEWWWWWWWW                           WWWWWWWW   SSSSSSSSSSSSSSS
              J:::::::::JE::::::::::::::::::::EW::::::W                           W::::::W SS:::::::::::::::S
              J:::::::::JE::::::::::::::::::::EW::::::W                           W::::::WS:::::SSSSSS::::::S
              JJ:::::::JJEE::::::EEEEEEEEE::::EW::::::W                           W::::::WS:::::S     SSSSSSS
                J:::::J    E:::::E       EEEEEE W:::::W           WWWWW           W:::::W S:::::S          
                J:::::J    E:::::E               W:::::W         W:::::W         W:::::W  S:::::S          
                J:::::J    E::::::EEEEEEEEEE      W:::::W       W:::::::W       W:::::W    S::::SSSS       
                J:::::j    E:::::::::::::::E       W:::::W     W:::::::::W     W:::::W      SS::::::SSSSS  
                J:::::J    E:::::::::::::::E        W:::::W   W:::::W:::::W   W:::::W         SSS::::::::SS
    JJJJJJJ     J:::::J    E::::::EEEEEEEEEE         W:::::W W:::::W W:::::W W:::::W             SSSSSS::::S
    J:::::J     J:::::J    E:::::E                    W:::::W:::::W   W:::::W:::::W                   S:::::S
    J::::::J   J::::::J    E:::::E       EEEEEE        W:::::::::W     W:::::::::W                    S:::::S
    J:::::::JJJ:::::::J  EE::::::EEEEEEEE:::::E         W:::::::W       W:::::::W         SSSSSSS     S:::::S
     JJ:::::::::::::JJ   E::::::::::::::::::::E          W:::::W         W:::::W          S::::::SSSSSS:::::S
       JJ:::::::::JJ     E::::::::::::::::::::E           W:::W           W:::W           S:::::::::::::::SS
         JJJJJJJJJ       EEEEEEEEEEEEEEEEEEEEEE            WWW             WWW             SSSSSSSSSSSSSSS 

Name: Anonymous 2012-01-25 6:17

              JJJJJJJJJJJEEEEEEEEEEEEEEEEEEEEEEWWWWWWWW                           WWWWWWWW   SSSSSSSSSSSSSSS
              J:::::::::JE::::::::::::::::::::EW::::::W                           W::::::W SS:::::::::::::::S
              J:::::::::JE::::::::::::::::::::EW::::::W                           W::::::WS:::::SSSSSS::::::S
              JJ:::::::JJEE::::::EEEEEEEEE::::EW::::::W                           W::::::WS:::::S     SSSSSSS
                J:::::J    E:::::E       EEEEEE W:::::W           WWWWW           W:::::W S:::::S          
                J:::::J    E:::::E               W:::::W         W:::::W         W:::::W  S:::::S          
                J:::::J    E::::::EEEEEEEEEE      W:::::W       W:::::::W       W:::::W    S::::SSSS       
                J:::::j    E:::::::::::::::E       W:::::W     W:::::::::W     W:::::W      SS::::::SSSSS  
                J:::::J    E:::::::::::::::E        W:::::W   W:::::W:::::W   W:::::W         SSS::::::::SS
    JJJJJJJ     J:::::J    E::::::EEEEEEEEEE         W:::::W W:::::W W:::::W W:::::W             SSSSSS::::S
    J:::::J     J:::::J    E:::::E                    W:::::W:::::W   W:::::W:::::W                   S:::::S
    J::::::J   J::::::J    E:::::E       EEEEEE        W:::::::::W     W:::::::::W                    S:::::S
    J:::::::JJJ:::::::J  EE::::::EEEEEEEE:::::E         W:::::::W       W:::::::W         SSSSSSS     S:::::S
     JJ:::::::::::::JJ   E::::::::::::::::::::E          W:::::W         W:::::W          S::::::SSSSSS:::::S
       JJ:::::::::JJ     E::::::::::::::::::::E           W:::W           W:::W           S:::::::::::::::SS
         JJJJJJJJJ       EEEEEEEEEEEEEEEEEEEEEE            WWW             WWW             SSSSSSSSSSSSSSS 

Name: Anonymous 2012-01-25 6:17

              JJJJJJJJJJJEEEEEEEEEEEEEEEEEEEEEEWWWWWWWW                           WWWWWWWW   SSSSSSSSSSSSSSS
              J:::::::::JE::::::::::::::::::::EW::::::W                           W::::::W SS:::::::::::::::S
              J:::::::::JE::::::::::::::::::::EW::::::W                           W::::::WS:::::SSSSSS::::::S
              JJ:::::::JJEE::::::EEEEEEEEE::::EW::::::W                           W::::::WS:::::S     SSSSSSS
                J:::::J    E:::::E       EEEEEE W:::::W           WWWWW           W:::::W S:::::S          
                J:::::J    E:::::E               W:::::W         W:::::W         W:::::W  S:::::S          
                J:::::J    E::::::EEEEEEEEEE      W:::::W       W:::::::W       W:::::W    S::::SSSS       
                J:::::j    E:::::::::::::::E       W:::::W     W:::::::::W     W:::::W      SS::::::SSSSS  
                J:::::J    E:::::::::::::::E        W:::::W   W:::::W:::::W   W:::::W         SSS::::::::SS
    JJJJJJJ     J:::::J    E::::::EEEEEEEEEE         W:::::W W:::::W W:::::W W:::::W             SSSSSS::::S
    J:::::J     J:::::J    E:::::E                    W:::::W:::::W   W:::::W:::::W                   S:::::S
    J::::::J   J::::::J    E:::::E       EEEEEE        W:::::::::W     W:::::::::W                    S:::::S
    J:::::::JJJ:::::::J  EE::::::EEEEEEEE:::::E         W:::::::W       W:::::::W         SSSSSSS     S:::::S
     JJ:::::::::::::JJ   E::::::::::::::::::::E          W:::::W         W:::::W          S::::::SSSSSS:::::S
       JJ:::::::::JJ     E::::::::::::::::::::E           W:::W           W:::W           S:::::::::::::::SS
         JJJJJJJJJ       EEEEEEEEEEEEEEEEEEEEEE            WWW             WWW             SSSSSSSSSSSSSSS 

Name: Anonymous 2012-01-25 10:14

I have a feeling this will go places.

Name: Anonymous 2012-01-25 10:49

>>35-39 please stop.

quick, someone write a grammar for it!

Name: Anonymous 2012-01-26 0:48

return to front page.

Name: Anonymous 2012-01-26 1:38

>>41
We should first decide what the standard features will be. We should for a /prog/mittee.

Bump over the jews.

Name: Anonymous 2012-01-26 1:39

>>43

is the OP present? I would feel bad about hijacking his creation.

Name: Anonymous 2012-01-26 1:43

>>44
err, ey's creation

Name: Anonymous 2012-01-26 1:56

Will this /prog/BOL work on the previous PROGBOL's virtual machine?

Name: Anonymous 2012-01-26 3:35

>>46

sure, why not.

here's a start....


    identity is of type for all types A, A to A.
    define function identity of x:
       return x.
    end.

    constant is of type for all types A and B, A to B to A.
    define function constant of x of y:
       return x.
    end.

    define factorial of type int to int of n:
       if n equals 0, then: return 1.
       else: return n times factorial of (n minus 1).
    end.
type_declaration : identifier 'is' 'of' 'type' type_expression '.'
                 ;

type_expression : optional_type_quanitification type_sequence
                ;

optional_type_quanitification : type_quantification ','
                              |
                              ;

type_quantification : 'for' 'all' 'types' type_list
                    ;

type_sequence : type_expression
              | type_sequence 'to' type_name
              ;

type_list_ : type_expression
           | type_list_ ',' type_expression
           ;

type_list : type_expression
          | type_list_ ',' 'and' type_expression
          ;

argument_list_declaration_ : identifier
                           | argument_list_declaration ',' identifier
                           ;

argument_list_declaration :  identifier                              COMMENT: are functions allowed to not take any arguments?
                          | argument_list_declaration_ ',' 'and' identifier
                          ;

type_name : identifier
          ;

optional_function_type : 'of' 'type' type_expression
                       |
                       ;

function_definition : 'define' identifier optional_function_type 'of' argument_list_declaration ':' function_body 'end' '.'

function_body : ....

expression : ...

Name: Anonymous 2012-01-26 17:00

>>47
Perfect!

Name: Anonymous 2012-01-26 20:58

sgsgdfsgdf

Name: Anonymous 2012-01-26 23:23


function_body : statement_list
              ;

statement_list : statement.
               | statement_list statement.
               ;

statement : expression
          | return expression
          | 'if' expression ',' 'then' ':' statement_list 'else:' statement_list 'endif'
          ;

----------
FOIC can be used to avoid the endif above, but I don't know how to express FOIC in gramas.
---------


expression_list_ : expression
                 | expression_ ',' expression
                 ;

expression_list : expression
                | expression_list_ 'and' expression

function_call : identifier 'of' expression_list

term : identifier
     | constant
     | function_call
     ;

expression : term
           | term binary_operation term
           | expression binary_operation term
           ;

Name: Anonymous 2012-01-26 23:46

>>50
U MENA ``FIOC''

Name: Anonymous 2012-01-27 0:14

>>51

Forced orientation inversion catastrophe

Name: Anonymous 2013-04-11 16:11

mootles.progbol:
Add mods to /prog/ giving shit.

Name: Anonymous 2013-04-14 17:07

Name: Anonymous 2013-04-14 17:08


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