From: mailbox@dmitry-kazakov.de   
      
   On Tue, 23 Jan 2007 18:02:20 +0100, Seweryn Habdank-Wojewódzki wrote:   
      
   > Dmitry A. Kazakov wrote:   
   >   
   >> It is a possible way. But the approach (simpler) was to treat a specific   
   >> unit rather as an interface. I.e. it was legal to sum hours and seconds,   
   >> which is reasonable, we humans doing this on daily basis. Internally all   
   >> computations are performed in SI units. Therefore there is no unit   
   >> conversion s -> hour, there are only second and hour views of the same   
   >> duration value.   
   >   
   > Yes. But I mean if user place values as: 10 [h], so you need recalculate it   
   > internally to the seconds. Hoever not all the time seconds, are enough good   
   > unit. Especially if you are working with huge amount of real time data,   
   > sometimes you need other units, too.   
      
   Right, it makes sense when dealing with fixed point types. It is a very   
   difficult problem though. [No, please, don't propose templates! (:-))]   
   There exist others, like propagation of the unit constraint in homogenous   
   containers from the types of elements to the container type. I.e. how to   
   *automatically* get matrix from matrix>.   
      
   > By the way. Are you using bubble sort or quick sort for any sortings? If you   
   > are using quick sort then you practice something against Knuth rule.   
      
   It is a poor analogy because the choice of an algorithm is not an   
   optimization.   
      
   >> Finding errors in templates? Since when it became cheap? Probably you   
   >> compared it with analyzing hexadecimal post-mortem dumps... however I have   
   >> my reservations in that case too... (:-))   
   >   
   > No. If you are familiar with writing real time libraries, or if you know   
   > Python. There are some errors, that occurs e.g. after several days of work   
   > of the server, because program reach critical point in the code. Some of   
   > errors you can eliminate when you are using tricky template checks. Then of   
   > course many pages of C++ error are nasty, but you will spend 1 hour for   
   > eliminating error, before it occurs.   
   >   
   > I have some (not mine) code from Python, always I have such a probelm, that   
   > program seems to work, and after some time it crashes, because programmer   
   > unfortunately add string to integer, or some library is not reachable.   
      
   OK, if Python is worse than templates, that does not yet excuse the latter.   
   (:-)) If you are arguing for static checks, then I am with you.   
      
   To prevent a further potential argument - both in Ada and in C++   
   dynamically polymorphic subprograms are fully checked. I.e. dispatch cannot   
   fail at run-time.   
      
   >> But this is exactly the problem - *provided* that the solver exists and   
   >> does not return a set instead of one value.   
   >   
   > So what is a problem to design a code for considering a set. I think that   
   > you want to design symbolic algebra library, where computer will   
   > automatically recognize limits, changing types from complex to functions   
   > and back to the sets of measure of aleph_0.   
      
   No, I want to stop earlier, before it would become symbolic, but long after   
   it ceased to be static. I think it is a reasonable compromise. A fully   
   static design were too limiting and I see no advantages in giving away   
   flexibility. What's the gain? A performance gain is a delusion, it is C++   
   artefact. In Ada it is just not exist.   
      
   > Everythink what is   
   > described in your web page is reachable in C++.   
      
   Yes, sure. C++ has dynamic polymorphism. That was not the point. The point   
   was that it were unreachable using solely templates. Again, templates is a   
   design decision to achieve some goals. Which ones? Performance is not an   
   issue to me. What then?   
      
   >> A wrapper won't help, because the template f must know the template   
   >> parameter of C and D at compile time, but nobody can tell that until run   
   >> time.   
   >   
   > Do not forget about such a construction:   
   >   
   > Foo < base_class * > foo;   
      
   If I have base_class, then I don't need any templates anymore.   
      
   > And also a parameter of the tempate can be a pointer to the function. So you   
   > fix structure of the class, respectively that you can put there any   
   > function that satisfies template parameter type.   
      
   What is the gain? A pointer can be a plain parameter of a plain function.   
   The *only* reason for templates in C++ (and generics in Ada) is that a   
   *type* cannot be a plain parameter on anything but a template. All   
   first-class objects can be.   
      
   >> Once you have anything non-static, the whole building collapses.   
   >   
   > No. Again. I have never said that I want to do all in static construction of   
   > the program. If the program is any dynamical. e.g. should cooperate with   
   > user, or adaptively have to change its structure.   
      
   Then you should find a better argument for templates. You let dynamic   
   polymorphism in. Here you are.   
      
   >> It is a castle on the sand. I would go templated only if I were stone-hard   
   >> sure that all potential parameters are static.   
   >   
   > No. This is an error in thinking. Did you newer use a references to   
   > non-static variables or to any derived class?   
      
   But that would be a dynamic polymorphism, while you are trying to make a   
   case against it. So far you just made my point - you could not do it   
   without dynamic polymorphism.   
      
   >>>> OP decomposed f:R->[0,1] into a *finite* set of functions of special   
   >>>> kind (singletons). This is an assumption that does not hold for all   
   >>>> fuzzy sets.   
   >>>   
   >>> E.g.?   
   >>   
   >> Already the complement of, ~{x} is an infinite set.   
   >   
   > for me complement of x is a fuzzy number, combined as membership function   
   > and its support. If read carefully my code in R, you can observe similar   
   > construction. It can be also dynamical,because you can define dynamical   
   > binders, too.   
      
   Please elaborate.   
      
   I meant that complement of a singleton in R is all R but one point.   
   Decomposed into singletons it gives an uncountable set of. This set can be   
   represented but for this a different model is required. You can't switch   
   models on the fly, as you are static.   
      
   >>> Yes. but It depends on the assumptions of the project. Every time you   
   >>> will have a percent of simplifications, isn't it?   
   >>   
   >> Yuck! To redesign the whole mess each time I have new data?   
   >   
   > What you mean new data?   
      
   What are the criteria for being redesigned?   
      
   >> No, I would   
   >> better try to make it as reusable as possible.   
   >   
   > Not at the very beginning. Do you have an implementation of the fuzzy Lie   
   > topologies in the stochastic fuzzy functional spaces with set an scalar   
   > product by the Ito stochastic integral? Or any crazy construction taken   
   > from Fuzzy Setes and Systems. Probably not. Why?   
      
   Because there is little chance of their use. My use-cases do not include   
   them. That does not invalidate the point. The code must be reusable.   
      
   >> Why should I care? Why the compiler cannot do it for me? In the end this   
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|