
|
Posted by pohdes @ Fri 21 Mar, 08, 05:34PM under Programming
Has been looking at Android for quite sometime. Learn up some java, the package available for Android and their usage, but without a project, really no mood to write anything for Android. Plus, no device come with Android yet. Sigh......feel so bored. Really hope to be able to see something in the market with Android installed, by then I should have some ideas of what programs can I write for my own phone. :)
Posted by pohdes @ Fri 15 Feb, 08, 11:15AM under Programming
For so many programming languages I learned, Tcl has the best global variable usage. It is really good where you can't just use any global variable just like that. Example, in PERL: #!/usr/bin/perl our $file = "abc.txt"; With the declaration above, you can use $file in any subroutine. For Tcl, this is not the case. If you need the variable to be global, you'll need to define it as global: global file set file "abc.txt" Then, when you need to use it in subroutine, you need to do this: proc sub_routine {} { global file puts $file } Without the declaration of "global file" in the subroutine, the variable "file" will be undefined. This is cool......There is no way of misbehave for the global variable. :P
Posted by pohdes @ Tue 12 Feb, 08, 10:36PM under Programming
My current work is really challenging, having knowledge of C, C++, SKILL, PERL and csh seems to be not enough to do the work, recently has been starting to work with tcl which is yet another programming language. It is pretty hard to learn as tcl is quite different compare with the programming language i knew. tcl can be consider as a mix of C and csh. It's language a bit like csh and a bit like C, but it doesn't behave like either of them and it is definitely not C or csh. (this sentence sounds like...... :P) The most significant difference is the sequence of the tcl interpreter. Not like C, C++, PERL, SKILL and csh interpreter/compiler which has the sequence of: 1. Remove all comment 2. Remove all unnecessary white spaces 3. group command 4. interpret/compile tcl has the sequence of: 1. group command 2. remove all comment 3. remove all unnecessary white spaces 4. interpret This means that you can write code like this: set flag 0 if { $flag == 0 } { puts "Flag is $flag" # This is a comment } else { puts "Flag is not zero } The code above will still work. :) So, there are extra care for tcl if you are used to C, C++, PERL, csh and other C-like programming languages. After 2 weeks of tickling (:P), I finally get used to the natural behaviour of tcl. I have to admit that tcl is way more flexible and powerful compare to PERL (Some of you might not agree) as it enable the interfacing to C language easily and it has been widely use among all the EDA tools company. Anyway, I'm still a noob in tcl, there are more for me to catch up on the language. Wish me luck. :) |
Categories
Archive
Latest Posts
My Old Blog...
|