It is definitely possible, I already used CLIPS both on iOS and Android devices.
I approached it by compiling CLIPS as a static library using the iOS
cross compiler via a custom Makefile.
However, if you use CLIPS as it is, you might even be able to just
import the CLIPS xcode project as a dependency in an iOS project (I
did not try this myself).
Note that for the iOS simulator you need to compile for i386 and for
the phones you need armv6 and armv7.
Feel free to post questions if you get stuck.
2012/1/10 JCL <afgha...@mypacks.net>:
> --
> You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
> To post to this group, send email to CLIP...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/CLIPSESG?hl=en
>
> --> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
> Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
> Click on "Edit my membership" link.
> Select the "No Email" radio button.
> Click the "Save these settings" button.
>
> --> IF YOU WANT TO UNSUBSCRIBE <--
> Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
> Sign in
> Click on "Edit my membership" link.
> Click the "Unsubscribe" button.
> Note: This appears to be the most reliable way to unsubscribe
>
> Alternately, send email to CLIPSESG-u...@googlegroups.com. You will receive an email which you must respond to as well to unsubscribe. Clicking the link mentioned in the unsubscribe reply does not appear to work reliably.
2012/1/12 Prana Adikhrisna <rp.adi...@gmail.com>:
> For more options, visit this group at http://groups.google.com/group/CLIPSESG?hl=en
>
> --> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
> Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
> Click on "Edit my membership" link.
> Select the "No Email" radio button.
> Click the "Save these settings" button.
>
> --> IF YOU WANT TO UNSUBSCRIBE <--
> Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
For information on how to use EnvDefineFunction2, see extnfunc.h,
bmathfun.c and the Advanced Programming Guide (Volume II).
2012/1/17 JCL <afgha...@mypacks.net>:
Somebody want to start a GitHub or other open project to do this? I’d contribute. (Had the same thought for a while now.)
Ted Neward
Leading, Speaking, Consulting, Writing
--
You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
To post to this group, send email to CLIP...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/CLIPSESG?hl=en
--> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Click on "Edit my membership" link.
Select the "No Email" radio button.
Click the "Save these settings" button.
--> IF YOU WANT TO UNSUBSCRIBE <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Sign in
Click on "Edit my membership" link.
Click the "Unsubscribe" button.
Note: This appears to be the most reliable way to unsubscribe
Alternately, send email to CLIPSESG-u...@googlegroups.com. You will receive an email which you must respond to as well to unsubscribe. Clicking the link mentioned in the unsubscribe reply does not appear to work reliably.
---
You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clipsesg+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
It would seem to me that a starting point for an iCLIPS (somebody please come up with a better name) would be to simply create an app that is all one giant text area, and run CLIPS in there essentially in the same UI style as the command-line console app version. It would be cool if the app could then (as a v1.1 feature) integrate with Dropbox or something so as to be able to run CLIPS files out of a user’s Dropbox, rather than having to type them in by hand each time.
Apple has allowed other interpreter applications onto the iOS platform (see Gambit Scheme, Try F#, and so on), but I don’t know if there’s some kind of magic technical trick that those apps are using to bypass Apple’s weird restrictions. (Try F#, for example, I’m pretty sure is compiling the code on a Microsoft server and just essentially piping “stdin” and “stdout” over the web to that server, since I’m 98% certain that Don Syme and associates didn’t rewrite/port the compiler to iOS.) That said, though, I’d still be happy with a version that I have to compile on my own box and side-load onto whatever device I want to use it on; somehow, I don’t see this as being a #1-bestselling iPhone app anytime soon, even if we did get Apple’s approval to put it into the AppStore. :-)
If somebody builds this for iOS, I’ll take it as a longer-term action item to do a similar version for Android. (Compile the core CLIPS engine to a .so using the Android NDK, then build a dirt-simple Android UI for it, just the same as the above.) I just don’t have the time to do it right this month. :-/
//// ThirdViewController.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@property (strong, nonatomic) IBOutlet UITextView *outputView;
@end
==========
//// ThirdViewController.m
#import "ThirdViewController.h"
#import <UIKit/UIKit.h>
@interface ViewController ()
@end
@implementation ViewController
- (void) viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void) didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
=================
//
// AppDelegate.h
#import <UIKit/UIKit.h>
@class ViewController;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) ViewController *viewController;
@end
==========
//AppDelegate.m
#import "AppDelegate.h"
#import "ThirdViewController.h"
#import "clips.h"
@implementation AppDelegate
@synthesize window = _window;
///ADDED
- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
// END ADDED
/************************/
/* QueryInterfaceRouter */
/************************/
intBool QueryInterfaceRouter(
void *theEnv,
char *logicalName)
{
if ( (strcmp(logicalName,"stdout") == 0) ||
(strcmp(logicalName,WPROMPT) == 0) ||
(strcmp(logicalName,WTRACE) == 0) ||
(strcmp(logicalName,WERROR) == 0) ||
(strcmp(logicalName,WWARNING) == 0) ||
(strcmp(logicalName,WDISPLAY) == 0) ||
(strcmp(logicalName,WDIALOG) == 0) )
{ return(TRUE); }
return(FALSE);
}
/************************/
/* PrintInterfaceRouter */
/************************/
int PrintInterfaceRouter(
void *theEnv,
char *logicalName,
char *str)
{
NSString *theStr = [NSString stringWithCString: str encoding: NSUTF8StringEncoding];
if (str == nil)
{ return(FALSE); }
AppDelegate *theAD = (__bridge AppDelegate *) GetEnvironmentRouterContext(theEnv);
theAD.viewController.outputView.text = [theAD.viewController.outputView.text stringByAppendingString: theStr];
return(TRUE);
}
/**********************************************/
/* application:didFinishLaunchingWithOptions: */
/**********************************************/
- (BOOL) application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
{
void *theEnv;
/*self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
{ self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil]; }
else
{ self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil]; }
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
*/
theEnv = CreateEnvironment();
if (theEnv == NULL) return YES;
EnvAddRouterWithContext(theEnv,"CLIPSSimpleOutput",10,QueryInterfaceRouter,PrintInterfaceRouter,
NULL,NULL,NULL,(__bridge void *)(self));
NSString* filePath = [[NSBundle mainBundle] pathForResource: @"mab" ofType:@"clp"];
char *cFilePath = (char *) [filePath UTF8String];
EnvLoad(theEnv,cFilePath);
EnvReset(theEnv);
EnvRun(theEnv,-1);
return YES;
}
@end
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
_outputView.text = @"outlet is connected";
--
You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
To post to this group, send email to CLIP...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/CLIPSESG?hl=en
--> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Click on "Edit my membership" link.
Select the "No Email" radio button.
Click the "Save these settings" button.
--> IF YOU WANT TO UNSUBSCRIBE <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Sign in
Click on "Edit my membership" link.
Click the "Unsubscribe" button.
Note: This appears to be the most reliable way to unsubscribe
Alternately, send email to CLIPSESG-u...@googlegroups.com. You will receive an email which you must respond to as well to unsubscribe. Clicking the link mentioned in the unsubscribe reply does not appear to work reliably.
---
You received this message because you are subscribed to a topic in the Google Groups "CLIPSESG" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clipsesg/Birk6kK8opk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clipsesg+u...@googlegroups.com.