For Programmers: Free Programming Magazines  


Home > Archive > Fortran > December 2005 > Re: Namespace suggestion









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Namespace suggestion
Brooks Moses

2005-12-08, 7:15 pm

Colin Watters wrote:
> Modified:
>
> module mmm_mod
> type mmm_type
> real(8) :: aa
> real(8) :: bb
> integer :: ii
> end type mmm_type
> type(mmm_type) mmm
> end module mmm_mod
>
> This would require use of mmm%aa instead of just aa.
>
> ...not sure how far one can go with this. just an idle idea...


One obvious place one could go with it is having other variables of
mmm_type, and have all of the subroutines in mmm_mod take a variable of
mmm_type as their first argument, rather than getting them directly from
the module's variables. And now you've got something that's starting to
look like objects, though there's no polymorphism.

- Brooks


--
The "bmoses-nospam" address is valid; no unmunging needed.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com