Stuff related to the LOLCODE language.
3 posts Page 1 of 1
Postby jjm » Sun Apr 27, 2014 3:56 am
(Copying over the discussion from GitHub)

It would be interesting to make a FIEL-like BUKKIT that would be a part of the core library and specification. Maybe some calls like:

(FILO = File-like object)

  • LUK (fscanf) Read a LETTAR, LINE, or WORD from a FILO
  • SCRIBBEL (fprintf) Write a YARN to a FILO
  • AGEIN (rewind) Rewinds the FILO
  • HAZ (n/a) Creates a FILO
  • OPEN (fopen) Opens a file into a FILO
  • KONN (connect) Connects a socket to a FILO
  • BIND (bind) Binds a socket to a FILO
Postby Bappy » Fri Jan 23, 2015 12:25 pm
I was just thinking the only thing that lolcode is missing that prevents me from actually using it for real life stuff at work (I'm an Analyst Programmer working for an insurance company) is the ability to open and read from/write to a file.

I was thinking something like;
Code: Select all
I HAZ A daFile ITZ "C::\test.txt"

   BTW casting a YARN to a FIEL uses the string to locate a file object
daFile IZ NOW A FIEL

   BTW LUKAT reads one line
I HAZ A lineOfText ITZ LUKAT daFile

...

lineOfText, SCRIBBEL daFile



when reading in a loop you would need some kind of EOF so you can do something like:
Code: Select all

NOMOR daFile
O RLY?
   YA RLY, GTFO
OIC




Of course the only remaining thing we'd need is substring...

Code: Select all

I HAZ A textyThing ITZ "CAN I HAZ A CHEEZBURGER?"

I HAZ A shortTextyThing ITZ SUMMA YR YARN textyThing FROM DIS BIT 0 TO DIS BIT 9



Whatcha think?
Postby jjm » Fri Jan 23, 2015 3:32 pm
Hey Bappy,

We currently have some support for file I/O, string manipulation, and network communication in the "future" branch of lci (https://github.com/justinmeza/lci/tree/future). Take a look at the web server written in LOLCODE for some examples of how these are used (https://github.com/justinmeza/httpd.lol).

We're still working out the right syntax for it and deciding whether it will make it into a future specification, but it's available for testing.
3 posts Page 1 of 1

Login

Who is online

Users browsing this forum: No registered users and 2 guests

cron