# US 2008/0307390 A1 · Class declaration in a non-class-based programming environment

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2008/0307390 A1
- Document ID: US20080307390A1
- Status: Published application
- Kind: A1
- Application number: 11/811,098
- Filed: 2007-06-08
- Published: 2008-12-11
- Earliest claimed: 2007-06-08
- Assignees: Apple Inc.
- Inventors: Benoit Marchant
- Web page: https://patentgrep.com/patent/US20080307390A1

## CPC

- G06F 9/449: {Object-oriented method invocation or resolution}
- G06F 8/315: {Object-oriented languages}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Facilitating declaration of a class or function using a programming language that is not a class-based object-oriented programming (OOP) language is disclosed. A call to a function, defined using the programming language, that has a name that is a near variant of the reserved word “class” is received. In response to the call, a new function that includes, if applicable, the methods and variables of a parent function designated, using a syntax that is a near variant of a corresponding class-based OOP syntax, to be a super class of the new function and includes one or more methods, variables, or both designated, using a syntax that is a near variant of a corresponding class-based OOP syntax, to be implemented by the new function is defined programmatically.

## Claims

### Claim 1

A method of facilitating declaration of a class or function using a programming language that is not a class-based object-oriented programming (OOP) language, comprising:
receiving a call to a function, defined using the programming language, that has a name that is a near variant of the reserved word “class”; and
defining programmatically, in response to the call, a new function that:
includes, if applicable, the methods and variables of a parent function designated, using a syntax that is a near variant of a corresponding class-based OOP syntax, to be a super class of the new function; and
includes one or more methods, variables, or both designated, using a syntax that is a near variant of a corresponding class-based OOP syntax, to be implemented by the new function.

### Claim 2 (depends on 1)

A method as recited in claim 1, wherein the near variant differs from the reserved word “class” by one character.

### Claim 3 (depends on 2)

A method as recited in claim 2, wherein the different character comprises one or more of the following: an additional character; an omitted character; an underscore or other character preceding the word “super”; capitalization of a letter in the word “super”; and capitalization of the first letter in the word “super”.

### Claim 4 (depends on 1)

A method as recited in claim 1, wherein the programming language comprises a language that provides prototype-based inheritance.

### Claim 5 (depends on 1)

A method as recited in claim 1, wherein the. programming language comprises a script language.

### Claim 6 (depends on 1)

A method as recited in claim 1, wherein the programming language comprises the JavaScript™ language.

### Claim 7 (depends on 1)

A method as recited in claim 1, wherein the methods and variables of the parent function are included by operation of a function or method that has a name that is a near variant of the reserved word “extends”.

### Claim 8 (depends on 1)

A method as recited in claim 1, wherein the one or more methods, variables, or both designated, using a syntax that is a near variant of a corresponding class-based OOP syntax, to be implemented by the new function are included by operation of a function or method that has a name that is a near variant of the reserved word “implements”.

### Claim 9 (depends on 1)

A method as recited in claim 1, further comprising using the programming language to define the function that has a name that is a near variant of the reserved word “class”.

### Claim 10 (depends on 1)

A method as recited in claim 1, wherein the function that has a name that is a near variant of the reserved word “class” returns a stub object.

### Claim 11 (depends on 10)

A method as recited in claim 10, wherein the stub object includes a method configured to cause the methods and variables of the parent function to be inherited by the new function.

### Claim 12 (depends on 1)

A method as recited in claim 1, wherein the function that has a name that is a near variant of the reserved word “class” defines a method that has a name that is a near variant of the reserved word “extends”.

### Claim 13 (depends on 12)

A method as recited in claim 12, wherein the method that has a name that is a near variant of the reserved word “extends” is configured to cause the parameters of a function provided as an argument to the method to be included programmatically in the definition of the new function.

### Claim 14 (depends on 12)

A method as recited in claim 12, wherein the method that has a name that is a near variant of the reserved word “extends” defines a further method configured to cause the one or more methods, variables, or both designated to be implemented by the new function to be included programmatically in the definition of the new function.

### Claim 15

A system configured to facilitate declaration of a class or function using a programming language that is not a class-based object-oriented programming (OOP) language, comprising:
a memory configured to store a class definition generation function, defined using the programming language, that has a name that is a near variant of the reserved word “class”; and
a processor coupled to the memory and configured to:
receive a call to the class definition generation function; and
defining programmatically, in response to the call, a new function that:
includes, if applicable, the methods and variables of a parent function designated, using a syntax that is a near variant of a corresponding class-based OOP syntax, to be a super class of the new function; and
includes one or more methods, variables, or both designated, using a syntax that is a near variant of a corresponding class-based OOP syntax, to be implemented by the new function.

### Claim 16 (depends on 15)

A system as recited in claim 15, wherein the processor is configured to return a stub object in response to the class definition generation function being called.

### Claim 17 (depends on 16)

A system as recited in claim 16, wherein the stub object includes a method configured to cause the methods and variables of the parent function to be inherited by the new function.

### Claim 18

A computer program product for facilitating declaration of a class or function using a programming language that is not a class-based object-oriented programming (OOP) language, the computer program product being embodied in a computer readable medium and comprising computer instructions for:
receiving a call to a function, defined using the programming language, that has a name that is a near variant of the reserved word “class”; and
defining programmatically, in response to the call, a new function that:
includes, if applicable, the methods and variables of a parent function designated, using a syntax that is a near variant of a corresponding class-based OOP syntax, to be a super class of the new function; and
includes one or more methods, variables, or both designated, using a syntax that is a near variant of a corresponding class-based OOP syntax, to be implemented by the new function.

### Claim 19 (depends on 18)

A computer program product as recited in claim 18, wherein the function that has a name that is a near variant of the reserved word “class” returns a stub object.

### Claim 20 (depends on 19)

A computer program product as recited in claim 19, wherein includes a method configured to cause the methods and variables of the parent function to be inherited by the new function.
