X-Git-Url: https://git.elephly.net/?p=software%2Fpython-on-guile.git;a=blobdiff_plain;f=modules%2Foop%2Fpf-objects.scm;h=579a148b817919fef8ac148f9286c888498e5d8a;hp=25c49603ce16f902e5250f452797ca8df752c790;hb=85d5763490601299daa660bef455b0eaae8b2560;hpb=9cff626018531a50ab026e28a2354d252957fc2c diff --git a/modules/oop/pf-objects.scm b/modules/oop/pf-objects.scm index 25c4960..579a148 100644 --- a/modules/oop/pf-objects.scm +++ b/modules/oop/pf-objects.scm @@ -372,15 +372,16 @@ explicitly tell it to not update etc. (apply it class x) (make-object class meta goops)))) - (aif it (ficap class '__init__ #f) - (apply it obj x) - #f) + (when (struct? obj) + (aif it (ficap class '__init__ #f) + (apply it obj x) + #f) - (slot-set! obj 'procedure - (lambda x - (aif it (ref obj '__call__) - (apply it x) - (error "not a callable object")))) + (slot-set! obj 'procedure + (lambda x + (aif it (ref obj '__call__) + (apply it x) + (error "not a callable object"))))) obj))