y*e
2 楼
你研究了Python的class,OOP吗?
c*e
8 楼
en, its not bad. I have used it for some post log processing job when I need
it fast, yet sed/awk is not powerful enuf. one problem so far, its not very
fast in my case, however I didnt get a counter perl script to compare so ...
btw, all of u old birds stop bashing c++, no matter what drawback it has, it
is the best programming lang today in terms of usability and capability
IMHO.
it fast, yet sed/awk is not powerful enuf. one problem so far, its not very
fast in my case, however I didnt get a counter perl script to compare so ...
btw, all of u old birds stop bashing c++, no matter what drawback it has, it
is the best programming lang today in terms of usability and capability
IMHO.
t*t
9 楼
你等着瞧, 马上goodbug就会出来的
need
very
...
it
【在 c********e 的大作中提到】
: en, its not bad. I have used it for some post log processing job when I need
: it fast, yet sed/awk is not powerful enuf. one problem so far, its not very
: fast in my case, however I didnt get a counter perl script to compare so ...
: btw, all of u old birds stop bashing c++, no matter what drawback it has, it
: is the best programming lang today in terms of usability and capability
: IMHO.
need
very
...
it
【在 c********e 的大作中提到】
: en, its not bad. I have used it for some post log processing job when I need
: it fast, yet sed/awk is not powerful enuf. one problem so far, its not very
: fast in my case, however I didnt get a counter perl script to compare so ...
: btw, all of u old birds stop bashing c++, no matter what drawback it has, it
: is the best programming lang today in terms of usability and capability
: IMHO.
r*t
10 楼
python code ,不管谁写的,indent 都一样,这是一个优点。
我的印象是 everything is passed by reference.
perl
【在 i*****f 的大作中提到】
: 个人觉得python各种ideas挺另类的,比如scope用缩进什么的。还有pass by
: reference我也没搞清楚,好像scaler tuple什么的不能pass by reference?
: 可能我比较土,也没真正好好学习python,只是断断续续看了点tutorial。
: 我现在就是Tcl用的比较熟,我学scripting lang的过程是,try python -> try perl
: -> try Tcl -> 最喜欢Tcl然后就一直用下来,呵呵
我的印象是 everything is passed by reference.
perl
【在 i*****f 的大作中提到】
: 个人觉得python各种ideas挺另类的,比如scope用缩进什么的。还有pass by
: reference我也没搞清楚,好像scaler tuple什么的不能pass by reference?
: 可能我比较土,也没真正好好学习python,只是断断续续看了点tutorial。
: 我现在就是Tcl用的比较熟,我学scripting lang的过程是,try python -> try perl
: -> try Tcl -> 最喜欢Tcl然后就一直用下来,呵呵
i*f
15 楼
Yes I read about 'everything is passed by reference' in "Learn Python in 10
minutes" but it says:
"Parameters are passed by reference, but immutable types (tuples, ints,
strings, etc) cannot be changed. This is because only the memory location of
the item is passed, and binding another object to a variable discards the
old one, so immutable types are replaced."
And the function's default value issue is also wiered to me. In "Python
Tutorial":
"Important warning: The default value is evaluated on
【在 r****t 的大作中提到】
: python code ,不管谁写的,indent 都一样,这是一个优点。
: 我的印象是 everything is passed by reference.
:
: perl
minutes" but it says:
"Parameters are passed by reference, but immutable types (tuples, ints,
strings, etc) cannot be changed. This is because only the memory location of
the item is passed, and binding another object to a variable discards the
old one, so immutable types are replaced."
And the function's default value issue is also wiered to me. In "Python
Tutorial":
"Important warning: The default value is evaluated on
【在 r****t 的大作中提到】
: python code ,不管谁写的,indent 都一样,这是一个优点。
: 我的印象是 everything is passed by reference.
:
: perl
r*t
16 楼
这个挺正常,我读不出有什么奇怪的地方。这段话是解释即使是immutables are also passed by reference,然后指出其 implication。你觉得什么地方有问题?
10
of
【在 i*****f 的大作中提到】
: Yes I read about 'everything is passed by reference' in "Learn Python in 10
: minutes" but it says:
: "Parameters are passed by reference, but immutable types (tuples, ints,
: strings, etc) cannot be changed. This is because only the memory location of
: the item is passed, and binding another object to a variable discards the
: old one, so immutable types are replaced."
: And the function's default value issue is also wiered to me. In "Python
: Tutorial":
: "Important warning: The default value is evaluated on
10
of
【在 i*****f 的大作中提到】
: Yes I read about 'everything is passed by reference' in "Learn Python in 10
: minutes" but it says:
: "Parameters are passed by reference, but immutable types (tuples, ints,
: strings, etc) cannot be changed. This is because only the memory location of
: the item is passed, and binding another object to a variable discards the
: old one, so immutable types are replaced."
: And the function's default value issue is also wiered to me. In "Python
: Tutorial":
: "Important warning: The default value is evaluated on
r*t
17 楼
你要问 why 就不好回答了,interpreter 第一次遇到 def func() 又有 default
argument 的时候不得不 evaluate default argument 吧?after that, the argument
name is bound to the default value. Because default argument is a signature
of the function, they should not be destroyed after the function returns.
Thus when you call the function again, because the function definition will
not happen again, and the default arguments is kept. The default arguments
are shared in successive calls.
第二个问题,I did not get you, what problem you w
【在 i*****f 的大作中提到】
: Yes I read about 'everything is passed by reference' in "Learn Python in 10
: minutes" but it says:
: "Parameters are passed by reference, but immutable types (tuples, ints,
: strings, etc) cannot be changed. This is because only the memory location of
: the item is passed, and binding another object to a variable discards the
: old one, so immutable types are replaced."
: And the function's default value issue is also wiered to me. In "Python
: Tutorial":
: "Important warning: The default value is evaluated on
argument 的时候不得不 evaluate default argument 吧?after that, the argument
name is bound to the default value. Because default argument is a signature
of the function, they should not be destroyed after the function returns.
Thus when you call the function again, because the function definition will
not happen again, and the default arguments is kept. The default arguments
are shared in successive calls.
第二个问题,I did not get you, what problem you w
【在 i*****f 的大作中提到】
: Yes I read about 'everything is passed by reference' in "Learn Python in 10
: minutes" but it says:
: "Parameters are passed by reference, but immutable types (tuples, ints,
: strings, etc) cannot be changed. This is because only the memory location of
: the item is passed, and binding another object to a variable discards the
: old one, so immutable types are replaced."
: And the function's default value issue is also wiered to me. In "Python
: Tutorial":
: "Important warning: The default value is evaluated on
i*f
18 楼
Yes, "why" is not apropriate here:) Since I don't really know that much on
how scripting lang. works, that's why I feel uncomfortable with this default
arg. issue.
However, as far as I know, in Tcl, function's default arg. value behaves
quite different from what I learnt in python, and more similar to c++:
how scripting lang. works, that's why I feel uncomfortable with this default
arg. issue.
However, as far as I know, in Tcl, function's default arg. value behaves
quite different from what I learnt in python, and more similar to c++:
r*t
19 楼
Ah, I see what's confusing!
What L is bound to depends on how the user calls f(): every time f() is
called, L is either bound to default object None (because user doesn't
specify L) or some object that has .append method (what's passed in). After
the function returned, L loses bound to what's passed in, thus the function
doesn't keep a reference to the data it had finished working on. different with
the previous case where the function kept a reference to the object as the
default argument, and
【在 i*****f 的大作中提到】
: Yes, "why" is not apropriate here:) Since I don't really know that much on
: how scripting lang. works, that's why I feel uncomfortable with this default
: arg. issue.
: However, as far as I know, in Tcl, function's default arg. value behaves
: quite different from what I learnt in python, and more similar to c++:
What L is bound to depends on how the user calls f(): every time f() is
called, L is either bound to default object None (because user doesn't
specify L) or some object that has .append method (what's passed in). After
the function returned, L loses bound to what's passed in, thus the function
doesn't keep a reference to the data it had finished working on. different with
the previous case where the function kept a reference to the object as the
default argument, and
【在 i*****f 的大作中提到】
: Yes, "why" is not apropriate here:) Since I don't really know that much on
: how scripting lang. works, that's why I feel uncomfortable with this default
: arg. issue.
: However, as far as I know, in Tcl, function's default arg. value behaves
: quite different from what I learnt in python, and more similar to c++:
i*f
22 楼
同意。当初最吸引我的是tcl关于everything is string, first string is command的
概念。知道这个规律加上几个variable, command substitution就够了,很简单很清晰
,对于我这样的懒人不错!呵呵!
exec也还好吧,还有open也可以用。我觉得夸张点Tcl都可以当个shell来用了(当然和
bash就各有侧重了).
list
概念。知道这个规律加上几个variable, command substitution就够了,很简单很清晰
,对于我这样的懒人不错!呵呵!
exec也还好吧,还有open也可以用。我觉得夸张点Tcl都可以当个shell来用了(当然和
bash就各有侧重了).
list
i*f
23 楼
Oh, thank you for the explanation! I understand what's going on here. And
also have some idea on how passing by ref. works in Python! Maybe I can
spend some time continue this tutorial.
Thanks:)
After
function
with
【在 r****t 的大作中提到】
: Ah, I see what's confusing!
: What L is bound to depends on how the user calls f(): every time f() is
: called, L is either bound to default object None (because user doesn't
: specify L) or some object that has .append method (what's passed in). After
: the function returned, L loses bound to what's passed in, thus the function
: doesn't keep a reference to the data it had finished working on. different with
: the previous case where the function kept a reference to the object as the
: default argument, and
also have some idea on how passing by ref. works in Python! Maybe I can
spend some time continue this tutorial.
Thanks:)
After
function
with
【在 r****t 的大作中提到】
: Ah, I see what's confusing!
: What L is bound to depends on how the user calls f(): every time f() is
: called, L is either bound to default object None (because user doesn't
: specify L) or some object that has .append method (what's passed in). After
: the function returned, L loses bound to what's passed in, thus the function
: doesn't keep a reference to the data it had finished working on. different with
: the previous case where the function kept a reference to the object as the
: default argument, and
i*f
27 楼
awk 不是很熟。我有做一个简单的call gnuplot画图的脚本。就是用open pipe到
gnuplot写gnuplot的命令,应该也可以读,感觉还行。
gnuplot写gnuplot的命令,应该也可以读,感觉还行。
m*t
28 楼
I just needed a scripting language in my toolbox for,
well, scripting things.
I could do most things in bash, but the logical test
operations in bash are just horrific.
Perl was ruled out because I would like to
be able to actually understand what I wrote after
a while.
Python I tried as well, but disliked the strong C
flavor, and the "indentations matter" philosophy.
So ruby turned out to be quite flexible, with a strong
OO style. _And_ the potential to integrate with java via
jruby. That's a
【在 g*****g 的大作中提到】
: What are you using ruby for? pure ruby or jruby?
相关阅读
一个非常有难度的问题python注释问题。google launches open source project hostinga C questionusing namespace std; 比 using std::vector; 效率低么?thxan interview question怎么把程序从Matlab转到C++?急问:大家一般都用什么profiling工具和memory leak的监测工release Vs. debug???don't understand this list (C++ STL)A function can be history-sensitive??????Windows多媒体编程入门问题请教matlab转C++Fortran question: FORMAT(3HXY=3I)Spatial data structure problemPWEditorWhat is 'relative computing'?一个矩阵分解的问题(对称实矩阵)Question about Base Tag...AJAX programming book collection