无阶级值得考虑 [英] Is classless worth consideration

查看:61
本文介绍了无阶级值得考虑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

2004年4月27日16:34:56 -0700, ha ******* @ virgin.net (has)写道:

On 27 Apr 2004 16:34:56 -0700, ha*******@virgin.net (has) wrote:

David MacQuigg< dm*@gain.com>在留言新闻中写道:< bn ******************************** @ 4ax.com>。 ..
David MacQuigg <dm*@gain.com> wrote in message news:<bn********************************@4ax.com>. ..
简化类的示例(原型)
========================= ===================
Example of Simplified Classes ( Prototypes )
============================================



[SNIP]

任何其他名称的基于类的OOP 。但是,我已经指出了这一点。见皇帝,衣服;缺乏。

虽然我不认为它们是编程的典范,但我建议您查看我的旧AppleScript库
< http://applemods.sourceforge.net/>。 (注意:脚本是经过编译的,所以你需要一台Mac才能查看源代码。)请参阅类型,HTMLTemplate和ASTest
,了解OO编程的例子,这些编程不是类固定的。可能会提供一些有用的视角。



[SNIP]

Class-based OOP by any other name. But then, I''ve pointed this out
already. See Emperor, clothes; lack of.

Here; while I don''t claim them to be paragons of programming, I
suggest taking a look at my old AppleScript libraries at
<http://applemods.sourceforge.net/>. (Note: scripts are compiled, so
you''ll need a Mac to view source.) See Types, HTMLTemplate and ASTest
for examples of OO programming that isn''t class-fixated. Might lend
some useful perspective.




我们Python程序员遇到的问题是理解消除类和/或
消除类的基本优势仅使用

实例。理论上的讨论让我入睡。我看不到

以上例子的要点。我们需要的是一个简单的用例。


我已经包含了在我的

Python 3中克隆一个实例的能力。提案
http://ece.arizona.edu/ ~edatools / Pyt ... typeSyntax.htm

这将允许用户完全忽略类,只需从另一个实例中生成一个实例,然后另一个实例,等等,每当感受到冲动时,修改每个

实例。


这是我迄今为止在优点和缺点中所拥有的关于此功能:


Pro:允许在运行中没有课程的编程风格。

Con:可以导致更多无纪律的编程。


也许你可以在这里帮助我们。


- Dave



The problem we Python programmers are having is understanding the
fundamental advantage of eliminating classes and working only with
instances. The theoretical discussions put me to sleep. I can''t see
the point of the examples above. What we need is a simple use case.

I''ve included the ability to clone one instance from another in my
"Python 3" proposal
http://ece.arizona.edu/~edatools/Pyt...typeSyntax.htm
This will allow the user to completely ignore classes, and just make
one instance from another, then another, and so on, modifying each
instance along the way, whenever the urge is felt.

Here is what I have so far in the Pros and Cons on this feature:

Pro: Allows "on-the-fly" programming style with no classes.
Con: Can lead to more undisciplined programming.

Perhaps you can help us here.

-- Dave

推荐答案

David MacQuigg写道:
David MacQuigg wrote:
问题我们Python程序员正在理解消除类和仅使用
实例的基本优势。理论上的讨论让我入睡。我看不出上面例子中的重点。我们需要的是一个简单的用例。
The problem we Python programmers are having is understanding the
fundamental advantage of eliminating classes and working only with
instances. The theoretical discussions put me to sleep. I can''t see
the point of the examples above. What we need is a simple use case.




我当然没有看到基于原型的系统的重点如果

定义原型的声明(示例中的proto)

看起来非常像构建类的方式。似乎完成的所有内容都是类的语义变化。到原型,这不是
获得任何东西。


比较那些,比如,Io--一个基于原型的系统 - 其中有

根本没有用于定义类的语法或原型。您只需

克隆并附加消息。


-

__ Erik Max Francis&& ma*@alcyone.com && http://www.alcyone.com/max/

/ \美国加利福尼亚州圣何塞市&& 37 20 N 121 53 W&& AIM erikmaxfrancis

\ __ /定罪是真理比敌人更危险的敌人。

- Friedrich Nietzsche



I certainly don''t see the point in having a prototype-based system if
the declaration for defining a prototype (`proto'' in your examples)
looks very much like the way you build a class. All that seems to
accomplish is a semantic change of "class" to "proto," which doesn''t
gain anything.

Compare that to, say, Io -- a prototype-based system -- where there is
no syntax at all for defining a "class" or "prototype." You simply
clone and attach messages as you go.

--
__ Erik Max Francis && ma*@alcyone.com && http://www.alcyone.com/max/
/ \ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
\__/ Convictions are more dangerous enemies of truth than lies.
-- Friedrich Nietzsche




" David MacQuigg" < dm*@gain.com>在消息中写道

news:g9 ******************************** @ 4ax.com ...

"David MacQuigg" <dm*@gain.com> wrote in message
news:g9********************************@4ax.com...
2004年4月27日16:34:56 -0700, ha ***** **@virgin.net (已)写道:
On 27 Apr 2004 16:34:56 -0700, ha*******@virgin.net (has) wrote:
David MacQuigg< dm*@gain.com>写在消息
news:< bn ******************************** @ 4ax.com>。 ..
David MacQuigg <dm*@gain.com> wrote in message news:<bn********************************@4ax.com>. ..
简化类的示例(原型)
============================= ===============
[SNIP]

任何其他名称的基于类的OOP。但是,我已经指出了这一点。见皇帝,衣服;缺乏。

虽然我不认为它们是编程的典范,但我建议您查看我的旧AppleScript库
< http://applemods.sourceforge.net/>。 (注意:脚本是经过编译的,所以你需要一台Mac才能查看源代码。)请参阅类型,HTMLTemplate和ASTest
,了解OO编程的例子,这些编程不是类固定的。可能会提供一些有用的视角。
Example of Simplified Classes ( Prototypes )
============================================
[SNIP]

Class-based OOP by any other name. But then, I''ve pointed this out
already. See Emperor, clothes; lack of.

Here; while I don''t claim them to be paragons of programming, I
suggest taking a look at my old AppleScript libraries at
<http://applemods.sourceforge.net/>. (Note: scripts are compiled, so
you''ll need a Mac to view source.) See Types, HTMLTemplate and ASTest
for examples of OO programming that isn''t class-fixated. Might lend
some useful perspective.



我们Python程序员遇到的问题是理解消除类的基本优势,并且仅与
实例一起工作。理论上的讨论让我入睡。我看不出上面例子中的重点。我们需要的是一个简单的用例。

我已经包含了在我的
Python 3中克隆一个实例的能力。提案
http://ece.arizona.edu/ ~edatools / Pyt ... typeSyntax.htm
这将允许用户完全忽略类,只是从另一个实例,然后是另一个实例,依此类推,修改每个<每当感受到冲动时,一路走来。

以下是我迄今为止在此优惠中的优缺点:

Pro:允许& ;关于即时"编程风格,没有课程。
Con:可以导致更多无纪律的编程。

也许你可以在这里帮助我们。



The problem we Python programmers are having is understanding the
fundamental advantage of eliminating classes and working only with
instances. The theoretical discussions put me to sleep. I can''t see
the point of the examples above. What we need is a simple use case.

I''ve included the ability to clone one instance from another in my
"Python 3" proposal
http://ece.arizona.edu/~edatools/Pyt...typeSyntax.htm
This will allow the user to completely ignore classes, and just make
one instance from another, then another, and so on, modifying each
instance along the way, whenever the urge is felt.

Here is what I have so far in the Pros and Cons on this feature:

Pro: Allows "on-the-fly" programming style with no classes.
Con: Can lead to more undisciplined programming.

Perhaps you can help us here.




到目前为止,我有一个用例:文本冒险游戏编程。

这类游戏中的大多数对象都是一次性的,并且必须创建一个类和一个每个场景的实例比b
更多。这是标准编程

语言在该领域从未获得太多牵引力的原因之一。


这对我来说只是支持那个特别的问题可能会起作用:使用类方法,并且从不打扰

,实际上只是实例化了这些类。我不确定我们会失去什么。 (可能是描述符?)


John Roth


- 戴夫



So far, I have one use case: text adventure game programming.
Most of the objects in such games are one-off, and having to
create a class and an instance for each piece of scenery is more
than a bit much. This is one of the reasons that standard programming
languages have never gotten much traction in that domain.

It''s just occured to me that backing into that particular
issue might work: use class methods and never bother
with instantiating the classes at all. I''m not sure what
we''d lose. (possibly descriptors?)

John Roth


-- Dave



我刚刚发现支持特定的问题可能会起作用:使用类方法并且从不打扰
完全实例化类。我不确定我们会失去什么。 (可能是描述符?)
It''s just occured to me that backing into that particular
issue might work: use class methods and never bother
with instantiating the classes at all. I''m not sure what
we''d lose. (possibly descriptors?)



你已经可以使用:


类测试:

x = 1

t =测试

打印tx

有没有办法在没有制作
$ b实例的情况下调用类方法$ b那班?对我来说这将是有用的,因为你可以模仿模块

而无需创建一个sepperate文件。或者有没有办法让b
做到这一点?


You can already use:

class test:
x = 1

t = test
print t.x
Is there any way to to call a class method without making an instance of
that class? To me that would be useful because you could mimic modules
without having to create a sepperate file. Or is there already a way to
do that?


这篇关于无阶级值得考虑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆