Questions tagged [implementation]

Deals with various issues of implementation.

Deals with various issues of implementation of functions, features, languages, etc.

2196 questions
9
votes
2 answers

Implementation Strategies for Object Orientation

I'm currently learning Smalltalk in the Squeak environment and I'm reading "Squeak - A Quick Trip To ObjectLand". I enter the object-oriented paradigm with some prior knowledge from Python and Java and this sentence from the book on page 36 has made…
f4lco
  • 3,728
  • 5
  • 28
  • 53
9
votes
2 answers

How to find "essential" methods to provide an interface of Ruby mixins?

The horribleness of the title of the question is what I'm trying to solve. Example: in Ruby, Enumerable is an interface in a sense that I can implement something and document it as: def myfancymethod(please_pass_me_an_Enumerable_here) but on the…
ulver
  • 1,521
  • 16
  • 29
9
votes
3 answers

What is the point of this code?

I'm reading through the source code for ASP.NET MVC3, and I came across the following inside of the code for ControllerBase: public interface IController { void Excecute(RequestContext requestContext); } public abstract class ControllerBase :…
Mike Bailey
  • 12,479
  • 14
  • 66
  • 123
8
votes
4 answers

Function closure performance

I thought that I improve performance when I replace this code: def f(a, b): return math.sqrt(a) * b result = [] a = 100 for b in range(1000000): result.append(f(a, b)) with: def g(a): def f(b): return math.sqrt(a) * b return f result =…
max
  • 49,282
  • 56
  • 208
  • 355
8
votes
3 answers

How is ruby on rails has_many (and similar) implemented?

I am analysing the rails source code, because I wold like to understand the inner workings of the has_many and similar constructs. So far, I was able to find where the method is implemented (link to github): it is in the module…
Tadej Mali
  • 1,143
  • 8
  • 18
8
votes
2 answers

Is the implementation of Delphi interface reference counting future proof

I have a helper class that will be in wide use across the application. The implementation relies on interface reference counting, the idea roughly is: ... var lHelper: IMyHelper; begin lHelper := TMyHelper.Create(some params); ...some code…
user219760
8
votes
3 answers

What is the significance for Ruby programmers of SAP's new implementation of Ruby?

SAP announced Blue Ruby, a version of Ruby that runs inside the ABAP Virtual Machine. This seems to lend additional credibility to the Ruby language but, except for SAP developers, does this have any applicability to the rest of the Ruby community?…
Paul Dexter
  • 405
  • 1
  • 4
  • 10
8
votes
8 answers

Is it correct that header files in C++ and abstract class/interface implementations in Java are both the same idea?

I am a little with familiar with C++ and I know that for almost every header file, I must create source file to go with it. Now I am looking into java interfaces and implementation and it looks as the same thing. At first you just name the variables…
Jaanus
  • 16,161
  • 49
  • 147
  • 202
8
votes
8 answers

What's the right way to design my interface when I have operations that aren't supported by all implementers?

I have an Interface and two Classes which are implementing the Interface. public interface MyInterface { public void firstMethod(); public int secondMethod(); } public class MyClass1 implements MyInterface { public void firstMethod()…
Wassim AZIRAR
  • 10,823
  • 38
  • 121
  • 174
8
votes
2 answers

array_slice (or other array_* functions) on ArrayObject

I have a question regarding ArrayObject. I wanted to use array_slice in an ArrayObject class and I couldn't. Is there a way to do it, without needing to write an "slice" method to the class that implements ArrayObject?
pocesar
  • 6,860
  • 6
  • 56
  • 88
8
votes
2 answers

implementing lisp in Python

First: yes, i have taken a very long look at Norvig's lispy. Second: I have reused part of his code. On to my code, and my question. I am writing a really non-idiomatic lisp interpreter in Python, and I'm curious as to how I would write nested…
tekknolagi
  • 10,663
  • 24
  • 75
  • 119
8
votes
2 answers

Simple implementation for detecting cycles in a directed graph in C#

I wonder if you could help me with a simple implementation for detecting cycles in a directed graph in C#. I've read about the algorithms but I'd like to find something already implemented, very simple and short. I don't care about the performance…
Homam
  • 23,263
  • 32
  • 111
  • 187
8
votes
2 answers

Why is the Java source code implementation for Android different from the regular Java implementation for the same classes?

I decided to start coding for Android. Before the decision, I spent a lot of time improving my Java skills, hoping that it would help me also with Android development. Today, after opening some classes (e.g. HashMap), I saw that the Android…
Eitanos30
  • 1,331
  • 11
  • 19
8
votes
3 answers

Why Are There Different Ruby Implementations?

I am a novice programmer who mainly uses Java. Recently I have become interested in Ruby, and when I went to download an IDE, I was surprised to find that there is no single implementation or interpreter of the language. I've been trying to…
cotroxell
  • 183
  • 4
8
votes
2 answers

The implementations of the "Unicode Line Breaking Algorithm" (UAX#14)

I've been searching around to find a latest implementation of the Unicode Line Breaking Algorithm (UAX#14) to port it for my needs. I've found an old, but seemingly normative sample implementation of the algorithm, in which a "Pair Table-Based…
user5222086