f-script-talk Mailing List for F-Script (Page 9)
Brought to you by:
pmougin
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
(4) |
Apr
(1) |
May
(1) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(3) |
Feb
(1) |
Mar
(2) |
Apr
(8) |
May
(12) |
Jun
(3) |
Jul
(5) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(4) |
2003 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
(14) |
Jun
(5) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
(2) |
Nov
(2) |
Dec
|
2004 |
Jan
(3) |
Feb
(9) |
Mar
(1) |
Apr
(6) |
May
|
Jun
|
Jul
(3) |
Aug
(3) |
Sep
(11) |
Oct
(29) |
Nov
|
Dec
(3) |
2005 |
Jan
(8) |
Feb
(12) |
Mar
|
Apr
(1) |
May
(31) |
Jun
|
Jul
(7) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(2) |
2006 |
Jan
(13) |
Feb
(1) |
Mar
(5) |
Apr
(3) |
May
(1) |
Jun
(13) |
Jul
(2) |
Aug
(22) |
Sep
(15) |
Oct
(1) |
Nov
(1) |
Dec
|
2007 |
Jan
(7) |
Feb
(3) |
Mar
(2) |
Apr
(5) |
May
|
Jun
(6) |
Jul
(2) |
Aug
(1) |
Sep
(2) |
Oct
(3) |
Nov
(12) |
Dec
(5) |
2008 |
Jan
(2) |
Feb
|
Mar
(2) |
Apr
(2) |
May
(4) |
Jun
(31) |
Jul
(9) |
Aug
(10) |
Sep
(3) |
Oct
(4) |
Nov
|
Dec
|
2009 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: J.C.Burns <jc...@fa...> - 2005-10-30 17:10:16
|
Am I correct that the FSCoreDataSample included has no persistentStores..therefore is essentially a read only example? is there some way to convert it into a read/write example so we can experiment with making changes? is there some way to edit the underlying NSMAnagedObjectModel or NSEntityDescription or is it just better to try and attach to one of our own? Thanks for any help you cam provide... --jcburns |
From: Todd B. <tbl...@ma...> - 2005-08-08 15:03:53
|
I've put out a first public version of this integration with a demo app. http://homepage.mac.com/tblanchard/ObjectiveCLIPS/ |
From: Todd B. <tbl...@ma...> - 2005-07-16 06:40:10
|
Yes, I'm working on building a little application with it to make =20 sure it is practical and I think I will release it at the end of summer. As for the special case behavior - I noticed that you already added =20 half (valueForKey:). I added the other half. :-) I spent some time trying to make NSManagedObject work with message =20 sends by overriding repondsToSelector: forwardInvocation: and =20 methodSignatureForSelector:. NSManagedObject didn't like this at all =20= and I found myself with a hung program and completely unresponsive =20 debugger. For what I'm doing, the special case is nice because before I did it, =20= all the rules had to use setValue:forKey: and this began to feel kind =20= of ugly. I can't decide yet if its worth the added complexity. I =20 got a very boring but useful application working very quickly using =20 coredata, IB, and clips rules, but I an now stuck in Hell with =20 various bits of AppKit as I try to get some custom UI working. I'll have a firmer opinion with more experience with it. On Jul 15, 2005, at 5:37 AM, Philippe Mougin wrote: > > Tood, this is quite interesting. Are you going to release this =20 > CLIPS/F-Script/Cocoa integration in some form? > About the automatic translation from setValue:val forKey:'foo' to =20 > setFoo:val for managed objects, this is something I'm considering =20 > adding to F-Script but I want to be sure it will be useful and is =20 > not going to cause unintended problems. Did you encountered any =20 > problem with it ? Do you think it's worth adding to the main F-=20 > Script distribution ? One problem I see with this kind of stuff is =20 > that the more you have such "special case" behavior, the more the =20 > language is complex and difficult to master for its users. > > Cheers, > > Philippe > > Le 14 juil. 05 =E0 03:07, Todd Blanchard a =E9crit : > >> Huh, seems like a theme. I've been working on an app based on =20 >> integrating the following components: >> >> CoreData - basic object modeling and persistence >> CLIPS - see http://www.ghg.net/clips/CLIPS.html - constraints/=20 >> intelligence/rules >> FScript - actions and predicates from CLIPS. >> >> (Yes Philippe - this is based on the thing I showed you at the =20 >> Paris Squeaknic a couple years ago). >> >> CLIPS is pretty pluggable - you can install new functions into the =20= >> interpreter by handing it a C function pointer and registering =20 >> it. You can also register a custom parser to parse the rest of =20 >> the function line. I registered a function named '[' and in the =20 >> parser I just scan to the matching ']' and then pick out the =20 >> variables in the expression and bind them in the FScript symbol =20 >> table. With this you can write predicates in FScript. So you =20 >> could write the clips rule: >> >> (defrule event-is-active >> ?event<-(Event (startDate ?start&:([NSDate date > ?start])) =20 >> (endDate ?end&:([NSDate date < endDate])) (status ~active)) >> =3D> >> ([?event setStatus: 'active'])) >> >> Which says - match any Event with a startDate later than now, an =20 >> endDate earlier than now, and status not set to active >> =3D> (then) >> set the status to active. >> >> The CoreData/CLIPS integration allows you to assert CoreData =20 >> objects as 'facts' in the CLIPS knowledge base so the rules can =20 >> match them. This is why the above rule even works. Each core =20 >> data object has a 'fact' that shadows the values. KVO allows me =20 >> to keep the fact sync'd with the object. >> >> Lately I've been wishing I could have derived attributes that are =20 >> calculated based on other attributes. This is useful for binding =20 >> table columns and such. To do this, I override valueForKey: in =20 >> KBManagedObject (my NSManagedObject subclass) to look up the =20 >> userInfo on the attribute description and look for a key called =20 >> "value". This should be an FScript expression that I toss into a =20= >> block and evaluate. I'm using this to model a Week object where I =20= >> just have one real persistent attribute 'sunday'. The 'monday', =20 >> 'tuesday' etc are transient attributes that have FScript =20 >> expressions like 'self sunday dateByAddingDays: 1'. I slap this =20 >> into a template that looks like '[:self | %@ ]' and evaluate it as =20= >> a block with the managed object as an argument. >> >> I've also notice that the latest FScript has a special case for =20 >> NSManagedObject's and "fakes" zero argument message sends that are =20= >> the same name as an attribute and calls valueForKey: I've =20 >> extended it to include mutator support as well. So even if you =20 >> are using vanilla managed objects, you can still do setFoo: val =20 >> instead of setValue: val forKey: 'Foo' >> >> This little combination has proven really powerful. I've build a =20 >> working project management app with just clips rules, IB bindings, =20= >> and a CoreData model. It works OK but its pretty vanilla. I've =20 >> been working on sexing up the UI and this is rapidly turning into =20 >> a black hole. But for quickie apps based on calculations and =20 >> constraints, this little framework is da bomb. >> >> I added the following to ExecEngine.m >> >> static NSString* keyFromMutator(NSString* key) >> { >> if([key hasPrefix: @"set"]) >> { >> key =3D [[[key substringWithRange: NSMakeRange(3,1)] =20 >> lowercaseString] >> stringByAppendingString: [key substringWithRange: =20 >> NSMakeRange(4,[key length]-5)]]; >> } >> return key; >> } >> >> and changed the special case for NSMangedObject in =20 >> sendMsgNoPattern to read: >> >> else if (![receiver isProxy] && [receiver =20 >> isKindOfClass:NSClassFromString(@"NSManagedObject")] && =20 >> [[[[receiver entity] propertiesByName] allKeys] =20 >> containsObject:keyFromMutator(selectorStr)]) >> // We don't support proxy here because it will crash when the =20 >> isKindOfClass:NSClassFromString(@"NSManagedObject") message is =20 >> executed on Mac OS X < 10.4 >> { >> if([selectorStr hasPrefix: @"set"] && [selectorStr =20 >> hasSuffix: @":"] && numbersOfArguments =3D=3D 3) >> { >> return [receiver performSelector:@selector=20 >> (setValue:forKey:) withObject: args[2] withObject: keyFromMutator=20 >> (selectorStr)]; >> } >> else >> { >> return [receiver performSelector:@selector(valueForKey:) =20 >> withObject:selectorStr]; >> } >> } >> >> >> On Jul 13, 2005, at 4:55 AM, Marcel Weiher wrote: >> >>> >>> On 13 Jul 2005, at 12:36, Massimiliano Gubinelli wrote: >>> >>> >>>> recently I wrote some code which allows to override an =20 >>>> arbitrary objc methods by sending the corresponding NSInvocation =20= >>>> to a delegate for handling. >>>> >>> >>> Cool. I wrote something very similar for Objective-Smalltalk, =20 >>> which I haven't been able to work much on recently. >>> >>> >>>> My purpose is to use this technique to extend objc classes from =20 >>>> an external language (Io, in my case). However I think that such =20= >>>> a mechanism can be also useful in F-Script to replace native =20 >>>> methods with scripts (and ultimately to be able to define ObjC =20 >>>> classes in F-Script). >>>> >>> >>> Yup. >>> >>> >>> --=20 >>> >>> Marcel Weiher Metaobject Software Technologies >>> ma...@me... www.metaobject.com >>> Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc. >>> 1d480c25f397c4786386135f8e8938e4 >>> >>> >>> >>> >>> ------------------------------------------------------- >>> This SF.Net email is sponsored by the 'Do More With Dual!' =20 >>> webinar happening >>> July 14 at 8am PDT/11am EDT. We invite you to explore the latest =20 >>> in dual >>> core and dual graphics technology at this free one hour event =20 >>> hosted by HP,AMD, and NVIDIA. To register visit http://=20 >>> www.hp.com/go/dualwebinar >>> _______________________________________________ >>> F-Script-talk mailing list >>> F-S...@li... >>> https://lists.sourceforge.net/lists/listinfo/f-script-talk >>> >> > |
From: Philippe M. <pm...@ac...> - 2005-07-15 12:33:33
|
Tood, this is quite interesting. Are you going to release this CLIPS/=20 F-Script/Cocoa integration in some form? About the automatic translation from setValue:val forKey:'foo' to =20 setFoo:val for managed objects, this is something I'm considering =20 adding to F-Script but I want to be sure it will be useful and is not =20= going to cause unintended problems. Did you encountered any problem =20 with it ? Do you think it's worth adding to the main F-Script =20 distribution ? One problem I see with this kind of stuff is that the =20 more you have such "special case" behavior, the more the language is =20 complex and difficult to master for its users. Cheers, Philippe Le 14 juil. 05 =E0 03:07, Todd Blanchard a =E9crit : > Huh, seems like a theme. I've been working on an app based on =20 > integrating the following components: > > CoreData - basic object modeling and persistence > CLIPS - see http://www.ghg.net/clips/CLIPS.html - constraints/=20 > intelligence/rules > FScript - actions and predicates from CLIPS. > > (Yes Philippe - this is based on the thing I showed you at the =20 > Paris Squeaknic a couple years ago). > > CLIPS is pretty pluggable - you can install new functions into the =20 > interpreter by handing it a C function pointer and registering it. =20= > You can also register a custom parser to parse the rest of the =20 > function line. I registered a function named '[' and in the parser =20= > I just scan to the matching ']' and then pick out the variables in =20 > the expression and bind them in the FScript symbol table. With =20 > this you can write predicates in FScript. So you could write the =20 > clips rule: > > (defrule event-is-active > ?event<-(Event (startDate ?start&:([NSDate date > ?start])) =20 > (endDate ?end&:([NSDate date < endDate])) (status ~active)) > =3D> > ([?event setStatus: 'active'])) > > Which says - match any Event with a startDate later than now, an =20 > endDate earlier than now, and status not set to active > =3D> (then) > set the status to active. > > The CoreData/CLIPS integration allows you to assert CoreData =20 > objects as 'facts' in the CLIPS knowledge base so the rules can =20 > match them. This is why the above rule even works. Each core data =20= > object has a 'fact' that shadows the values. KVO allows me to keep =20= > the fact sync'd with the object. > > Lately I've been wishing I could have derived attributes that are =20 > calculated based on other attributes. This is useful for binding =20 > table columns and such. To do this, I override valueForKey: in =20 > KBManagedObject (my NSManagedObject subclass) to look up the =20 > userInfo on the attribute description and look for a key called =20 > "value". This should be an FScript expression that I toss into a =20 > block and evaluate. I'm using this to model a Week object where I =20 > just have one real persistent attribute 'sunday'. The 'monday', =20 > 'tuesday' etc are transient attributes that have FScript =20 > expressions like 'self sunday dateByAddingDays: 1'. I slap this =20 > into a template that looks like '[:self | %@ ]' and evaluate it as =20 > a block with the managed object as an argument. > > I've also notice that the latest FScript has a special case for =20 > NSManagedObject's and "fakes" zero argument message sends that are =20 > the same name as an attribute and calls valueForKey: I've extended =20= > it to include mutator support as well. So even if you are using =20 > vanilla managed objects, you can still do setFoo: val instead of =20 > setValue: val forKey: 'Foo' > > This little combination has proven really powerful. I've build a =20 > working project management app with just clips rules, IB bindings, =20 > and a CoreData model. It works OK but its pretty vanilla. I've =20 > been working on sexing up the UI and this is rapidly turning into a =20= > black hole. But for quickie apps based on calculations and =20 > constraints, this little framework is da bomb. > > I added the following to ExecEngine.m > > static NSString* keyFromMutator(NSString* key) > { > if([key hasPrefix: @"set"]) > { > key =3D [[[key substringWithRange: NSMakeRange(3,1)] =20 > lowercaseString] > stringByAppendingString: [key substringWithRange: =20 > NSMakeRange(4,[key length]-5)]]; > } > return key; > } > > and changed the special case for NSMangedObject in sendMsgNoPattern =20= > to read: > > else if (![receiver isProxy] && [receiver =20 > isKindOfClass:NSClassFromString(@"NSManagedObject")] && =20 > [[[[receiver entity] propertiesByName] allKeys] =20 > containsObject:keyFromMutator(selectorStr)]) > // We don't support proxy here because it will crash when the =20 > isKindOfClass:NSClassFromString(@"NSManagedObject") message is =20 > executed on Mac OS X < 10.4 > { > if([selectorStr hasPrefix: @"set"] && [selectorStr hasSuffix: =20= > @":"] && numbersOfArguments =3D=3D 3) > { > return [receiver performSelector:@selector=20 > (setValue:forKey:) withObject: args[2] withObject: keyFromMutator=20 > (selectorStr)]; > } > else > { > return [receiver performSelector:@selector(valueForKey:) =20 > withObject:selectorStr]; > } > } > > > On Jul 13, 2005, at 4:55 AM, Marcel Weiher wrote: > >> >> On 13 Jul 2005, at 12:36, Massimiliano Gubinelli wrote: >> >> >>> recently I wrote some code which allows to override an arbitrary =20= >>> objc methods by sending the corresponding NSInvocation to a =20 >>> delegate for handling. >>> >> >> Cool. I wrote something very similar for Objective-Smalltalk, =20 >> which I haven't been able to work much on recently. >> >> >>> My purpose is to use this technique to extend objc classes from =20 >>> an external language (Io, in my case). However I think that such =20 >>> a mechanism can be also useful in F-Script to replace native =20 >>> methods with scripts (and ultimately to be able to define ObjC =20 >>> classes in F-Script). >>> >> >> Yup. >> >> >> --=20 >> >> Marcel Weiher Metaobject Software Technologies >> ma...@me... www.metaobject.com >> Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc. >> 1d480c25f397c4786386135f8e8938e4 >> >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by the 'Do More With Dual!' webinar =20= >> happening >> July 14 at 8am PDT/11am EDT. We invite you to explore the latest =20 >> in dual >> core and dual graphics technology at this free one hour event =20 >> hosted by HP,AMD, and NVIDIA. To register visit http://www.hp.com/=20= >> go/dualwebinar >> _______________________________________________ >> F-Script-talk mailing list >> F-S...@li... >> https://lists.sourceforge.net/lists/listinfo/f-script-talk >> > |
From: Philippe M. <pm...@ac...> - 2005-07-15 12:16:10
|
Thanks Massimiliano, this is the kind of stuff we want to have for F-=20 Script. I'll have a look at it. Cheers, Philippe Le 13 juil. 05 =E0 13:36, Massimiliano Gubinelli a =E9crit : > Hi, > recently I wrote some code which allows to override an arbitrary =20 > objc methods by sending the corresponding NSInvocation to a =20 > delegate for handling. > My purpose is to use this technique to extend objc classes from an =20 > external language (Io, in my case). However I think that such a =20 > mechanism can be also useful in F-Script to replace native methods =20 > with scripts (and ultimately to be able to define ObjC classes in F-=20= > Script). > > You can find the code for the MXMethodOverride class which =20 > implements the technique (within an example application) at > http://www.ing.unipi.it/~d9615/homepage/mac.html > > It is a beta version but works as expected. Comments are welcome. > > best, > Massimiliano Gubinelli > > > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the 'Do More With Dual!' webinar =20 > happening > July 14 at 8am PDT/11am EDT. We invite you to explore the latest in =20= > dual > core and dual graphics technology at this free one hour event =20 > hosted by HP,AMD, and NVIDIA. To register visit http://www.hp.com/=20 > go/dualwebinar > _______________________________________________ > F-Script-talk mailing list > F-S...@li... > https://lists.sourceforge.net/lists/listinfo/f-script-talk > > |
From: Marcel W. <ma...@me...> - 2005-07-14 08:12:38
|
Hi Todd! On 14 Jul 2005, at 02:07, Todd Blanchard wrote: > Huh, seems like a theme. Sure does! :-) > I've been working on an app based on integrating the following > components: > > CoreData - basic object modeling and persistence > CLIPS - see http://www.ghg.net/clips/CLIPS.html - constraints/ > intelligence/rules > FScript - actions and predicates from CLIPS. Well, one of the motives for developing Objective-Smalltalk is to act as a "language workbench", so that it becomes possible to define, for example, sublanguages. One I've done just recently is a very simple one-way constraint solver, which adds just 280 lines of code to the project because it can reuse capabilities of the base system. One of the motivations for ObSt was the realization that things like script languages, constraint systems, rule-systems, DSLs etc. are actually very similar, and can be expressed as differences in a few key concepts (this was later confirmed by "Concepts, Techniques, and Models of Computer Programming", http://www2.info.ucl.ac.be/people/ PVR/book.html ). And what's great for capturing such differences? Yup. Instead, we typically have these fairly monolithic beasts that we then have to yoke together, but after writing a couple of bridges myself I got a bit tired of that, it seemed quite wasteful and was never really satisfactory. Marcel |
From: Todd B. <tbl...@ma...> - 2005-07-14 05:15:00
|
Huh, seems like a theme. I've been working on an app based on integrating the following components: CoreData - basic object modeling and persistence CLIPS - see http://www.ghg.net/clips/CLIPS.html - constraints/ intelligence/rules FScript - actions and predicates from CLIPS. (Yes Philippe - this is based on the thing I showed you at the Paris Squeaknic a couple years ago). CLIPS is pretty pluggable - you can install new functions into the interpreter by handing it a C function pointer and registering it. You can also register a custom parser to parse the rest of the function line. I registered a function named '[' and in the parser I just scan to the matching ']' and then pick out the variables in the expression and bind them in the FScript symbol table. With this you can write predicates in FScript. So you could write the clips rule: (defrule event-is-active ?event<-(Event (startDate ?start&:([NSDate date > ?start])) (endDate ? end&:([NSDate date < endDate])) (status ~active)) => ([?event setStatus: 'active'])) Which says - match any Event with a startDate later than now, an endDate earlier than now, and status not set to active => (then) set the status to active. The CoreData/CLIPS integration allows you to assert CoreData objects as 'facts' in the CLIPS knowledge base so the rules can match them. This is why the above rule even works. Each core data object has a 'fact' that shadows the values. KVO allows me to keep the fact sync'd with the object. Lately I've been wishing I could have derived attributes that are calculated based on other attributes. This is useful for binding table columns and such. To do this, I override valueForKey: in KBManagedObject (my NSManagedObject subclass) to look up the userInfo on the attribute description and look for a key called "value". This should be an FScript expression that I toss into a block and evaluate. I'm using this to model a Week object where I just have one real persistent attribute 'sunday'. The 'monday', 'tuesday' etc are transient attributes that have FScript expressions like 'self sunday dateByAddingDays: 1'. I slap this into a template that looks like '[:self | %@ ]' and evaluate it as a block with the managed object as an argument. I've also notice that the latest FScript has a special case for NSManagedObject's and "fakes" zero argument message sends that are the same name as an attribute and calls valueForKey: I've extended it to include mutator support as well. So even if you are using vanilla managed objects, you can still do setFoo: val instead of setValue: val forKey: 'Foo' This little combination has proven really powerful. I've build a working project management app with just clips rules, IB bindings, and a CoreData model. It works OK but its pretty vanilla. I've been working on sexing up the UI and this is rapidly turning into a black hole. But for quickie apps based on calculations and constraints, this little framework is da bomb. I added the following to ExecEngine.m static NSString* keyFromMutator(NSString* key) { if([key hasPrefix: @"set"]) { key = [[[key substringWithRange: NSMakeRange(3,1)] lowercaseString] stringByAppendingString: [key substringWithRange: NSMakeRange(4,[key length]-5)]]; } return key; } and changed the special case for NSMangedObject in sendMsgNoPattern to read: else if (![receiver isProxy] && [receiver isKindOfClass:NSClassFromString(@"NSManagedObject")] && [[[[receiver entity] propertiesByName] allKeys] containsObject:keyFromMutator (selectorStr)]) // We don't support proxy here because it will crash when the isKindOfClass:NSClassFromString(@"NSManagedObject") message is executed on Mac OS X < 10.4 { if([selectorStr hasPrefix: @"set"] && [selectorStr hasSuffix: @":"] && numbersOfArguments == 3) { return [receiver performSelector:@selector(setValue:forKey:) withObject: args[2] withObject: keyFromMutator(selectorStr)]; } else { return [receiver performSelector:@selector(valueForKey:) withObject:selectorStr]; } } On Jul 13, 2005, at 4:55 AM, Marcel Weiher wrote: > > On 13 Jul 2005, at 12:36, Massimiliano Gubinelli wrote: > > >> recently I wrote some code which allows to override an arbitrary >> objc methods by sending the corresponding NSInvocation to a >> delegate for handling. >> > > Cool. I wrote something very similar for Objective-Smalltalk, > which I haven't been able to work much on recently. > > >> My purpose is to use this technique to extend objc classes from an >> external language (Io, in my case). However I think that such a >> mechanism can be also useful in F-Script to replace native methods >> with scripts (and ultimately to be able to define ObjC classes in >> F-Script). >> > > Yup. > > > -- > > Marcel Weiher Metaobject Software Technologies > ma...@me... www.metaobject.com > Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc. > 1d480c25f397c4786386135f8e8938e4 > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the 'Do More With Dual!' webinar > happening > July 14 at 8am PDT/11am EDT. We invite you to explore the latest in > dual > core and dual graphics technology at this free one hour event > hosted by HP,AMD, and NVIDIA. To register visit http://www.hp.com/ > go/dualwebinar > _______________________________________________ > F-Script-talk mailing list > F-S...@li... > https://lists.sourceforge.net/lists/listinfo/f-script-talk > |
From: Marcel W. <ma...@me...> - 2005-07-13 11:55:28
|
On 13 Jul 2005, at 12:36, Massimiliano Gubinelli wrote: > recently I wrote some code which allows to override an arbitrary > objc methods by sending the corresponding NSInvocation to a > delegate for handling. Cool. I wrote something very similar for Objective-Smalltalk, which I haven't been able to work much on recently. > My purpose is to use this technique to extend objc classes from an > external language (Io, in my case). However I think that such a > mechanism can be also useful in F-Script to replace native methods > with scripts (and ultimately to be able to define ObjC classes in F- > Script). Yup. -- Marcel Weiher Metaobject Software Technologies ma...@me... www.metaobject.com Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc. 1d480c25f397c4786386135f8e8938e4 |
From: Massimiliano G. <mg...@ma...> - 2005-07-13 11:37:14
|
Hi, recently I wrote some code which allows to override an arbitrary objc methods by sending the corresponding NSInvocation to a delegate for handling. My purpose is to use this technique to extend objc classes from an external language (Io, in my case). However I think that such a mechanism can be also useful in F-Script to replace native methods with scripts (and ultimately to be able to define ObjC classes in F- Script). You can find the code for the MXMethodOverride class which implements the technique (within an example application) at http://www.ing.unipi.it/~d9615/homepage/mac.html It is a beta version but works as expected. Comments are welcome. best, Massimiliano Gubinelli |
From: Philippe M. <pm...@ac...> - 2005-05-23 12:28:04
|
Le 21 mai 05 =E0 15:24, J.C.Burns a =E9crit : > This is probably very straightforward, but why doesn't the =20 > NSMutableArray class in the object browser list (or accept) =20 > setArray as one of its methods? It should list all methods, including setArray:. At least, it does =20 for me. Are you sure you're not overlooking something ? Best, Philippe Mougin |
From: Philippe M. <pm...@ac...> - 2005-05-21 16:35:44
|
Le 21 mai 05 =E0 17:07, Keith Ray a =E9crit : > The last time I looked at FScript's release notes, it said there was a > way to define classes in FScript code.... but there was no > documentation on how to do it. Is there now? Can someone tell me? The implementation of this feature is still experimental and has some =20= limitations (need to use KVC to access instances variables, no =20 support for "super" yet etc.) but the goal is to eventually have this =20= feature fully implemented and documented (indeed, any help is welcome). Here is an example, I already posted, where we create a new subclass =20 of NSObject, named MyClass, with three instance variables named a, b =20 and c, and define a simple method named method1: > NSObject subclass:'MyClass' instanceVariableNames:'a b c' MyClass > MyClass MyClass > MyClass setFSBlock:[:self :_cmd| 'Method ' ++ _cmd ++ ' called on =20 ' ++ self printString] asInstanceMethod:#method1 > myInstance :=3D MyClass alloc init > myInstance method1 'Method method1 called on <MyClass: 0x4bb69c0>' --- Cheers, Philippe Mougin= |
From: Keith R. <kei...@gm...> - 2005-05-21 15:07:19
|
The last time I looked at FScript's release notes, it said there was a way to define classes in FScript code.... but there was no documentation on how to do it. Is there now? Can someone tell me? --=20 C. Keith Ray <http://homepage.mac.com/keithray/blog/index.html> <http://homepage.mac.com/keithray/xpminifaq.html> <http://homepage.mac.com/keithray/resume2.html> |
From: Todd B. <tbl...@ma...> - 2005-05-21 15:01:27
|
FScript lets you send messages to obj-C objects. If you have a message that manipulates c++ objects, then you can call that. It won't let you directly call a raw C function or call a C++ method. Wrapper objects is the way to go. On May 21, 2005, at 12:38 AM, juhana kallio wrote: > hello, > > Can I use directly obj-C objects which include C++ code. There are > libraries like DevLib C++ which could be nice to interface with F- > script. > > Is it enough to make wrapper objects which include C++ calls and > use objects in F-script. > > > Juhana Kallio > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Oracle Space Sweepstakes > Want to be the first software developer in space? > Enter now for the Oracle Space Sweepstakes! > http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click > _______________________________________________ > F-Script-talk mailing list > F-S...@li... > https://lists.sourceforge.net/lists/listinfo/f-script-talk > |
From: Philippe M. <pm...@ac...> - 2005-05-21 15:00:10
|
Le 21 mai 05 =E0 09:38, juhana kallio a =E9crit : > hello, > > Can I use directly obj-C objects which include C++ code. Yes. > There are libraries like DevLib C++ which could be nice to =20 > interface with F-script. > > Is it enough to make wrapper objects which include C++ calls and =20 > use objects in F-script. This should work perfectly. Cheers, Philippe Mougin |
From: J.C.Burns <jc...@jc...> - 2005-05-21 13:24:44
|
This is probably very straightforward, but why doesn't the NSMutableArray class in the object browser list (or accept) setArray as one of its methods? jcburns |
From: juhana k. <juh...@ph...> - 2005-05-21 07:39:22
|
hello, Can I use directly obj-C objects which include C++ code. There are libraries like DevLib C++ which could be nice to interface with F-script. Is it enough to make wrapper objects which include C++ calls and use objects in F-script. Juhana Kallio |
From: Todd B. <tbl...@ma...> - 2005-05-18 06:01:07
|
That did it - thanks! On May 17, 2005, at 10:50 AM, Philippe Mougin wrote: > > Le 17 mai 05 =E0 09:05, Todd Blanchard a =E9crit : > >> I saw the messages in the archive about this problem but did not =20 >> see the solution. >> >> CompileC /Users/todd/Temp/FScript.build/FScriptFramework.build/=20 >> Objects-normal/ppc/Airplane.o FScriptFramework/Airplane.m normal =20 >> ppc objective-c com.apple.compilers.gcc.4_0 >> cd /Users/todd/Downloads/FScriptSources-20050509/FScript >> /usr/bin/gcc-3.3 -x objective-c -arch ppc -pipe -std=3Dgnu99 -=20 >> Wno-trigraphs -fasm-blocks -g -O0 -Wno-four-char-constants -=20 >> fmessage-length=3D0 -mtune=3DG4 -I/Users/todd/Temp/FScript.build/=20 >> FScriptFramework.build/FScript.hmap -Wmost -F/Users/todd/Temp -I/=20 >> Users/todd/Temp/include -I/Users/todd/Temp/FScript.build/=20 >> FScriptFramework.build/DerivedSources -c /Users/todd/Downloads/=20 >> FScriptSources-20050509/FScript/FScriptFramework/Airplane.m -o /=20 >> Users/todd/Temp/FScript.build/FScriptFramework.build/Objects-=20 >> normal/ppc/Airplane.o >> cc1obj: /Users/todd/Temp/FScript.build/FScriptFramework.build/=20 >> FScript.hmap: Not a directory >> >> Has this been fixed or is there a workaround? I removed the fix =20 >> and continue option from build styles. As you can see, I'm using =20 >> gcc3.3, yet it will not build if I start by building the framework =20= >> target. >> >> -Todd Blanchard > > > Hi Todd, nice to see you here! > > Make sure you "manually clean" the build directory by deleting it =20 > before building. Are you sure you are only using the gcc-3.3 =20 > compiler ? (the build log you showed includes a reference to =20 > "com.apple.complilers.gcc.4_0"). > > Cheers, > > Philippe Mougin |
From: Philippe M. <pm...@ac...> - 2005-05-17 23:02:50
|
Le 17 mai 05 =E0 07:37, Nicholas Crosbie a =E9crit : > I'm new to both F-Script and Cocoa. How (using > F-Script) would I map the contents of a BINARY data > file to objects. My BINARY file has HEADER, TEXT, > DATA, and ANALYSIS segments; the HEADER segment includes > ASCII-encoded integers indicating the byte offsets for > the start and end of each segment. > > Any help would be GREATLY appreciated. A typical way to handle this in Cocoa is to use the NSData class (see =20= http://developer.apple.com/documentation/Cocoa/Conceptual/BinaryData/=20 index.html) Below is an example that shows how you can get at the bytes of a =20 binary file from F-Script: I have a text file (which, after all, is also a binary data file) on =20 my desktop named "test.txt". Here is how I can read it from F-Script using NSData: "Load the content of my file into an NSData object" data :=3D NSData = dataWithContentsOfFile:'/Users/pmougin/Desktop/test.txt'. "Allocate a buffer large enough to contain all the bytes of my data" buf :=3D FSPointer malloc:data length. "Put my data in the buffer" data getBytes:buf. "Cast the pointer to my buffer to an unsigned char * (see the =20 Objective-C manual for an explanation about run-time type encoding)" buf setType:'C'. "I can now get at the bytes in my buffer" buf at:0 The last instruction return a number with a value of 72, which is the =20= ASCII code for the letter "H", which is expected because my file =20 start with the word "Hello". To get the value of the 2th byte you do =20 "buf at:1", which in my case returns 101, the ASCII code for the =20 letter "e", etc. When you are done with the buffer, don't forget to send it a free =20 message (i.e. "buf free") in order to dispose it. Alternatively you =20 can do "buf setFreeWhenDone:YES" after creating the buffer (or =20 later). The system will then take care of disposing the buffer when =20 you are done with it. Best, Philippe Mougin= |
From: Philippe M. <pm...@ac...> - 2005-05-17 17:47:38
|
Le 17 mai 05 =E0 09:05, Todd Blanchard a =E9crit : > I saw the messages in the archive about this problem but did not =20 > see the solution. > > CompileC /Users/todd/Temp/FScript.build/FScriptFramework.build/=20 > Objects-normal/ppc/Airplane.o FScriptFramework/Airplane.m normal =20 > ppc objective-c com.apple.compilers.gcc.4_0 > cd /Users/todd/Downloads/FScriptSources-20050509/FScript > /usr/bin/gcc-3.3 -x objective-c -arch ppc -pipe -std=3Dgnu99 -Wno-=20= > trigraphs -fasm-blocks -g -O0 -Wno-four-char-constants -fmessage-=20 > length=3D0 -mtune=3DG4 -I/Users/todd/Temp/FScript.build/=20 > FScriptFramework.build/FScript.hmap -Wmost -F/Users/todd/Temp -I/=20 > Users/todd/Temp/include -I/Users/todd/Temp/FScript.build/=20 > FScriptFramework.build/DerivedSources -c /Users/todd/Downloads/=20 > FScriptSources-20050509/FScript/FScriptFramework/Airplane.m -o /=20 > Users/todd/Temp/FScript.build/FScriptFramework.build/Objects-normal/=20= > ppc/Airplane.o > cc1obj: /Users/todd/Temp/FScript.build/FScriptFramework.build/=20 > FScript.hmap: Not a directory > > Has this been fixed or is there a workaround? I removed the fix =20 > and continue option from build styles. As you can see, I'm using =20 > gcc3.3, yet it will not build if I start by building the framework =20 > target. > > -Todd Blanchard Hi Todd, nice to see you here! Make sure you "manually clean" the build directory by deleting it =20 before building. Are you sure you are only using the gcc-3.3 =20 compiler ? (the build log you showed includes a reference to =20 "com.apple.complilers.gcc.4_0"). Cheers, Philippe Mougin= |
From: Todd B. <tbl...@ma...> - 2005-05-17 07:05:48
|
I saw the messages in the archive about this problem but did not see the solution. CompileC /Users/todd/Temp/FScript.build/FScriptFramework.build/ Objects-normal/ppc/Airplane.o FScriptFramework/Airplane.m normal ppc objective-c com.apple.compilers.gcc.4_0 cd /Users/todd/Downloads/FScriptSources-20050509/FScript /usr/bin/gcc-3.3 -x objective-c -arch ppc -pipe -std=gnu99 -Wno- trigraphs -fasm-blocks -g -O0 -Wno-four-char-constants -fmessage- length=0 -mtune=G4 -I/Users/todd/Temp/FScript.build/ FScriptFramework.build/FScript.hmap -Wmost -F/Users/todd/Temp -I/ Users/todd/Temp/include -I/Users/todd/Temp/FScript.build/ FScriptFramework.build/DerivedSources -c /Users/todd/Downloads/ FScriptSources-20050509/FScript/FScriptFramework/Airplane.m -o /Users/ todd/Temp/FScript.build/FScriptFramework.build/Objects-normal/ppc/ Airplane.o cc1obj: /Users/todd/Temp/FScript.build/FScriptFramework.build/ FScript.hmap: Not a directory Has this been fixed or is there a workaround? I removed the fix and continue option from build styles. As you can see, I'm using gcc3.3, yet it will not build if I start by building the framework target. -Todd Blanchard |
From: Nicholas C. <cro...@ya...> - 2005-05-17 05:37:52
|
I'm new to both F-Script and Cocoa. How (using F-Script) would I map the contents of a BINARY data file to objects. My BINARY file has HEADER, TEXT, DATA, and ANALYSIS segments; the HEADER segment includes ASCII-encoded integers indicating the byte offsets for the start and end of each segment. Any help would be GREATLY appreciated. Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com |
From: Philippe M. <pm...@ac...> - 2005-05-13 09:29:53
|
Le 13 mai 05 =E0 00:32, David Bainbridge a =E9crit : > Greetings, > I am using FScript in an application that usually resides on a windows > server (there is a MS windows version of the app also). If the user > tries to copy the application onto a Windows 2000 server that they are > connected to with AFP then they get an error that the following file's > name is too long: > > FSCollectionInspectorView10_2.nib > > I will probably just shorten the name and recompile the source myself > but thought I would mention this. Thanks. Alternatively, if the application is only used on Mac OS X =20 10.3 and later, I believe you can just remove the =20 FSCollectionInspectorView10_2.nib from inside the binary package of =20 your application since this file is only needed when running on Mac =20 OS X 10.2 when the collection inspector is used. (To open a =20 collection inspector in order to check if the modification works, =20 just type something like "5 iota inspectWithSystem:sys"). Cheers, Philippe Mougin |
From: David B. <dba...@gm...> - 2005-05-13 00:20:39
|
Greetings, I am using FScript in an application that usually resides on a windows server (there is a MS windows version of the app also). If the user tries to copy the application onto a Windows 2000 server that they are connected to with AFP then they get an error that the following file's name is too long: FSCollectionInspectorView10_2.nib I will probably just shorten the name and recompile the source myself but thought I would mention this. |
From: Philippe M. <pm...@ac...> - 2005-05-11 11:29:37
|
The release candidate announced here a few days ago has been released as "F-Script 1.3". Release notes are available on-line at http://www.fscript.org/ releaseNotes/ You can download F-Script 1.3 from http://www.fscript.org/download/ download.htm Cheers, Philippe Mougin |
From: Philippe M. <pm...@ac...> - 2005-05-10 18:08:50
|
A new release candidate for the source code package of F-Script 1.3 is available at: http://www.fscript.org/download/FScriptSources-20050509.tar.gz This version fix an issues with case sensitive systems and includes a note in the readme file about the need to use gcc-3.3 to build F-Script. Please, test and report problems ASAP. Cheers, Philippe Mougin |