473,550 Members | 2,856 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dumb idea?

Hi everyone -

I like playing around with language syntax and semantics. I'm thinking
about pulling down the PyPy code and messing around to see what I can
accomplish. My first idea is most succinctly described by example:

class IBlockProtocol:
def __block__(self, func):
# NO RETURN VALUES!
pass

# my_IBlockProtoc ol is an expression that evaluates to an implementor
of IBlockProtocol

my_IBlockProtoc ol: expr

# becomes:

my_IBlockProtoc ol.__block__(la mbda: expr)

###

my_IBlockProtoc ol<param1, paramN>: expr

# becomes:

my_IBlockProtoc ol.__block__(la mbda param1, paramN: expr)

###

my_IBlockProtoc ol:
stmt1
stmt2

# becomes:

def anon():
stmt1
stmt2

my_IBlockProtoc ol.__block__(an on)

###

my_IBlockProtoc ol<param1, paramN>:
stmt1
stmt2

# becomes:

def anon(param1, paramN):
stmt1
stmt2

my_IBlockProtoc ol.__block__(an on)

###############

Has this already been done? Is it a stupid idea? I think it could be
used to simplify event handling and some Twisted stuff. I'm mainly
looking for reasons why I _wouldn't_ want to take the time to get my
hands dirty with the PyPy code (or even CPython) and try to implement
this syntax.

Thanks.

Pete
Jun 27 '08 #1
1 834
On 2008-06-10, Peter Hunt <fl*********@gm ail.comwrote:
Hi everyone -

I like playing around with language syntax and semantics. I'm thinking
about pulling down the PyPy code and messing around to see what I can
accomplish. My first idea is most succinctly described by example:

class IBlockProtocol:
def __block__(self, func):
# NO RETURN VALUES!
pass
You have lost me here.
What is this supposed to be doing? To me you introduce a new magic __block__
function in a class that does nothing.

And then you go on and on with implementation details and mappings of some
BlockProtocol to other syntax without an explanation of what you are blocking
(in English text), or what you aim to achieve by blocking.

In other words, your post is to me the same as

class A(object):
def q(self, t):
# do nothing
pass

and the question "did anybody invent q_protocol" already?

Your guess is as good as mine (and probably better since you have a semantics
for the blocking protocol in the back of your mind).
Sincerely,
Albert
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
2479
by: squash | last post by:
a dumb question i had on my mind: Say you have a dynamically created web page . Isn't it more secure to write it in php since a visitor will not be able to tell it is dynamically created? But if you write it in perl, you have to put it in your cgi-bin which automatically means it's a dynamically generated page? security by obscurity . Is...
2
1422
by: Marion | last post by:
I would like to go on record to say that I think not having the Printer collection in .Net is dumb. The only help tells me that I should use the Print Dialog. Well, I don't want to. Programming is about flexability but ..Net is all about taking things away. I am using the Farpoint Win Spread control and it has limited printing so I am REQUIRED...
3
1465
by: ed | last post by:
I've just started working with .Net, so appologize for what is probably a really dumb question. Did Windows XP originally come with the .Net framework installed, and if so which version? thanks in advance, ed
4
1706
by: Piedro | last post by:
Hi group, as I was browsing the web and checking out w3schools.com I read that the font tag was deprecated and that I should use css styles for formatting like for example <p class="p1"> Text goes here </p>
4
1487
by: ItNerd | last post by:
Someone PLEASE HELP ME!!!!! All I want to do is a simple postback and grab the value from a textbox on clicking a linkbutton like below, but the value is not writing to the screen. I am frustrated with this seemingly simple task. I have enabledviewstate=true on the @Page directive, and I tried using onclick on the linkbutton, nothing. I...
2
2218
by: Bill Nguyen | last post by:
I would like to add a new VB.NET project using the same folder being used by another project so that I can share several forms already creaded by the other project. However, .NET created a new folder using whatever project name I supplied. Is there a work around for this? Thanks Bill
17
1573
by: vashwath | last post by:
#include <stdio.h> int main() { FILE *fp; char s; fopen("file.txt","w+"); fprintf(fp,"HI\n");
4
1702
by: theapeman | last post by:
Sorry to bore everyone with this question, which I'm sure is the equivalent of "Please help! What letter comes between C and E in the alphabet?" but seriously, if you really didn't know that, I don't know if there's a single google search in the world that would actually help you... Anyway, here it is: I'm writing a Perl script that uses the...
3
1587
by: rdufour | last post by:
Downloaded a sample that is supposed to show how to localize a web site and started playing with the code, its in Vs2003, so I figure I would take code and put it in Vs 2005 and doing so use it a bit as a walkthrough on how things are done in VS2005 for this type of stuff. BUT just as I looked into it deeper I noticed the sample is a vb...
0
7561
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7488
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7845
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6101
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5129
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3532
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3517
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1978
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
801
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.