RE: [R] Defining binary indexing operators

From: Huntsinger, Reid <>
Date: Thu 28 Apr 2005 - 06:09:37 EST

That sounds like a recipe for headaches. If you want to use "x$y" because you want a certain kind of "x" to act like a list with components for certain "y", then you probably want to make a class of objects (x) which have "x$y" implemented as foo(x,y). That way you won't break existing code.

Reid Huntsinger

-----Original Message-----
[] On Behalf Of Ali - Sent: Wednesday, April 27, 2005 3:11 PM
Subject: [R] Defining binary indexing operators

Assume we have a function like:

foo <- function(x, y)

how is it possible to define a binary indexing operator, denoted by $, so that


functions the same as

foo(x, y) mailing list PLEASE do read the posting guide! mailing list PLEASE do read the posting guide! Received on Thu Apr 28 06:14:37 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:27 EST