Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

ANN: Seed7 Release 2008-02-17
Hello,

I have released a new version of Seed7: seed7_05_20080217.tgz

In the Seed7 programming language new statements and operators
can be declared easily. Types are first class objects and therefore
templates/generics need no special syntax. Object orientation is
used when it brings advantages and not in places when other
solutions are more obvious.

Seed7 is covered by the GPL (and LGPL for the Seed7 runtime library).

Changelog:
- A new chapter about object orientation was added to the manual
(Many thanks for the feedback to Leonardo Cecchi, Malcolm McLean
and Reinder Verlinde).
- The manual was changed to mention that the 'in' parameter of arrays
and structs is a reference ('ref') parameter.
- The faq was improved to contain a paragraph about static type
checking.
- The implementation type NULL_FILE was renamed to null_file.
- The struct copy of the compiler (comp.sd7) was changed to leave the
dynamic type unchanged.
- The following primitive actions were added or improved in the
compiler (comp.sd7): FIL_ERR, FIL_IN, FIL_OUT, FLT_GROW, FLT_MCPY,
HSH_INCL, HSH_LNG, INT_PLUS, PRG_EXEC, PRG_STR_ANALYZE, SCR_CURSOR
and STR_GETENV.
- The primitive action CLS_CREATE2 was changed to call the
CLEAR_TEMP_FLAG macro (This is a fix for a bug found by
Leonardo Cecchi).
- The function match_subexpr_type was changed to allow normal (not
DYNAMIC) interface functions to be used for implementation values.
- The primitive action PRC_GETENV was renamed to STR_GETENV.
- The bas7.sd7 (basic interpreter) example program was improved.
- A bug in the primitive action RFL_NOT_ELEM was fixed.
- The functions copy_list, array_to_list and struct_to_list were
change to return thecreated list.

Greetings Thomas Mertes

Seed7 Homepage:  http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch.

Report this thread to moderator Post Follow-up to this message
Old Post
thomas.mertes@gmx.at
02-18-08 12:47 AM


Re: ANN: Seed7 Release 2008-02-17
On Feb 17, 10:13=A0pm, thomas.mer...@gmx.at wrote:


[From Seed 7 FAQ]
>Variables with object types contain references to object values....
> a :=3D b

>For primitive types a different logic is used...
> a :=3D b
>both variables are still distinct and changing one variable has no effect o=[/color
]
n the other.

This is more of a general question about a:=3Db for a class object being
different from a:=3Db for an ordinary object. It seems to be the case in
several oo languages.

Why?

OK, objects are implemented by reference and all that, and maybe this
saves some copying, but that should all be transparent.

Surely the meaning of something as basic as a:=3Db should not depend on
something as arbitrary as whether a and b have datatypes T or U. If
someone changes their mind then a lot of recoding might be needed!

--
Bart

Report this thread to moderator Post Follow-up to this message
Old Post
Bart
02-19-08 12:21 AM


Re: ANN: Seed7 Release 2008-02-17
On 18 Feb., 22:02, Bart <b...@freeuk.com> wrote:
> On Feb 17, 10:13 pm, thomas.mer...@gmx.at wrote:
>
> [From Seed 7 FAQ]
> 
>
> This is more of a general question about a:=b for a class object being
> different from a:=b for an ordinary object. It seems to be the case in
> several oo languages.
>
> Why?
IMHO it is a cornerstone of classic OO programming languages
like Smalltalk and its descendants: Object variables and
parameters contain just pointers to the actual object value
which is at the heap. It is almost not mentioned by OO
proponents but in classic OO programming not everything is
done with methods. Assignments are always done as pointer
assignments, independend of the object class. Also comparisons
are done as pointer comparisons. Therefore a 'clone' method
to do deep copies and an 'compare' method to do logical
comparisons is necessary.

The advantage of this OO pointer philosophy is that container
classes are easier to implement (they store just pointers in
the container).

> OK, objects are implemented by reference and all that, and maybe this
> saves some copying, but that should all be transparent.
>
> Surely the meaning of something as basic as a:=b should not depend on
> something as arbitrary as whether a and b have datatypes T or U. If
> someone changes their mind then a lot of recoding might be needed!

Most OO programmers have the different assignment logic for
object variables in their mind. They would be  when
those assignments would work as deep copies (As Seed7 does
for all other types).

IIRC Simula had two different assignment operators:
:= For value copy assignments
:- For reference assignments

Seed7 is an extensible programming language.
It would be possible to define the assignment to do a (deep)
copy of the implementation (object) value and to have
a different operator to do reference assignment.

I don't belive that OO fan's would be happy without
reference assignment?

What do you think?

Greetings Thomas Mertes

Seed7 Homepage:  http://seed7.sourceforge.net
Seed7 - The extensible programming language: User defined statements
and operators, abstract data types, templates without special
syntax, OO with interfaces and multiple dispatch.

Report this thread to moderator Post Follow-up to this message
Old Post
thomas.mertes@gmx.at
02-20-08 12:35 AM


Re: ANN: Seed7 Release 2008-02-17
thomas.mertes@gmx.at wrote:
> On 18 Feb., 22:02, Bart <b...@freeuk.com> wrote: 
> IMHO it is a cornerstone of classic OO programming languages
> like Smalltalk and its descendants: Object variables and
> parameters contain just pointers to the actual object value
> which is at the heap. It is almost not mentioned by OO
> proponents but in classic OO programming not everything is
> done with methods. Assignments are always done as pointer
> assignments, independend of the object class. Also comparisons
> are done as pointer comparisons. Therefore a 'clone' method
> to do deep copies and an 'compare' method to do logical
> comparisons is necessary.
>
> The advantage of this OO pointer philosophy is that container
> classes are easier to implement (they store just pointers in
> the container).
> 
>
> Most OO programmers have the different assignment logic for
> object variables in their mind. They would be  when
> those assignments would work as deep copies (As Seed7 does
> for all other types).
>
> IIRC Simula had two different assignment operators:
>  := For value copy assignments
>  :- For reference assignments
>
> Seed7 is an extensible programming language.
> It would be possible to define the assignment to do a (deep)
> copy of the implementation (object) value and to have
> a different operator to do reference assignment.
>
> I don't belive that OO fan's would be happy without
> reference assignment?
>
> What do you think?

I think it's a bit late to change things now.

I suppose I just have to think about objects as pointers instead, with
whatever they're pointing to being automatically managed:

ptrA := ptrB    ( programming equivalent of training wheels :-)

--
Bart




Report this thread to moderator Post Follow-up to this message
Old Post
Bartc
02-20-08 12:35 AM


Re: ANN: Seed7 Release 2008-02-17
As t may be applied to a recursion,

ptrA := ptrB

is possibly the only way to fly.  I have been reading on the topic of data
structures, and one author who i located in the group being sold at
powells.com.  Any comment on this book note written by his publisher?

While many computer science textbooks are confined to teaching programming
code and languages, Algorithms and Data Structures: The Science of Computing
takes a step back to introduce and explore algorithms - the content of the
code. Focusing on three core topics: design (the architecture of
algorithms), theory (mathematical modeling and analysis), and the scientific
method (experimental confirmation of theoretical results), the book helps
students see that computer science is about problem solving, not simply the
memorization and recitation of languages. Unlike many other texts, the
methods of inquiry are explained in an integrated manner so students can see
explicitly how they interact. Recursion and object oriented programming are
emphasized as the main control structure and abstraction mechanism,
respectively, in algorithm design. Designed for the CS2 course, the book
includes text exercises and has laboratory exercises at the supplemental Web
site.

Saturday's 6 $million Dubai World Cup race features Curlin.  He ran a good
one on the track last month.  Now he's back for all the marble.  coverage in
today's Handicapper's edge at
http://www.tsnhorse.com/cgi-bin/edi...ull_edition.cgi

GL at the races


"Bartc" <bc@freeuk.com> wrote in message
news:iQJuj.10236$XI.7988@text.news.virginmedia.com...
> thomas.mertes@gmx.at wrote: 
>
> I think it's a bit late to change things now.
>
> I suppose I just have to think about objects as pointers instead, with
> whatever they're pointing to being automatically managed:
>
> ptrA := ptrB    ( programming equivalent of training wheels :-)
>
> --
> Bart
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Captain Tony Valare
03-27-08 12:43 AM


Re: ANN: Seed7 Release 2008-02-17
With recursion  being a main control structure, as the author suggests,
somewhere I missed the boat.  I've never used recursion except once in a
prime number analysis algorithm from a programming book.  It said that epime
numbers were a combination of prime factors (which makes sense), so to find
the primes the algorithm factor all the factors, so it used the same few
steps and substituted the last prime factors by calling the function
recursively.  I might see how this is practical in two dimensional arrays
i.e., linear optimization algorithms..  It would seem good to process the
bit maps that draw the screen.

Those seem to be structures which fit the use of a recussive algorithm. The
data structure is supposed to meet the requirement of the programming
problem to be solved.  so anybody know any prime numbers for analyzing.  I
gotr just the control structure for that!

"Bartc" <bc@freeuk.com> wrote in message
news:iQJuj.10236$XI.7988@text.news.virginmedia.com...
> thomas.mertes@gmx.at wrote: 

>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Captain Tony Valare
03-27-08 03:52 AM


Re: ANN: Seed7 Release 2008-02-17
Captain Tony Valare said:

> With recursion  being a main control structure, as the author suggests,
> somewhere I missed the boat.  I've never used recursion except once in a
> prime number analysis algorithm from a programming book.  It said that
> epime numbers were a combination of prime factors (which makes sense),

No, it makes no sense at all. Primes /are/ prime factors. They are not
combinations of anything. That is practically the definition of primes!

Exercise: here are the first ten primes: 2, 3, 5, 7, 11, 13, 17, 19, 23,
29. List their prime factors.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999

Report this thread to moderator Post Follow-up to this message
Old Post
Richard Heathfield
03-27-08 10:13 AM


Re: ANN: Seed7 Release 2008-02-17
On Thu, 27 Mar 2008 06:41:43 +0000, Richard Heathfield
<rjh@see.sig.invalid> wrote:

>Captain Tony Valare said:
> 
>
>No, it makes no sense at all. Primes /are/ prime factors. They are not
>combinations of anything. That is practically the definition of primes!
>
>Exercise: here are the first ten primes: 2, 3, 5, 7, 11, 13, 17, 19, 23,
>29. List their prime factors.

Well, it may or may not make sense.  It rather depends upon what
an epime number might be and what kind of combining is being
done.


Richard Harter, cri@tiac.net
http://home.tiac.net/~cri, http://www.varinoma.com
Save the Earth now!!
It's the only planet with chocolate.

Report this thread to moderator Post Follow-up to this message
Old Post
Richard Harter
03-27-08 10:13 AM


Re: ANN: Seed7 Release 2008-02-17
I spent a 1/2 hour to find a line by Stephen Kochan of Bell Labs ,
Programming in C 1988 Hayden Books, "One method for generating prime numbers
involves an approach which uses the notion that a number is prime if it is
not evenly divisible by any other prime number.  This stems from the fact
that any non-prime integer can be expressed as a multiple of prime factors.
(For example 20, has the prime factors 2, 2, and 5).  The program algorithm
can test if a given integer is a prime by determining if it is evenly
divisible by any other previously generated prime.  The term used
"previously generated" suggests that a recursive function is useful.

As a further optimization of the prime number generator program, it can be
demonstrated that any non-prime integer n, must have as one of its factors
an integer that is less then or equal to the square root of n.

So it is only necessary to determine if a given integer is prime by testing
it for even divisibility against all prime factors up to the square root of
the integer.
(but all those are infested by prime factors).  So those primes can be
generated by using prime factors.  It was not quite as straight forward as
you all believed.  I ultimately could show what coincidence there was
between prime factors of the eventually generated primes.  (what a nail
biter that was)>


"Richard Heathfield" <rjh@see.sig.invalid> wrote in message
news:3tadnbYxX94v3XbaRVnyvQA@bt.com...
> Captain Tony Valare said:
> 
>
> No, it makes no sense at all. Primes /are/ prime factors. They are not
> combinations of anything. That is practically the definition of primes!
>
> Exercise: here are the first ten primes: 2, 3, 5, 7, 11, 13, 17, 19, 23,
> 29. List their prime factors.
>
> --
> Richard Heathfield <http://www.cpax.org.uk>
> Email: -http://www. +rjh@
> Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
> "Usenet is a strange place" - dmr 29 July 1999



Report this thread to moderator Post Follow-up to this message
Old Post
Captain Tony Valare
03-28-08 12:28 AM


Re: ANN: Seed7 Release 2008-02-17
[Top-posting fixed]

Captain Tony Valare said:
> "Richard Heathfield" <rjh@see.sig.invalid> wrote in message
> news:3tadnbYxX94v3XbaRVnyvQA@bt.com... 
<snip>

> So it is only necessary to determine if a given integer is prime by
> testing it for even divisibility against all prime factors up to the
> square root of the integer.

Yes, but that doesn't mean that primes are a combination of prime factors
(which is what you actually said in your previous article).

> (but all those are infested by prime factors).  So those primes can be
> generated by using prime factors.

Certainly true.

>  It was not quite as straight forward as you all believed.

We're not mind readers. I replied to what you wrote, not to what you may
have meant to write.

> I ultimately could show what coincidence there was
> between prime factors of the eventually generated primes. (what a nail
> biter that was)

Yes, it must have been astounding to discover that every single prime had
the same number of prime factors... none whatsoever.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999

Report this thread to moderator Post Follow-up to this message
Old Post
Richard Heathfield
03-28-08 12:28 AM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:01 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.