Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005990OCamlOCaml generalpublic2013-04-18 16:062013-06-19 12:45
Reporterfrisch 
Assigned To 
PrioritylowSeverityfeatureReproducibilityhave not tried
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005990: Calling a method from a super class on a modified version of self
DescriptionA common idiom when using objects and classes to define customizable iterators is the following:

let o = object
  inherit generic_iterator as super

  val path = []

  method! foo x = {< path = x.name :: path >} # super_foo x
  method super_foo = super # foo
end


i.e. one wants to call a method from a super class on a modified version of self (using functional object update). I'm wondering whether it would make sense to have a new language construction allowing such a call directly without going through a "trampoline" method like above; something like:

let o = object
  inherit generic_iterator as super

  val path = []

  method! foo x = {< super with path = x.name :: path >} # foo x
end

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2013-04-18 16:06 frisch New Issue
2013-06-19 12:45 doligez Status new => acknowledged


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker