<slaps forehead>. Ok yes, I'll look at the src. I shouldn't have
forgotten that...
Ian.
> On Tue, Feb 14, 2012 at 6:18 AM, Ian Ozsvald <i
...@ianozsvald.com> wrote:
>> Hmm, I'm not sure I see. Let's take an example:
>> def sq(a):
>> return a*a
>> sq_int = sq(3)
>> sq_float = sq(4.5)
>> In the compiled result are you calling into the Python libs, using the
>> Python Int objects and the Python's Int multiplication? I had figured
>> you compiled all the way down to C's int types and operations, so I'd
>> figured you'd have specialised interfaces on each function for the
>> various combinations of input types.
>> Can you give me an outline of what's actually called in the above
>> example, either in Python or in pure C?
>> Ian.
> I'm sure you know this better than I, but you can look at the .cpp
> file created. In the case above, it creates the single function:
> double sq(double a) {
> return (a*a);
> }
> and it defines the types double and ss_int for your 2 return values.
>> On 14 February 2012 06:16, Mark Dufour <mark.duf...@gmail.com> wrote:
>>> hi ian,
>>>> Am I right in saying that ShedSkin's job is to check all the possible
>>>> variants of input types to a function (e.g. it could take some int
>>>> args, or float args, or double float args) and then it produces
>>>> specialised versions of the function that match each possible input
>>>> argument combination?
>>> this is true for the type inference part, but not anymore for
>>> generated code. it used to be that shedskin would try to generate C++
>>> (class, function) templates for generic code. but because this
>>> complicated code generation quite a bit, was practically unused in
>>> shedskin/examples, and can often be easily worked around in any case,
>>> I decided to take it out in the end..
>>> fortunately the python builtins and support libs are often sufficient
>>> to build a generic datastructure/algorithm.
>>> thanks!
>>> mark.
>>> --
>>> http://www.youtube.com/watch?v=E6LsfnBmdnk
>>> --
>>> You received this message because you are subscribed to the Google Groups "shedskin-discuss" group.
>>> To post to this group, send email to shedskin-discuss@googlegroups.com.
>>> To unsubscribe from this group, send email to shedskin-discuss+unsubscribe@googlegroups.com.
>>> For more options, visit this group at http://groups.google.com/group/shedskin-discuss?hl=en.
>> --
>> Ian Ozsvald (A.I. researcher)
>> i...@IanOzsvald.com
>> http://IanOzsvald.com
>> http://MorConsulting.com/
>> http://StrongSteam.com/
>> http://SocialTiesApp.com/
>> http://TheScreencastingHandbook.com
>> http://FivePoundApp.com/
>> http://twitter.com/IanOzsvald
>> --
>> You received this message because you are subscribed to the Google Groups "shedskin-discuss" group.
>> To post to this group, send email to shedskin-discuss@googlegroups.com.
>> To unsubscribe from this group, send email to shedskin-discuss+unsubscribe@googlegroups.com.
>> For more options, visit this group at http://groups.google.com/group/shedskin-discuss?hl=en.
> --
> You received this message because you are subscribed to the Google Groups "shedskin-discuss" group.
> To post to this group, send email to shedskin-discuss@googlegroups.com.
> To unsubscribe from this group, send email to shedskin-discuss+unsubscribe@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/shedskin-discuss?hl=en.
Ian Ozsvald (A.I. researcher)