Which is almost a quine, if not for the ' (unquote) character.Code:'(1 2 3 4 5 6 7 8 9 10)
BTW, that is Scheme code which will evaluate to the list of integers from 1 to 10. In Scheme, code is data and vice-versa (mostly).
Which is almost a quine, if not for the ' (unquote) character.Code:'(1 2 3 4 5 6 7 8 9 10)
BTW, that is Scheme code which will evaluate to the list of integers from 1 to 10. In Scheme, code is data and vice-versa (mostly).
Last edited by MacNilly; 11-22-2016 at 01:34 AM.
Actually, most Scheme code can evaluate to itself which makes writing quines in Scheme mostly trivial if you can account for the unquote operator.
BBC Basic
Code:REM 1-10 printing REM written by Ada Skyla-Rose REM =================== FOR i = 1 TO 10 PRINT i NEXT i ENDPROC END
Double Helix STL
This won't run in BBC BASIC since you haven't defined the procedure. Remove the ENDPROC and it will work - or define the procedure. This will work in BBC BASIC for Windows:
...as will the REPEAT...UNTIL loop in BBC BASIC that I posted earlier on in this thread.Code:PROC_loop PRINT PRINT "THE END." END DEF PROC_loop FOR I=1 TO 10 PRINT I; NEXT I ENDPROC
May as well add the WHILE...ENDWHILE loop way of doing this in BBC BASIC
Code:REM WHILE...ENDWHILE loop BBC BASIC (BBC BASIC for Windows & BBC BASIC V) a%=0 WHILE a%<10 a%+=1 PRINT a% ENDWHILE END
Your Haskell is enterprise quality
Lol I literally just started reading about how in categorical terms an applicative is actually a monoidal functor. I think everything in Haskell is enterprise-quality by nature of the beast XD
Seriously, the most useless thing ever but I can't pull myself away from it!
Well, in procedural terms an applicative can be thought of as a function. So, you could say C++ is enterprise-quality.
The good thing about comparison theorems is that you can always think of an ant as type of elephant.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Heh heh. Not as much fun as the category theory version though :P
It's really fun to think about while I'm at work because Lord knows I can't focus on actual work that long.
D actually supports a "pure" keyword. I wish C++ did too... :P
But yeah, the IO monad is basically a way of guaranteeing the same function execution, even if the input is different. Fundamentally, FP is about categories over types and how those types are transformed from one to the other. The type system does help keep things in line but that's more or less because it represents a functor and how functors transform categories.
Apl:
Code:⍳10
However let it be said that the only correct way to program BBC BASIC today is to program it wrong.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.