Paste: FFI for Smalltalk

Author: littledan
Mode: factor
Date: Wed, 1 Apr 2009 18:36:17
Plain Text |
ERROR: bad-ffi factor-word-name ;

: string>word ( string -- word )
    dup ":" split1 swap vocab-words at
    [ ]
    [ bad-ffi ] ?if ;

M: string selector-value string>word execute( -- result ) ;
M: string selector-value: string>word execute( input -- result ) ;
M: string selector-value:value: string>word execute( input input -- result ) ;
M: string selector-value:value:value: string>word execute( input input input -- result ) ;
M: string selector-value:value:value:value: string>word execute( input input input input -- result ) ;

----
example of use:

class String extends Object [
    |underlying|
    method underlying [ ^underlying ].
    method underlying: value [ underlying := value ].
    method length [ ^'sequences:length' value: underlying ].
].
(String new underlying: 'foo') length

Annotation: stuff

Author: basti
Mode: smalltalk
Date: Thu, 28 May 2009 08:36:04
Plain Text |
fixture
	"We assume that creation through the orm works."

	semester := DLSemester new
		semesterName: 'Winter';
		year: 2009;
		save.
	
	lecture := DLLecture new
		lectureName: 'Softwaretechnik I';
		lectureDescription: 'An introduction to techniques in software development';
		semester: semester;
		save.
	
	user := DLUser new
		userName: 'john';
		save.
	
	DLUser createUserName: 'jack' email: 'jack@student.hpi.uni-potsdam.de'.
	DLUser createFrom: {#userName->'john'. #email->'john@hpi.uni-potsdam.de'. #isAdmin->true}.
	
	
	membership := DLLectureMembership new
		user: user;
		lecture: lecture;
		role: #student;
		save.

	group := DLGroup new
		groupName: 'Roundup pornös';
		groupDescription: 'Roundup in awesome';
		lecture: lecture;
		users: ( {user} as: OrderedCollection );
		save.

New Annotation

Summary:
Author:
Mode:
Body: