Posts

Showing posts from August, 2010

Object.defineProperty ... but Strict!

In my precedent post entitled A Pascal record via JavaScript I have showed a basic function able to emulate type hints behavior via JavaScript. Even if that was a proof of concept, I consider other languages simulation of unsupported features an error, first of all because the behavior will rarely be exactly the expected one, secondly because our curent programming language may already have something similar to better learn and use. A new ES5( direction ) As soon as I have written the Pascal example, I have realized that the good "old" Object.defineProperty , implemented in all major browsers (IE The only missing part, intrinsic in the JavaScript nature, is the property type, where this type could be eventually used for arguments or returns checks when the property is a method. My Early Attempts Back in May 2007, my JavaStrict experiment was already trying to do something similar, something implemented after 2 years even in dojo framework as well. This may tell us that ...

A Pascal record via JavaScript

... all right, I am off for holidays and I won't have probably time to write the post I have twitted a few days ago since it could take a whole day ... however, I am "cleaning" my good old room here in Italy and I have found an Italian book titled "ALGORITMI IN PASCAL" (Pascal Algorithms) a back in 1987 IT book for secondary school. I could not resist to read it entirely, just to see what kind of Algo I could have found there ... but "surprise", it was not about algos, more about (T)Pascal itself. Since at the of the day Pascal is somehow the basis for all we can write today, I thought it would have been a nice experiment to try to reproduce the record concept via JavaScript. What Is a Record Nothing different from a predefined structure of types, similar to a classic literal object in JS except the structure defines type hints. // simple Pascal function example function personToString(self:person); begin writeln(self.name, ' is ', self....

Stay tuned...

Image

DREAM POLICE THIS WEEKEND

FRIDAY August 13th Silent Barn 915 Wyckoff Ave Brooklyn, NY Dream Police Pink Reason Landlords White Suns 9pm, 6$ = WE PLAY FIRST SATURDAY August 14th Tommy's Tavern 1041 Manhattan Ave Brooklyn, NY Highway Gimps Eleanor Let Me Crazy The Marsh Hens Dream Police 9 pm, FREE (maybe) = WE PLAY LAST

THIS SATURDAY

Image

NO WEDNESDAY SHOW FOR US

The Men are NOT playing Wednesday with Twin Stumps at Shea Stadium, we dropped the show weeks ago, I don't know why we are still on the bill. Obviously Twin Stumps are rad, and you should still go see them, but we will not be there. Sorry.